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

Bug 937637

Summary: sys-libs/glibc-2.39-r6 -mfpmath=sse and -march=i686 don't go together
Product: Gentoo Linux Reporter: Esteve Varela Colominas <esteve.varela>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: UNCONFIRMED ---    
Severity: normal CC: esteve.varela
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: config.log
build.log

Description Esteve Varela Colominas 2024-08-09 20:24:38 UTC
Created attachment 899709 [details]
config.log

The following command on a multilib x86_64 toolchain will cause an error:

    $ gcc -m32 -march=i686 -mfpmath=sse -Werror -o /dev/null -c -xc - <<< 'int a(){}'
    cc1: error: SSE instruction set disabled, using 387 arithmetics [-Werror]
    cc1: all warnings being treated as errors

This is executed in this ebuild, causing it to fail, due to a few uncommon circumstances. I'm cross-compiling glibc, using a toolchain targetting x86_64 multilib, but without an existing glibc in the sysroot directory. It should be noted that this doesn't seem to happen with crossdev, but I still think the ebuild is slightly incorrect.

The default CFLAGS_x86 value from arch/amd64/make.defaults in the profile is "-m32 -mfpmath=sse".

Not being able to link a binary means that the "do_compile_test" in sys-libs/glibc/glibc-2.39-r6.ebuild:355 fails. This causes the ebuild to append "-march=i686" to CFLAGS_x86.

The glibc configure tests, in particular "checking for broken __attribute__((alias()))", add the "-Werror" flag.

All combined, these cause the glibc build to fail unnecessarily. Currently there's two ways to tweak CFLAGS_x86 to make this initial build pass: I can either remove "-mfpmath=sse" or add "-msse" to the flags.

I think I'd solve this issue by adding the "-msse" flag to CFLAGS_x86 in the glibc ebuild.
Comment 1 Esteve Varela Colominas 2024-08-09 20:25:01 UTC
Created attachment 899710 [details]
build.log