Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 937637 - sys-libs/glibc-2.39-r6 -mfpmath=sse and -march=i686 don't go together
Summary: sys-libs/glibc-2.39-r6 -mfpmath=sse and -march=i686 don't go together
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-09 20:24 UTC by Esteve Varela Colominas
Modified: 2024-08-10 01:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
config.log (config.log,85.04 KB, text/x-log)
2024-08-09 20:24 UTC, Esteve Varela Colominas
Details
build.log (build.log,17.83 KB, text/x-log)
2024-08-09 20:25 UTC, Esteve Varela Colominas
Details

Note You need to log in before you can comment on or make changes to this bug.
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