general question about compiling for weaker CPU

"Thomas Seeling" ([email protected] via lfs-support Mailing List) <[email protected]> Fri, 26 Sep 2025 16:09:42 +0200
Newsgroups gmane.linux.lfs.support
Organization Kleintierpraxis Berstadt
Message-ID <[email protected]>
Hallo,

my recent problem and my not-so-elegant solution - using a KVM with CPU 
set to "core2duo" - made me think about generating a distro for general 
use, like Fedora, Redhat, Debian, Ubuntu and all the other "vendors" do.

Obviously they cannot let the compiler optimize for the CPU on the build 
machine, they have to restrict *all* packages to the lowest common 
denominator they intend to support, e.g. the weakest 64-bit CPU there 
is, and communicate those supported CPU levels. Never thought about that 
before :-)

I understand the "LFS_TGT" variable is intended for this purpose.
Do I also need to define the gcc setting "-march=<target>" in CFLAGS, 
e.g. target="x86-64" or target="core2" (from the gcc man page at 
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html)?
What would the correct setting be to e.g. build for the "core2duo", 
which was more or less the first generation of 64-bit CPUs from intel?

Thanks +
Stay healthy,
Thomas

-- 
Do you wanna be a legend or a passing footprint on the sands of time?

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-support
Unsubscribe: See the above information page