Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 734554

Summary: sys-libs/libomp-10.0.1 fails with LTO - Attribute after last parameter! call void @llvm.x86.sse.sfence() #6 in function __kmp_parallel_initialize LLVM ERROR: Broken function found, compilation aborted!
Product: Gentoo Linux Reporter: Thomas Schneider <qsx>
Component: Current packagesAssignee: Bernard Cafarelli <voyageur>
Status: UNCONFIRMED ---    
Severity: normal CC: llvm
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: build.log
emerge --info

Description Thomas Schneider 2020-07-29 12:06:03 UTC
Created attachment 651428 [details]
build.log

sys-libs/libomp-10.0.1 fails to build (more precisely, to link libomp.so) when building with clang(++), lld, and LTO.  See attached build.log for details

# emerge -pqv '=sys-libs/libomp-10.0.1::gentoo'
[ebuild     U ] sys-libs/libomp-10.0.1 [10.0.0] USE="-cuda -hwloc -offload -ompt -test" ABI_X86="(64) -32 (-x32)"

Relevant toolchain config:
```
% cat /etc/portage/env/clang
CC="clang"
CXX="clang++"
CFLAGS="${CFLAGS} -flto=thin"
CXXFLAGS="${CXXFLAGS} -flto=thin"
LDFLAGS="-fuse-ld=lld -Wl,-O2 -Wl,--as-needed"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"
```
Comment 1 Thomas Schneider 2020-07-29 12:06:50 UTC
Created attachment 651430 [details]
emerge --info
Comment 2 Markus Peloquin 2020-09-30 00:50:45 UTC
Same here

CXX=clang++
CXXFLAGS='-march=native -O3 -pipe -flto=thin'
LDFLAGS='-Wl,-O3 -fuse-ld=lld -rtlib=compiler-rt'

-flto :: broken
-flto=thin :: broken
-fno-lto :: works