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

Bug 912685

Summary: sys-devel/clang-common-17.0.0_rc2-r1: Installing configuration files only for CHOST has side effects for multilib builds (like sys-libs/libcxxabi-17.0.0_rc2 with ABI_X86="64 32")
Product: Gentoo Linux Reporter: Alfred Wingate <parona>
Component: Current packagesAssignee: LLVM support project <llvm>
Status: RESOLVED FIXED    
Severity: normal CC: ionen, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/32395
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
sys-libs/libcxxabi-17.0.0_rc2 build.log
sys-libs/libcxxabi-17.0.0_rc2 build.log with --debug

Description Alfred Wingate 2023-08-20 15:41:19 UTC
Had a problem where -unwindlib=libunwind got stripped from a libcxxabi build with ABI_X86="64 32" but not ABI_X86="64" leading to missing symbols which would be provided by libunwind.

Long story short flag-o-matic was testing all the flags with i686-pc-linux-gnu-clang and then stripping everything with issues. And due to i686-pc-linux-gnu-clang not using the clang-common flag it didn't have --rtlib=compiler-rt set leading to this error "i686-pc-linux-gnu-clang: error: --rtlib=libgcc requires --unwindlib=libgcc". This all was silent so figuring this required running it the ebuild process with --debug and noticing this test being run. Output had no mention of the flag being stripped or its reason.

Reproducible: Always

Steps to Reproduce:
1.Use sys-devel/clang-common-17.0.0_rc2-r1
2. Try to compile sys-libs/libcxxabi-17.0.0_rc2 with ABI_X86="64 32"
Actual Results:  
Missing symbols in the linker phase.

Expected Results:  
Success

ask@lane ~ $ echo "int main(void) { return 0; }" | i686-pc-linux-gnu-clang -Werror -unwindlib=libunwind -fuse-ld=lld -xc -
i686-pc-linux-gnu-clang: error: --rtlib=libgcc requires --unwindlib=libgcc

ask@lane ~ $ i686-pc-linux-gnu-clang --version
clang version 17.0.0
Target: i686-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/17/bin

ask@lane ~ $ x86_64-pc-linux-gnu-clang --version
clang version 17.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/17/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg
Comment 1 Alfred Wingate 2023-08-20 15:42:00 UTC
Created attachment 868272 [details]
emerge --info
Comment 2 Alfred Wingate 2023-08-20 15:46:05 UTC
Created attachment 868273 [details]
sys-libs/libcxxabi-17.0.0_rc2 build.log
Comment 3 Alfred Wingate 2023-08-20 15:46:31 UTC
Created attachment 868274 [details]
sys-libs/libcxxabi-17.0.0_rc2 build.log with --debug
Comment 4 Ionen Wolkens gentoo-dev 2023-08-20 15:54:40 UTC
Sounds like need to copy the logic from clang-toolchain-symlinks w/ multilib eclass
Comment 5 Larry the Git Cow gentoo-dev 2023-08-21 06:14:52 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3950a8423a88641745ec996ee15a02e2e298ef94

commit 3950a8423a88641745ec996ee15a02e2e298ef94
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2023-08-20 16:48:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-08-21 06:14:39 +0000

    sys-devel/clang-common: Install config files for all supported ABIs
    
    Closes: https://bugs.gentoo.org/912685
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/32395
    Signed-off-by: Sam James <sam@gentoo.org>

 .../clang-common/clang-common-17.0.0.9999.ebuild   | 22 ++++++++++++++--------
 ...r1.ebuild => clang-common-17.0.0_rc2-r2.ebuild} | 22 ++++++++++++++--------
 .../clang-common/clang-common-18.0.0.9999.ebuild   | 22 ++++++++++++++--------
 ...d => clang-common-18.0.0_pre20230803-r1.ebuild} | 22 ++++++++++++++--------
 ...d => clang-common-18.0.0_pre20230810-r2.ebuild} | 22 ++++++++++++++--------
 ...d => clang-common-18.0.0_pre20230820-r1.ebuild} | 22 ++++++++++++++--------
 6 files changed, 84 insertions(+), 48 deletions(-)