elinks icon indicating copy to clipboard operation
elinks copied to clipboard

Incomplete execinfo checks causes linking error on non-glibc systems

Open aabacchus opened this issue 3 years ago • 1 comments

Musl doesn't have the backtrace symbols, which are glibc extensions. libexecinfo is an alternative provider of these symbols. The only existing test for them is if the file /usr/include/execinfo.h exists, but on a musl system with libexecinfo installed, this does not mean that the backtrace symbols are in libc; they need to be linked in with -lexecinfo.

https://github.com/rkd77/elinks/blob/ea7094ecb1ccc1f77e9ed28237d2aa4922596443/configure.ac#L1481-L1482 https://github.com/rkd77/elinks/blob/ea7094ecb1ccc1f77e9ed28237d2aa4922596443/src/util/error.c#L279-L280

    [LINK]   src/elinks
ld: error: undefined symbol: backtrace
>>> referenced by error.c:287 (src/util/error.c:287)
>>>               lib.o:(dump_backtrace)

ld: error: undefined symbol: backtrace_symbols
>>> referenced by error.c:296 (src/util/error.c:296)
>>>               lib.o:(dump_backtrace)

ld: error: undefined symbol: backtrace_symbols_fd
>>> referenced by error.c:291 (src/util/error.c:291)
>>>               lib.o:(dump_backtrace)
collect2: error: ld returned 1 exit status

The best way of solving this is probably with the AC_SEARCH_LIBS macro.

aabacchus avatar Sep 21 '22 11:09 aabacchus

In current Alpine Edge there is no libexecinfo-dev. They say in previous versions libexecinfo segfaulted. Propose solution is to disable backtrace in elinks compilation on such systems.

rkd77 avatar Sep 21 '22 13:09 rkd77