sys-devel/clang-15.02 no longer honors USE="default-libcxx" even when also set for clang-common or globally. Discovered because post upgrade c++ ebuilds no longer build due to the lack of stdlibc++ on my system. After asking on the discord, other users confirmed the bug was also affecting them. Since this ebuild version is the one that moved from default-libcxx clang, to a use flag for `clang-common` the bug is most likely related to that.
Please share: emerge -pvO sys-devel/llvm sys-devel/clang-common sys-devel/clang
Also, please share the contents of /etc/clang/*.
I'll update with the requested information tonight
FWIW, I haven't seen this at all in my pure LLVM setup, but that's with LLVM 16.
(cd /var/db/repos/gentoo/sys-devel/clang ; git diff --no-index clang-15.0.1.ebuild clang-15.0.2.ebuild) diff --git a/clang-15.0.1.ebuild b/clang-15.0.2.ebuild index 63702176d2d..e61ef574f12 100644 --- a/clang-15.0.1.ebuild +++ b/clang-15.0.2.ebuild @@ -19,4 +19 @@ KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x64-ma -IUSE=" - debug default-compiler-rt default-libcxx default-lld doc - llvm-libunwind +pie +static-analyzer test xml -" +IUSE="debug doc +pie +static-analyzer test xml" @@ -34,0 +32 @@ RDEPEND=" + >=sys-devel/clang-common-${PV} @@ -46 +43,0 @@ PDEPEND=" - sys-devel/clang-common @@ -49,7 +45,0 @@ PDEPEND=" - default-compiler-rt? ( - =sys-libs/compiler-rt-${PV%_*}* - llvm-libunwind? ( sys-libs/llvm-libunwind ) - !llvm-libunwind? ( sys-libs/libunwind ) - ) - default-libcxx? ( >=sys-libs/libcxx-${PV} ) - default-lld? ( sys-devel/lld ) @@ -68 +58 @@ LLVM_TEST_COMPONENTS=( -LLVM_PATCHSET=${PV/_/-} +LLVM_PATCHSET=${PV/_/-}-r2 @@ -263,0 +254 @@ multilib_src_configure() { + -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang" @@ -286,4 +276,0 @@ multilib_src_configure() { - # override default stdlib and rtlib - -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "") - -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "") - -DCLANG_DEFAULT_LINKER=$(usex default-lld lld "") @@ -291 +277,0 @@ multilib_src_configure() { - -DCLANG_DEFAULT_UNWINDLIB=$(usex default-compiler-rt libunwind "")
(In reply to Evgeniy Khramtsov from comment #5) > (cd /var/db/repos/gentoo/sys-devel/clang ; git diff --no-index > clang-15.0.1.ebuild clang-15.0.2.ebuild) > > diff --git a/clang-15.0.1.ebuild b/clang-15.0.2.ebuild > index 63702176d2d..e61ef574f12 100644 > --- a/clang-15.0.1.ebuild > +++ b/clang-15.0.2.ebuild Yes, but that's fine given clang-common is supposed to handle this now.
See: ebuild U ] sys-devel/clang-common-15.0.2::gentoo [15.0.1::gentoo] USE="default-compiler-rt%* default-libcxx%* default-lld%* (llvm-libunwind%*) -verify-sig" 0 KiB [ebuild U ] sys-devel/clang-15.0.2:15::gentoo [15.0.1:15::gentoo] USE="(pie) static-analyzer -debug -doc -test -verify-sig -xml (-default-compiler-rt%*) (-default-libcxx%*) (-default-lld%*) (-llvm-libunwind%*)" LLVM_TARGETS="AMDGPU (WebAssembly) (X86) -AArch64 (-ARC) -ARM -AVR -BPF (-CSKY) (-DirectX) -Hexagon -Lanai (-LoongArch) (-M68k) -MSP430 -Mips -NVPTX -PowerPC -RISCV (-SPIRV) -Sparc -SystemZ -VE -XCore" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9 -python3_11" 0 KiB rg 'default-libcxx' /var/db/repos/gentoo reveals users, including dev-lang/rust which defaults to GNU C++ on musl-clang ~amd64, failing to build vendored LLVM. I wait for build on older subvolume with LLVM updated alone to confirm.
I can't reproduce the problem either. clang++-15 definitely links -lc++ here.
(In reply to Evgeniy Khramtsov from comment #7) > See: > > ebuild U ] sys-devel/clang-common-15.0.2::gentoo [15.0.1::gentoo] > USE="default-compiler-rt%* default-libcxx%* default-lld%* (llvm-libunwind%*) > -verify-sig" 0 KiB > [ebuild U ] sys-devel/clang-15.0.2:15::gentoo [15.0.1:15::gentoo] > USE="(pie) static-analyzer -debug -doc -test -verify-sig -xml > (-default-compiler-rt%*) (-default-libcxx%*) (-default-lld%*) > (-llvm-libunwind%*)" LLVM_TARGETS="AMDGPU (WebAssembly) (X86) -AArch64 > (-ARC) -ARM -AVR -BPF (-CSKY) (-DirectX) -Hexagon -Lanai (-LoongArch) > (-M68k) -MSP430 -Mips -NVPTX -PowerPC -RISCV (-SPIRV) -Sparc -SystemZ -VE > -XCore" PYTHON_SINGLE_TARGET="python3_10 -python3_8 -python3_9 -python3_11" > 0 KiB > > rg 'default-libcxx' /var/db/repos/gentoo reveals users, including > dev-lang/rust > which defaults to GNU C++ on musl-clang ~amd64, failing to build vendored > LLVM. > > I wait for build on older subvolume with LLVM updated alone to confirm. Can you give: 1. emerge --info 2. /etc/clang/* contents Thanks.
(In reply to Sam James from comment #9) [...] > > > > rg 'default-libcxx' /var/db/repos/gentoo reveals users, including > > dev-lang/rust > > which defaults to GNU C++ on musl-clang ~amd64, failing to build vendored > > LLVM. > > > > I wait for build on older subvolume with LLVM updated alone to confirm. > > Can you give: > 1. emerge --info > 2. /etc/clang/* contents > > Thanks. Updated depend atoms alone to avoid bootlegging unrelated updates: sys-devel/llvm-common, sys-devel/clang-common, sys-libs/compiler-rt, sys-libs/libomp, sys-devel/llvm, sys-devel/clang, sys-libs/libcxxabi, sys-libs/libcxx, sys-devel/clang-runtime, sys-libs/llvm-libunwind, sys-devel/lld. Clang driver defaults to libc++ here, and ldd confirms binding to libc++(abi). "c++ ebuilds" breakage could not be reproduced here. dev-lang/rust didn't chase 2aae4ce718676a8 resulting in 2aae4ce718676a8/dev-lang/rust/rust-1.64.0-r1.ebuild#L341 conditional evaluating to false, as sys-devel/clang no longer exposes default-libcxx after 2aae4ce718676a8. [...] -- Check for working CXX compiler: /usr/lib/llvm/15/bin/clang++ - broken CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:62 (message): The C++ compiler "/usr/lib/llvm/15/bin/clang++" is not able to compile a simple test program. It fails with the following output: Change Dir: /var/tmp/portage/dev-lang/rust-1.64.0-r1/work/rustc-1.64.0-src/build/x86_64-unknown-linux-musl/llvm/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/ninja cmTC_3105d && [1/2] Building CXX object CMakeFiles/cmTC_3105d.dir/testCXXCompiler.cxx.o [2/2] Linking CXX executable cmTC_3105d FAILED: cmTC_3105d : && /usr/lib/llvm/15/bin/clang++ -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-musl -fdebug-prefix-map=/var/tmp/portage/dev-lang/rust-1.64.0-r1/work/rustc-1.64.0-src=/rustc/llvm -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--as-needed -Wl,--as-needed -static-libstdc++ CMakeFiles/cmTC_3105d.dir/testCXXCompiler.cxx.o -o cmTC_3105d && : ld.lld: error: unable to find library -lc++ clang-15: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. [...] Locally defining use_libcxx="true" in dev-lang/rust unbreaks it (bundled vendored LLVM (-system-llvm)). I didn't submit a new bug as I'm not yet familiar with Gentoo bugzilla/ebuild rules/policy. I can't submit links to GitHub repo as I'm a new user, commit hashes refer to GitHub mirror. > Can you give: 1. No. 2. Useless: 1) see the report above 2) environment pollution (e.g. automagic dependencies) makes data for reproducer moot, I'm also not aware of poudriere alternative on Gentoo to provide a clean reproducer. 3) ::gentoo is forked here. /etc/clang* is unmodified, environment lacks gcc and binutils.
I don't understand how you can say /etc/clang/* is irrelevant given that's how we've backported config support and it's the reason we dropped the flags from the ebuild.
Anyway, please file a new bug for Rust.