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

Fix for full LTO build #798

Merged
merged 2 commits into from Mar 5, 2022
Merged

Fix for full LTO build #798

merged 2 commits into from Mar 5, 2022

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Mar 3, 2022

Signed-off-by: Vladislav Shchapov phprus@gmail.com

Description

Fix for full LTO build (library and tests) on UNIX systems.

CMake:

cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_STANDARD=17 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON ../..

Before - macOS error:

phprus@mbp osx_arm64-lto % ctest --rerun-failed --output-on-failure
Test project /Users/phprus/Devel/oneapi-src/oneTBB/build/osx_arm64-lto
    Start 4: test_dynamic_link
1/1 Test #4: test_dynamic_link ................***Failed    0.00 sec
[doctest] doctest version is "2.4.7"
[doctest] run with "--help" for options
===============================================================================
/Users/phprus/Devel/oneapi-src/oneTBB/test/tbb/test_dynamic_link.cpp:94:
TEST CASE:  Test dynamic_link with non-existing library

/Users/phprus/Devel/oneapi-src/oneTBB/test/common/utils_dynamic_libs.h:116: FATAL ERROR: REQUIRE( func ) is NOT correct!
  values: REQUIRE( NULL )
  logged: The executable doesn't export its symbols. Is the -rdynamic switch set during linking?
          Can't find required symbol in dynamic library

/Users/phprus/Devel/oneapi-src/oneTBB/test/tbb/test_dynamic_link.cpp:73: FATAL ERROR: REQUIRE( (utils::GetAddress(utils::OpenLibrary(nullptr), "foo1") && utils::GetAddress(utils::OpenLibrary(nullptr), "foo2")) ) THREW exception: "unknown exception"
  logged: The executable doesn't export its symbols. Is the -rdynamic switch set during linking?

===============================================================================
/Users/phprus/Devel/oneapi-src/oneTBB/test/tbb/test_dynamic_link.cpp:100:
TEST CASE:  Test dynamic_link

/Users/phprus/Devel/oneapi-src/oneTBB/test/common/utils_dynamic_libs.h:116: FATAL ERROR: REQUIRE( func ) is NOT correct!
  values: REQUIRE( NULL )
  logged: The executable doesn't export its symbols. Is the -rdynamic switch set during linking?
          Can't find required symbol in dynamic library

/Users/phprus/Devel/oneapi-src/oneTBB/test/tbb/test_dynamic_link.cpp:73: FATAL ERROR: REQUIRE( (utils::GetAddress(utils::OpenLibrary(nullptr), "foo1") && utils::GetAddress(utils::OpenLibrary(nullptr), "foo2")) ) THREW exception: "unknown exception"
  logged: The executable doesn't export its symbols. Is the -rdynamic switch set during linking?

===============================================================================
[doctest] test cases: 2 | 0 passed | 2 failed | 0 skipped
[doctest] assertions: 4 | 0 passed | 4 failed |
[doctest] Status: FAILURE!


0% tests passed, 1 tests failed out of 1

Total Test time (real) =   0.01 sec

The following tests FAILED:
	  4 - test_dynamic_link (Failed)
Errors while running CTest
phprus@mbp osx_arm64-lto %

After - all tests passed.

Fixes

  • - 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

List users with @ to send notifications

Other information

Signed-off-by: Vladislav Shchapov <phprus@gmail.com>
test/CMakeLists.txt Outdated Show resolved Hide resolved
@AlexVeprev AlexVeprev merged commit af90f6c into oneapi-src:master Mar 5, 2022
@phprus phprus deleted the fix-lto-test branch April 16, 2022 10:47
@phprus phprus mentioned this pull request Aug 11, 2022
14 tasks
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.

None yet

2 participants