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

Build fails looking for execinfo.h when building against musl #1956

Closed
James-TR opened this issue Dec 17, 2014 · 2 comments
Closed

Build fails looking for execinfo.h when building against musl #1956

James-TR opened this issue Dec 17, 2014 · 2 comments

Comments

@James-TR
Copy link
Contributor

execinfo.h is a GNU specific header, and doesn't exist under musl.

A suggestion would be to make it so this feature is auto-detected to exist, and even add a configure flag.

Relevant log entry:

x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I. -I..   -pthread     -I.. -I.. -DSYSCONFDIR=\"/etc/powerdns\" -DPKGLIBDIR=\"/usr/lib/powerdns/pdns\" -DLOCALSTATEDIR=\"/var/run\" -pthread    -I../pdns/ext/rapidjson/include -I../pdns/ext/yahttp -D_GNU_SOURCE -march=native -O2 -fstack-protector-all -fomit-frame-pointer -fstack-protector --param ssp-buffer-size=4 -fPIE -DPIE -c -o receiver.o receiver.cc
receiver.cc:377:22: fatal error: execinfo.h: No such file or directory
 #include <execinfo.h>
                      ^
@James-TR
Copy link
Contributor Author

pdns/pdns/receiver.cc

Lines 376 to 397 in 201464d

#ifdef __linux__
#include <execinfo.h>
static void tbhandler(int num)
{
L<<Logger::Critical<<"Got a signal "<<num<<", attempting to print trace: "<<endl;
void *array[20]; //only care about last 17 functions (3 taken with tracing support)
size_t size;
char **strings;
size_t i;
size = backtrace (array, 20);
strings = backtrace_symbols (array, size); //Need -rdynamic gcc (linker) flag for this to work
for (i = 0; i < size; i++) //skip useless functions
L<<Logger::Error<<strings[i]<<endl;
signal(SIGABRT, SIG_DFL);
abort();//hopefully will give core
}
#endif
appears to be the offending lines of code. You can't rely on Linux to only use glibc.

@Habbie
Copy link
Member

Habbie commented Dec 18, 2014

Fixed by merge of #1958

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