Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete execinfo checks causes linking error on non-glibc systems #191

Open
aabacchus opened this issue Sep 21, 2022 · 1 comment
Open

Comments

@aabacchus
Copy link

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.

elinks/configure.ac

Lines 1481 to 1482 in ea7094e

AC_CHECK_HEADERS(execinfo.h, HAVE_EXECINFO=yes, HAVE_EXECINFO=no)
# possible checks for other system-specific means go here

elinks/src/util/error.c

Lines 279 to 280 in ea7094e

#ifdef HAVE_EXECINFO_H
/* glibc way of doing this */

    [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.

@rkd77
Copy link
Owner

rkd77 commented Sep 21, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants