On 12/9/22 12:50, Bruno Pitrus wrote:
No. -m32 vs -m64 steers whether it is a 32 vs 64bit binary
-march=… only changes what instructions GCC is allowed to use.
If we do not build an actual 32-bit distro, we should allow GCC to use those instructions which are available on all 64-bit CPUs, also in 32-bit code. (Especially SSE2 which is a massive improvement)
When you pass -m32 -march=x86-64, you are still getting the i386 baseline: glaubitz@nofan:~> echo -e '#include <stdio.h> \n int main() { printf("Hello World!"); return 0; }' | x86_64-linux-gnu-gcc -m32 -march=x86-64 -x c - -o hello-world && file hello-world hello-world: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=38274ac9ecf2295ea98525aac114a5672c5f6593, for GNU/Linux 3.2.0, not stripped What you mean is x32 which is a separate ABI and AFAIK not supported in openSUSE but in Debian only: glaubitz@nofan:~> echo -e '#include <stdio.h> \n int main() { printf("Hello World!"); return 0; }' | x86_64-linux-gnu-gcc -mx32 -march=x86-64 -x c - -o hello-world && file hello-world hello-world: ELF 32-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /libx32/ld-linux-x32.so.2, BuildID[sha1]=e716dabf9377c5c5d0062bbdd2d4b39cfa7eda2f, for GNU/Linux 3.4.0, not stripped glaubitz@nofan:~> Adrian