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

ld: warning: cannot export hidden symbol typeinfo for tbb::detail::r1::unsafe_wait #713

Closed
phprus opened this issue Jan 3, 2022 · 8 comments
Labels

Comments

@phprus
Copy link
Contributor

phprus commented Jan 3, 2022

Commit: d1667d5
macOS 12.1
Xcode 13.2.1

Linker warning:

ld: warning: cannot export hidden symbol typeinfo for tbb::detail::r1::unsafe_wait from CMakeFiles/tbb.dir/exception.cpp.o

Workaround: Export any method from class unsafe_wait.
Workaround example: phprus@053de91

But, I'm not sure if this workaround doesn't break backward compatibility.

@anton-potapov
Copy link
Contributor

anton-potapov commented Jan 10, 2022

@alexey-katranov, @vlserov , is #706 brake this ?

@vlserov
Copy link

vlserov commented Jan 10, 2022

This is odd. def files should be used for exporting symbols.
Export rules for tbb::detail::r1::unsafe_wait exception are present for MacOS and Linux.
Those rules are missed for Windows and should be added as well.

@phprus
Copy link
Contributor Author

phprus commented Jan 10, 2022

@alexey-katranov, @vlserov,

Export rules for macOS:
https://github.com/oneapi-src/oneTBB/blob/d1667d514df697f05d771602b268e92560c434c4/src/tbb/def/mac64-tbb.def#L52-L61

Export rules for Linux 64-bit:
https://github.com/oneapi-src/oneTBB/blob/e386c96debbdb2944e404323ee8682c5293f96ff/src/tbb/def/lin64-tbb.def#L50-L59

For all other exception classes
https://github.com/oneapi-src/oneTBB/blob/e386c96debbdb2944e404323ee8682c5293f96ff/include/oneapi/tbb/detail/_exception.h#L51-L66

export rules does not contain exports what() member.

Only typeinfo and vtable is exported:

% c++filt '__ZTIN3tbb6detail2r114bad_last_allocE'
typeinfo for tbb::detail::r1::bad_last_alloc
% c++filt '__ZTVN3tbb6detail2r114bad_last_allocE'
vtable for tbb::detail::r1::bad_last_alloc

what() exported by macro __TBB_EXPORTED_METHOD

@alexey-katranov
Copy link
Contributor

It seems related to #566. How does it work on Windows...?

@anton-potapov
Copy link
Contributor

@phprus , the warning is issues during the build of the library or the tests?

@phprus
Copy link
Contributor Author

phprus commented Jan 20, 2022

@anton-potapov, on build the library libtbb.dylib:

[ 17%] Linking CXX shared library ../../appleclang_13.0_cxx17_64_release/libtbb.dylib
cd /Users/phprus/Devel/oneapi-src/tmp/pr739/oneTBB-0ef804884856e791fe7bb173078a92daf3929f76/build/release/src/tbb && /opt/homebrew/Cellar/cmake/3.22.1/bin/cmake -E cmake_link_script CMakeFiles/tbb.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -O3 -DNDEBUG -flto=thin -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -dynamiclib -Wl,-headerpad_max_install_names -Wl,-exported_symbols_list,/Users/phprus/Devel/oneapi-src/tmp/pr739/oneTBB-0ef804884856e791fe7bb173078a92daf3929f76/src/tbb/def/mac64-tbb.def -compatibility_version 12.0.0 -current_version 12.6.0 -o ../../appleclang_13.0_cxx17_64_release/libtbb.12.6.dylib -install_name @rpath/libtbb.12.dylib CMakeFiles/tbb.dir/address_waiter.cpp.o CMakeFiles/tbb.dir/allocator.cpp.o CMakeFiles/tbb.dir/arena.cpp.o CMakeFiles/tbb.dir/arena_slot.cpp.o CMakeFiles/tbb.dir/concurrent_bounded_queue.cpp.o CMakeFiles/tbb.dir/dynamic_link.cpp.o CMakeFiles/tbb.dir/exception.cpp.o CMakeFiles/tbb.dir/governor.cpp.o CMakeFiles/tbb.dir/global_control.cpp.o CMakeFiles/tbb.dir/itt_notify.cpp.o CMakeFiles/tbb.dir/main.cpp.o CMakeFiles/tbb.dir/market.cpp.o CMakeFiles/tbb.dir/misc.cpp.o CMakeFiles/tbb.dir/misc_ex.cpp.o CMakeFiles/tbb.dir/observer_proxy.cpp.o CMakeFiles/tbb.dir/parallel_pipeline.cpp.o CMakeFiles/tbb.dir/private_server.cpp.o CMakeFiles/tbb.dir/profiling.cpp.o CMakeFiles/tbb.dir/rml_tbb.cpp.o CMakeFiles/tbb.dir/rtm_mutex.cpp.o CMakeFiles/tbb.dir/rtm_rw_mutex.cpp.o CMakeFiles/tbb.dir/semaphore.cpp.o CMakeFiles/tbb.dir/small_object_pool.cpp.o CMakeFiles/tbb.dir/task.cpp.o CMakeFiles/tbb.dir/task_dispatcher.cpp.o CMakeFiles/tbb.dir/task_group_context.cpp.o CMakeFiles/tbb.dir/version.cpp.o CMakeFiles/tbb.dir/queuing_rw_mutex.cpp.o
ld: warning: cannot export hidden symbol typeinfo for tbb::detail::r1::unsafe_wait from CMakeFiles/tbb.dir/exception.cpp.o

@phprus
Copy link
Contributor Author

phprus commented Jun 3, 2023

More correct solution: #1114

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