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

Bug 577270

Summary: clang fails linking with "-mx32" on abi_x86_x32
Product: Gentoo Linux Reporter: EoD <EoD>
Component: Current packagesAssignee: Michał Górny <mgorny>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Output of "clang++ -m..."
emerge --info clang

Description EoD 2016-03-13 09:38:13 UTC
Created attachment 428112 [details]
Output of "clang++ -m..."

I have a multilib system with abi_x86_32, abi_x86_64 and abi_x86_x32.

When I try to execute the following commands, the fail or succeed.

FAIL: clang++ -mx32 -v test.cpp 
SUCC: clang++ -m32 -v test.cpp
SUCC: clang++ -m64 -v test.cpp


It fails due to missing libraries:
/usr/bin/x86_64-pc-linux-gnu-ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so when searching for -lstdc++

and this is probably due to the line
  -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/x86_64-pc-linux-gnu

instead of
  -internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/x86_64-pc-linux-gnu/x32


The output can be seen in full detail in the attachment.

The problem does not occur with g++
Comment 1 Pacho Ramos gentoo-dev 2016-03-14 16:12:21 UTC
Please post emerge --info clang output

Thanks
Comment 2 EoD 2016-03-17 20:41:06 UTC
Created attachment 428464 [details]
emerge --info clang

(In reply to Pacho Ramos from comment #1)
> Please post emerge --info clang output
> 
> Thanks

Here you go
Comment 3 EoD 2017-11-08 15:38:32 UTC
Unable to reproduce with current Clang 3.9.1 and GCC 4.9.4 or 5.4.0.