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

changed TBB_EXPORT to use gcc visibility attribute #786

Conversation

anton-potapov
Copy link
Contributor

Description

according to GCC symbols visibility wiki page as such (with __attribute__((visibility ("default"))) exported symbols should be explicitly marked, to allow compilating with -fvisibility=hidden flag.

Fixes #779

  • - git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details)

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

@alexey-katranov

Other information

@anton-potapov anton-potapov marked this pull request as draft February 22, 2022 08:26
#define _EXPORT
#elif defined(__unix__) || defined(__APPLE__) // Use .def files for these
#define _EXPORT __attribute__ ((visibility ("default")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename _EXPORT to something __TBB_* to avoid possible conflicts with user code

#else
#error "Unknown platform/compiler"
#endif

#if __TBB_BUILD
//#if __TBB_BUILD
#define TBB_EXPORT _EXPORT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe __TBB_EXPORT because it is not public macro

@phprus
Copy link
Contributor

phprus commented Mar 1, 2022

Also need an export:
https://github.com/oneapi-src/oneTBB/blob/09346731f1279feb23c81f569eabe6010c620872/test/tbb/test_dynamic_link.cpp#L31-L39

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
@anton-potapov anton-potapov force-pushed the fix_gcc_visibility_hidden branch 2 times, most recently from b7d9a64 to 7302795 Compare March 2, 2022 07:42
 - temporary added -fvisibility=hidden to cmake for sake of testing

Signed-off-by: Anton Potapov <anton.potapov@intel.com>
@anton-potapov anton-potapov force-pushed the fix_gcc_visibility_hidden branch from 2026e51 to 818b8e1 Compare March 16, 2022 16:44
@phprus phprus mentioned this pull request May 27, 2023
14 tasks
@isaevil isaevil closed this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined references to nearly all TBB symbols when built with -fvisibility=hidden
4 participants