Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 947785 - sys-devel/multilib-gcc-wrapper -mfpmath=sse causes compiler warnings
Summary: sys-devel/multilib-gcc-wrapper -mfpmath=sse causes compiler warnings
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-09 19:45 UTC by Ville Syrjala
Modified: 2025-01-10 17:53 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ville Syrjala 2025-01-09 19:45:50 UTC
The -mfpmath=sse usage in the i686 gcc wrappers causes gcc to emit the following warnings when building for a non-SSE system:
"cc1plus: warning: SSE instruction set disabled, using 387 arithmetics"

Apart from the annoying log spam, the main problem for me is that distcc build of cmake (on a non-SSE system) now fails due to the warnings (same issue as in bug 691544, just different warning).

Previously I was using a proper i686 cross toolchain, but crossdev now refuses to create one for me, so I had to switch to sys-devel/multilib-gcc-wrapper instead.

Reproducible: Always

Steps to Reproduce:
1. Set up x86_64 system with sys-devel/multilib-gcc-wrapper
2. i686-pc-linux-gnu-gcc -march=pentium2 ...
Actual Results:  
cc1: warning: SSE instruction set disabled, using 387 arithmetics

Expected Results:  
No warnings.
Comment 1 Mike Gilbert gentoo-dev 2025-01-09 20:25:45 UTC
The "-mfpmath=sse" comes from the CFLAGS_x86 setting in your (amd64) profile. It's a reasonable option that will work for any amd64-compatible -march value.

You can override the CFLAGS_x86 setting in make.conf or package.env and reinstall sys-devel/multilib-gcc-wrapper to get rid of it.

> CFLAGS_x86="-m32"
Comment 2 Ville Syrjala 2025-01-10 17:40:04 UTC
(In reply to Mike Gilbert from comment #1)
> The "-mfpmath=sse" comes from the CFLAGS_x86 setting in your (amd64)
> profile. It's a reasonable option that will work for any amd64-compatible
> -march value.
> 
> You can override the CFLAGS_x86 setting in make.conf or package.env and
> reinstall sys-devel/multilib-gcc-wrapper to get rid of it.
> 
> > CFLAGS_x86="-m32"

I see. I agree that -mfpmath=sse is probably a good idea for multilib builds, but feels like it's being applied at the wrong level. It should rather be applied by portage to multilib builds only, rather than by the gcc wrapper to everything. With the current scheme I get to choose between sub-optimal multilib builds or potentially completely incorrect cross builds.

I suppose I could work around this by removing -mpfpath=sse from CFLAGS_X86 and instead just stick it into my normal CFLAGS on all 64bit machines. Feels a bit hacky though.
Comment 3 Mike Gilbert gentoo-dev 2025-01-10 17:53:57 UTC
You can apply the CFLAG_x86 change to multilib-gcc-wrapper only by using package.env.

Portage doesn't use mulilib-gcc-wrapper for multilib builds.