Skip to content

Expose stacktrace libraries as build features#202

Merged
apolukhin merged 4 commits intoboostorg:developfrom
uilianries:b2/lib-options
Jan 18, 2025
Merged

Expose stacktrace libraries as build features#202
apolukhin merged 4 commits intoboostorg:developfrom
uilianries:b2/lib-options

Conversation

@uilianries
Copy link
Contributor

@uilianries uilianries commented Jan 16, 2025

Hello! As I commented in the issue #195, this PR exposes all stacktrace libraries as boost features, mirroring what's available in the CMakeLists.txt in this project. So users will be able to build or not specific libraries present in this project. Here are some keypoints to evaluate these new changes:

close #195

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@apolukhin
Copy link
Member

apolukhin commented Jan 16, 2025

CI breaks with the following message:

 clang-linux.compile.c++ bin.v2/libs/stacktrace/test/from_exception_disabled_none_ho.test/clang-linux-15/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/test_from_exception_none.o
clang-linux.link bin.v2/libs/stacktrace/test/from_exception_disabled_none_ho.test/clang-linux-15/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/from_exception_disabled_none_ho
/usr/bin/ld: bin.v2/libs/stacktrace/test/from_exception_disabled_none_ho.test/clang-linux-15/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/from_exception_disabled_none_ho: hidden symbol `_ZN5boost10stacktrace6detail18this_thread_frames7collectEPPKvmm' in bin.v2/libs/stacktrace/test/from_exception_disabled_none_ho.test/clang-linux-15/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/test_from_exception_none.o is referenced by DSO
/usr/bin/ld: final link failed: bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Same for GCC:

gcc.compile.c++ bin.v2/libs/stacktrace/test/from_exception_disabled_bt_ho.test/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/test_from_exception_none.o
gcc.link bin.v2/libs/stacktrace/test/from_exception_disabled_bt_ho.test/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/from_exception_disabled_bt_ho
/usr/bin/ld: bin.v2/libs/stacktrace/build/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/libboost_stacktrace_from_exception.so.1.88.0: undefined reference to `boost::stacktrace::detail::this_thread_frames::collect(void const**, unsigned long, unsigned long)'
collect2: error: ld returned 1 exit status

    "g++-9"  -Wl,-rpath -Wl,"/home/runner/work/stacktrace/boost-root/bin.v2/libs/stacktrace/build/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden" -Wl,-rpath-link -Wl,"/home/runner/work/stacktrace/boost-root/bin.v2/libs/stacktrace/build/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden" -o "bin.v2/libs/stacktrace/test/from_exception_disabled_bt_ho.test/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/from_exception_disabled_bt_ho" -Wl,--start-group "bin.v2/libs/stacktrace/test/from_exception_disabled_bt_ho.test/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/test_from_exception_none.o" "bin.v2/libs/stacktrace/build/gcc-9/release/x86_64/cxxstd-2a-iso/threading-multi/visibility-hidden/libboost_stacktrace_from_exception.so.1.88.0"  -Wl,-Bstatic -lbacktrace -Wl,-Bdynamic -lrt -ldl -Wl,--end-group -fPIC -m64 -pthread -std=c++2a -fvisibility=hidden -fvisibility-inlines-hidden -lpthread

@uilianries
Copy link
Contributor Author

@apolukhin Thank you for informing, I'll check it. I only tested on Linux-GCC (locally) so far.

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries
Copy link
Contributor Author

@apolukhin Could please run the CI again. I just updated the code to avoid injecting those common constants to all libraries. Locally, I was able to reproduce the CI error and mitigate it by reverting that.

@coveralls
Copy link

Coverage Status

coverage: 86.371%. remained the same
when pulling b0d687c on uilianries:b2/lib-options
into ea28232 on boostorg:develop.

@apolukhin apolukhin merged commit 54934a3 into boostorg:develop Jan 18, 2025
42 checks passed
@apolukhin
Copy link
Member

Many thanks for the PR!

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

Successfully merging this pull request may close these issues.

Expose Boost.Stacktrace Internal Libraries as Optional in Boost.Build

3 participants