commit 5c56bcc8338881fa2b75538bef6c29551076ffd7 Author: Andriy Gapon Date: Sun Oct 7 23:08:11 2012 +0300 boot: use -march=i386 for both i386 and amd64 builds .. so that identical binaries are produced for both architectures. Previously i386 used default setting which were equivalent to -march=i486 -mtune generic. The only difference is using smaller but slower "leave" instructions. diff --git a/sys/boot/efi/Makefile.inc b/sys/boot/efi/Makefile.inc index 7e75a6c..7446d31 100644 --- a/sys/boot/efi/Makefile.inc +++ b/sys/boot/efi/Makefile.inc @@ -2,8 +2,12 @@ BINDIR?= /boot +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 +.endif + .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 ACFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile index 1f8de9b..971faa7 100644 --- a/sys/boot/ficl/Makefile +++ b/sys/boot/ficl/Makefile @@ -8,6 +8,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -39,7 +40,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \ #SOFTWORDS+= oo.fr classes.fr .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 -I. +CFLAGS+= -m32 -I. .endif .if ${MACHINE_ARCH} == "powerpc64" diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc index 0cad7d2..f5faec7 100644 --- a/sys/boot/i386/Makefile.inc +++ b/sys/boot/i386/Makefile.inc @@ -5,12 +5,12 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 ACFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 diff --git a/sys/boot/userboot/ficl/Makefile b/sys/boot/userboot/ficl/Makefile index af5d1461..42b9309 100644 --- a/sys/boot/userboot/ficl/Makefile +++ b/sys/boot/userboot/ficl/Makefile @@ -12,6 +12,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding -fPIC .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +#CFLAGS+= -march=i386 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif .if ${MACHINE_CPUARCH} == "i386" @@ -46,7 +47,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \ #SOFTWORDS+= oo.fr classes.fr #.if ${MACHINE_CPUARCH} == "amd64" -#CFLAGS+= -m32 -march=i386 -I. +#CFLAGS+= -m32 -I. #.endif .if ${MACHINE_ARCH} == "powerpc64" diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile index ff423a0..9b900e4 100644 --- a/sys/boot/zfs/Makefile +++ b/sys/boot/zfs/Makefile @@ -12,6 +12,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -19,7 +20,7 @@ CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float CFLAGS+= -msoft-float .endif .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall