stacktrace icon indicating copy to clipboard operation
stacktrace copied to clipboard

clang and libbacktrace detection

Open bgemmill opened this issue 2 years ago • 0 comments

I'm trying to build boost with clang and get the library boost_stacktrace_backtrace at the end.

If we use a process like this to just build stacktrace:

./bootstrap.sh --with-toolset=clang
cd libs/stacktrace/build
../../../b2 -a libbacktrace

We get the error: ../../../libs/stacktrace/build/has_backtrace.cpp:7:10: fatal error: 'backtrace.h' file not found

Which makes sense, given that backtrace.h lives in gcc's library location, and not clang's.

The issue is that there does not seem to be a set of b2 options that will fix this issue for clang, because has_backtrace.cpp does not use BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE like the rest of stacktrace does.

This means that even if a user tries to point b2 to libbacktrace via define=BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=... as documented here, has_backtrace.cpp will still fail to detect anything.

Could has_backtrace.cpp please be changed to use BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE?

bgemmill avatar Nov 23 '21 02:11 bgemmill