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

What set of b2 options builds the boost_stacktrace_from_exception library? #162

Open
bgemmill opened this issue Apr 19, 2024 · 6 comments
Open

Comments

@bgemmill
Copy link

If I download boost 1.85, and go into stacktrace and do a build:

cd libs/stacktrace/build
../../../b2 'define=BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=</usr/lib/gcc/x86_64-linux-gnu/11/include/backtrace.h>' boost_stacktrace_from_exception
Performing configuration checks

    - default address-model    : none (cached) [1]
    - default architecture     : none (cached) [1]
    - cxx11_rvalue_references  : yes (cached) [2]
    - cxx11_rvalue_references  : yes (cached) [3]
    - libbacktrace builds      : no  (cached) [2]
    - cxx11_rvalue_references  : yes (cached) [4]
    - libbacktrace builds      : no  (cached) [4]

[1] clang-18
[2] clang-linux-18/debug/python-3.10/visibility-hidden
[3] clang-linux-18/debug/link-static/python-3.10/visibility-hidden
[4] clang-linux-18/debug/build-no/python-3.10/visibility-hidden
...found 1 target...

libbacktrace isn't found and the boost_stacktrace_from_exception library won't be built.

Is there a better set of options to use here to build stacktrace?

@apolukhin
Copy link
Member

Add -d+2 to the command line to get more information about the build.

For example:

boost/libs/stacktrace/build$ ../../../b2 'define=BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=</usr/lib/gcc/x86_64-linux-gnu/11/include/backtrace.h>' boost_stacktrace_from_exception -d+2
Performing configuration checks

    - default address-model    : 64-bit (cached) [1]
    - default architecture     : x86 (cached) [1]
    - symlinks supported       : yes (cached)
    - cxx11_rvalue_references  : yes [2]
    - cxx11_rvalue_references  : yes [2]

[1] gcc-9
[2] gcc-9/debug/threadapi-pthread/visibility-hidden
gcc.compile.c++ ../../../bin.v2/libs/stacktrace/build/gcc-9/debug/visibility-hidden/from_exception.o

    "g++"   -fvisibility-inlines-hidden -fPIC -m64 -O0 -fno-inline -Wall -g -fvisibility=hidden  -DBOOST_ALL_NO_LIB=1 -DBOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=</usr/lib/gcc/x86_64-linux-gnu/11/include/backtrace.h>  -I"../../.."  -c -o "../../../bin.v2/libs/stacktrace/build/gcc-9/debug/visibility-hidden/from_exception.o" "../../../libs/stacktrace/build/../src/from_exception.cpp"

/bin/sh: 2: cannot open /usr/lib/gcc/x86_64-linux-gnu/11/include/backtrace.h: No such file

What is the output in your case?

@bgemmill
Copy link
Author

bgemmill commented Apr 30, 2024

$ ../../../b2 'define=BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=</usr/lib/gcc/x86_64-linux-gnu/13/include/backtrace.h>' -d+2 boost_stacktrace_from_exception
Performing configuration checks

    - default address-model    : 64-bit (cached) [1]
    - default architecture     : x86 (cached) [1]
    - cxx11_rvalue_references  : yes (cached) [2]
    - cxx11_rvalue_references  : yes (cached) [2]
    - cxx11_rvalue_references  : yes (cached) [3]
    - cxx11_rvalue_references  : yes (cached) [3]
    - libbacktrace builds      : no  (cached) [2]
    - cxx11_rvalue_references  : yes (cached) [4]
    - libbacktrace builds      : no  (cached) [4]
    - addr2line builds         : yes (cached) [2]
    - addr2line builds         : yes (cached) [2]
    - WinDbg builds            : no  (cached) [2]
    - WinDbg builds            : no  (cached) [2]
    - WinDbg builds            : no  (cached) [4]
    - WinDbgCached builds      : no  (cached) [2]
    - WinDbgCached builds      : no  (cached) [4]

[1] clang-18
[2] clang-linux-18/debug/python-3.12/visibility-hidden
[3] clang-linux-18/debug/link-static/python-3.12/visibility-hidden
[4] clang-linux-18/debug/build-no/python-3.12/visibility-hidden

edit: copied the wrong output the first time.

Am I definining the location of backtrace correctly for b2 here?

@apolukhin
Copy link
Member

LGTM

@apolukhin
Copy link
Member

Add a -a along with -d+2 option, so that the cached values are recomputed. Attach the build log to this issue

@bgemmill
Copy link
Author

Thanks for getting back to me. I see:

$ ../../../b2 -d+2 -a 'define=BOOST_STACKTRACE_BACKTRACE_INCLUDE_FILE=</usr/lib/gcc/x86_64-linux-gnu/13/include/backtrace.h>' boost_stacktrace_from_exception
Performing configuration checks

    - default address-model    : none [1]
    - default architecture     : none [1]
    - cxx11_rvalue_references  : yes [2]
    - cxx11_rvalue_references  : yes [3]
    - libbacktrace builds      : no [2]
    - cxx11_rvalue_references  : yes [4]
    - libbacktrace builds      : no [4]

[1] clang-18
[2] clang-linux-18/debug/python-3.12/visibility-hidden
[3] clang-linux-18/debug/link-static/python-3.12/visibility-hidden
[4] clang-linux-18/debug/build-no/python-3.12/visibility-hidden

This appears to output a 0 byte file called -DTEST_BOOST_NO_CXX11_RVALUE_REFERENCES.

Are there other build logs I should be looking for?

@apolukhin
Copy link
Member

Changed the behavior in upstream in 2c83563

Just provide an explicit boost.stacktrace.from_exception=on option and the library should build... or output a readable error message

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