elinks
elinks copied to clipboard
Build fails on OpenBSD 7.6
Trying to build latest master branch of ELinks:
$ git describe
elinks-0.12pre5-3939-g1655143d0
using OpenBSD 7.6-release fails. I have attached the configured options here: configure-build.txt.
I am getting the following output:
$ meson compile -C build
[...]
ld: warning: l10nflist.c:206 (../src/intl/gettext/l10nflist.c:206)(src/elinks.p/intl_gettext_l10nflist.c.o:(_nl_make_l10nflist)): warning: stpcpy() is dangerous; do not use it
ld: error: undefined symbol: backtrace
>>> referenced by error.c:287 (../src/util/error.c:287)
>>> src/elinks.p/util_error.c.o:(dump_backtrace)
ld: error: undefined symbol: backtrace_symbols_fd
>>> referenced by error.c:291 (../src/util/error.c:291)
>>> src/elinks.p/util_error.c.o:(dump_backtrace)
ld: error: undefined symbol: backtrace_symbols
>>> referenced by error.c:296 (../src/util/error.c:296)
>>> src/elinks.p/util_error.c.o:(dump_backtrace)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
[3/5] Generating doc/manual.html with a custom command
ninja: build stopped: subcommand failed.
I have found what seems to be a similar issue here, for building libmprompt under FreeBSD. Not sure if it is the same issue, but there it was solved by adding libexecinfo to the list of libraries to be linked with.
Does it build, if: export LDFLAGS=-lexecinfo before meson invocation?
I just tested that adding
deps += declare_dependency(link_args: ['-lexecinfo'])
to meson.build works.
Edit: The above method, export-ing LDFLAGS, doesn't seem to work.
Another question. Has libexinfo .pc (pkgconfig) file?
No, libexecinfo doesn't include the pkgconfig .pc file. There's the source code of the library, and also:
$ su
# find /usr -name '*execinfo*'
/usr/local/share/aclocal/ax_execinfo.m4
/usr/lib/libexecinfo.so.3.0
/usr/lib/libexecinfo.a
/usr/lib/libexecinfo_p.a
/usr/include/execinfo.h
/usr/ports/lang/gcc/11/patches/patch-libphobos_libdruntime_core_sys_openbsd_execinfo_d
Edit: There's also libbacktrace in ports, but it also doesn't have the .pc file.
Edit 2: That libbacktrace seems pretty old, and the current ports tree doesn't have it. I found it linked on (probably outdated) ports.su page.
Try these ^ two commits.
I can confirm that compiling from
$ git describe
elinks-0.12pre5-3942-g302470b82
works without errors (only some warnings unrelated to this issue). If that is the final fix, feel free to close this issue.