Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 912210 - dev-cpp/tbb: fails to compile with >=sys-devel/lld-17 (ld.lld: error: version script assignment of 'local' to symbol ...)
Summary: dev-cpp/tbb: fails to compile with >=sys-devel/lld-17 (ld.lld: error: version...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: LD-is-lld, systemwide-lld 912821
  Show dependency tree
 
Reported: 2023-08-13 07:29 UTC by Theo Paris
Modified: 2024-01-28 22:14 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/tmp/portage/dev-cpp/tbb-2021.9.0/temp/build.log (build.log,28.90 KB, text/x-log)
2023-08-13 07:29 UTC, Theo Paris
Details
emerge --info '=sys-devel/mold-2.1.0::gentoo' (emerge--info.log,18.74 KB, text/x-log)
2023-08-30 19:37 UTC, Stuart Meya
Details
emerge -pqv '=sys-devel/mold-2.1.0::gentoo' (emerge-pqv.log,38 bytes, text/x-log)
2023-08-30 19:37 UTC, Stuart Meya
Details
/var/tmp/portage/sys-devel/mold-2.1.0/temp/build.log (mold-2.1.0-build.log,4.97 KB, text/x-log)
2023-08-30 19:38 UTC, Stuart Meya
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Theo Paris 2023-08-13 07:29:39 UTC
Created attachment 867748 [details]
/var/tmp/portage/dev-cpp/tbb-2021.9.0/temp/build.log

TBB fails to build with llvm 18.0.0.9999 and lld. I also have enabled libc++/compiler-rt/llvm-libunwind globally.

Here is an example of the errors in the build.log attached:

ld.lld: error: version script assignment of 'local' to symbol 'TBB_runtime_interface_version' failed: symbol not defined
ld.lld: error: version script assignment of 'local' to symbol 'get_memcpy_largest_cachelinesize' failed: symbol not defined

I'm not sure if this is related but I cannot seem to build SDL3 manually using cmake with the same llvm version because it fails to detect version script support in the compiler - requiring a patch to the SDL3 CMakeLists.txt file.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-13 07:31:36 UTC
Please consider testing with LLVM 17 until it's released (ideally until LLVM 17.0.6 or so, i.e. until LLVM 17's stable branch is closed) given we really want to make sure it's in a good state, especially as upstream don't maintain the stable branch for long, then moving to 18. But of course you're free to use what you want too.

Please also include emerge --info for completeness.

Anyway, in this case, this is indeed the default change in lld 17 for -Wl,--no-undefined-symbols. Could you report that upstream to TBB and link it here? Thanks!
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-13 07:33:29 UTC
Small chance that https://github.com/oneapi-src/oneTBB/pull/1114 fixes it.
Comment 3 Stuart Meya 2023-08-30 19:28:39 UTC
(In reply to Sam James from comment #1)
> Please consider testing with LLVM 17 until it's released (ideally until LLVM
> 17.0.6 or so, i.e. until LLVM 17's stable branch is closed) given we really
> want to make sure it's in a good state, especially as upstream don't
> maintain the stable branch for long, then moving to 18. But of course you're
> free to use what you want too.
> 
> Please also include emerge --info for completeness.
> 
> Anyway, in this case, this is indeed the default change in lld 17 for
> -Wl,--no-undefined-symbols. Could you report that upstream to TBB and link
> it here? Thanks!

I just tested =dev-cpp/tbb-2021.10.0 it with LLVM 17.0.0._rc3 on ~arm64 using LDFLAGS="${LDFLAGS} -Wl,--undefined-version" via package.env - interestingly did let it merge.
Comment 4 Stuart Meya 2023-08-30 19:35:11 UTC
(In reply to Stuart Meya from comment #3)
> (In reply to Sam James from comment #1)
> > Please consider testing with LLVM 17 until it's released (ideally until LLVM
> > 17.0.6 or so, i.e. until LLVM 17's stable branch is closed) given we really
> > want to make sure it's in a good state, especially as upstream don't
> > maintain the stable branch for long, then moving to 18. But of course you're
> > free to use what you want too.
> > 
> > Please also include emerge --info for completeness.
> > 
> > Anyway, in this case, this is indeed the default change in lld 17 for
> > -Wl,--no-undefined-symbols. Could you report that upstream to TBB and link
> > it here? Thanks!
> 
> I just tested =dev-cpp/tbb-2021.10.0 it with LLVM 17.0.0._rc3 on ~arm64
> using LDFLAGS="${LDFLAGS} -Wl,--undefined-version" via package.env -
> interestingly did let it merge.

Ok, my original target was to emerge dev-cpp/tbb to get mold running on the LLVM profile, but emerging mold using mold itself (LDFLAGS="${LDFLAGS} -fuse-ld=mold" in make.conf) produced the following outcome:

-- Check for working C compiler: /usr/lib/llvm/17/bin/clang - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler "/usr/lib/llvm/17/bin/clang" is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/var/tmp/portage/sys-devel/mold-2.1.0/work/mold-2.1.0_build/CMakeFiles/CMakeScratch/TryCompile-xSDhCX'
    
Run Build Command(s): /usr/bin/ninja -v cmTC_0ed9c
[1/2] /usr/lib/llvm/17/bin/clang    -O3 -pipe -flto=thin -MD -MT CMakeFiles/cmTC_0ed9c.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_0ed9c.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_0ed9c.dir/testCCompiler.c.o -c /var/tmp/portage/sys-devel/mold-2.1.0/work/mold-2.1.0_build/CMakeFiles/CMakeScratch/TryCompile-xSDhCX/testCCompiler.c
[2/2] : && /usr/lib/llvm/17/bin/clang -O3 -pipe -flto=thin -Wl,-O1 -Wl,--as-needed -Wl,--as-needed -fuse-ld=mold CMakeFiles/cmTC_0ed9c.dir/testCCompiler.c.o -o cmTC_0ed9c   && :
FAILED: cmTC_0ed9c: && /usr/lib/llvm/17/bin/clang -O3 -pipe -flto=thin -Wl,-O1 -Wl,--as-needed -Wl,--as-needed -fuse-ld=mold CMakeFiles/cmTC_0ed9c.dir/testCCompiler.c.o -o cmTC_0ed9c   && :mold: fatal: could not open plugin file: /usr/lib/llvm/17/bin/../lib64/LLVMgold.so: cannot open shared object file: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

I'll add emerge --info etc. 

Greetings
Comment 5 Stuart Meya 2023-08-30 19:37:13 UTC
Created attachment 869065 [details]
emerge --info '=sys-devel/mold-2.1.0::gentoo'
Comment 6 Stuart Meya 2023-08-30 19:37:43 UTC
Created attachment 869066 [details]
emerge -pqv '=sys-devel/mold-2.1.0::gentoo'
Comment 7 Stuart Meya 2023-08-30 19:38:52 UTC
Created attachment 869067 [details]
/var/tmp/portage/sys-devel/mold-2.1.0/temp/build.log
Comment 8 ernsteiswuerfel archtester 2024-01-13 21:55:58 UTC
Not any better with tbb-2021.11.0.
Comment 9 Larry the Git Cow gentoo-dev 2024-01-28 22:14:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02d9351d758b8e0e604e347f6068bcbb3c8f8f03

commit 02d9351d758b8e0e604e347f6068bcbb3c8f8f03
Author:     Sv. Lockal <lockalsash@gmail.com>
AuthorDate: 2024-01-27 19:49:15 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-01-28 22:13:41 +0000

    dev-cpp/tbb: fix build with ld.lld (error: version script assignment of 'local' to symbol ...)
    
    Closes: https://bugs.gentoo.org/912210
    Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/35048
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-cpp/tbb/tbb-2020.3.ebuild      |  7 +++++--
 dev-cpp/tbb/tbb-2021.10.0.ebuild   |  7 +++++--
 dev-cpp/tbb/tbb-2021.11.0.ebuild   |  7 +++++--
 dev-cpp/tbb/tbb-2021.5.0-r1.ebuild | 10 ++++++++--
 dev-cpp/tbb/tbb-2021.7.0-r1.ebuild |  7 +++++--
 dev-cpp/tbb/tbb-2021.7.0.ebuild    |  5 ++++-
 dev-cpp/tbb/tbb-2021.8.0.ebuild    |  7 +++++--
 dev-cpp/tbb/tbb-2021.9.0.ebuild    |  7 +++++--
 8 files changed, 42 insertions(+), 15 deletions(-)