Bug 257149

Summary: CFLAGS not passed to whole build
Product: Base System Reporter: Charles Lecklider <freebsd>
Component: confAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Some People CC: bdrewery
Priority: --- Keywords: needs-qa, regression
Version: 11.4-STABLEFlags: koobs: maintainer-feedback? (bdrewery)
koobs: mfc-stable13?
koobs: mfc-stable12?
koobs: mfc-stable11?
Hardware: i386   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250755

Description Charles Lecklider 2021-07-13 01:31:19 UTC
Applies to >=11.4-RELEASE (since the change to default i686):

I'm using -march=pentium-mmx in a VM to build for my old dual Pentium MMX 233; so far so unremarkable.

The first problem is that everything in /usr/obj/tmp/legacy/ is built with default flags, not CFLAGS, so it's built for i686 (CMOV*). Obviously that doesn't work when trying to installworld over nfs. Looking at #250755 I changed the default to i586, did a full build and install twice, and the resulting build runs OK.

However, it's far from  perfect - /usr/local/sbin/pkg-static somehow still gets compiled with CMOV, building ports fails somewhere I've yet to track down - yes, the system boots and runs, but it's not actually usable.

Could CFLAGS, or at least -march=, be passed to *everything* please?

AFAICT it's impossible to compile for <i686 as things stand without treating it as a full cross-compile; FreeBSD has always been able to build itself on the system it's running on, but right now a running i586 system *cannot* do that.