diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc index fa5ea569e609..6aced1829560 100644 --- a/sys/boot/i386/Makefile.inc +++ b/sys/boot/i386/Makefile.inc @@ -3,4 +3,4 @@ # $FreeBSD$ LOADER_ADDRESS?= 0x200000 -CFLAGS+= -mpreferred-stack-boundary=2 +CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile index 5425c08707fe..be6187319955 100644 --- a/sys/boot/i386/boot2/Makefile +++ b/sys/boot/i386/boot2/Makefile @@ -27,10 +27,10 @@ BTX= ${.CURDIR}/../btx ORG1= 0x7c00 ORG2= 0x1000 -CFLAGS= -elf -I${.CURDIR}/../btx/lib -I. \ - -Os -fno-builtin -fforce-addr -fdata-sections \ - -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mrtd \ - -mpreferred-stack-boundary=2 \ +CFLAGS= -elf -ffreestanding -Os -fno-builtin -fforce-addr -fdata-sections \ + -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels \ + -mrtd -mpreferred-stack-boundary=2 \ + -I${.CURDIR}/../btx/lib -I. \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile index 5425c08707fe..be6187319955 100644 --- a/sys/boot/i386/gptboot/Makefile +++ b/sys/boot/i386/gptboot/Makefile @@ -27,10 +27,10 @@ BTX= ${.CURDIR}/../btx ORG1= 0x7c00 ORG2= 0x1000 -CFLAGS= -elf -I${.CURDIR}/../btx/lib -I. \ - -Os -fno-builtin -fforce-addr -fdata-sections \ - -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mrtd \ - -mpreferred-stack-boundary=2 \ +CFLAGS= -elf -ffreestanding -Os -fno-builtin -fforce-addr -fdata-sections \ + -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels \ + -mrtd -mpreferred-stack-boundary=2 \ + -I${.CURDIR}/../btx/lib -I. \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings diff --git a/sys/boot/i386/kgzldr/Makefile b/sys/boot/i386/kgzldr/Makefile index 6ba2a35032fd..85f3b67d1045 100644 --- a/sys/boot/i386/kgzldr/Makefile +++ b/sys/boot/i386/kgzldr/Makefile @@ -3,7 +3,7 @@ FILES= kgzldr.o SRCS= start.s boot.c inflate.c lib.c crt.s sio.s OBJS= ${SRCS:N*.h:R:S/$/.o/g} -CFLAGS= -fno-builtin +CFLAGS= -ffreestanding -fno-builtin .if ${OBJFORMAT} == aout CFLAGS+=-O2 .else diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile index 7026cd07f12a..2b3e82c2eebd 100644 --- a/sys/boot/i386/libi386/Makefile +++ b/sys/boot/i386/libi386/Makefile @@ -11,19 +11,13 @@ SRCS= aout_freebsd.c biosacpi.c bioscd.c biosdisk.c biosmem.c biospnp.c \ i386_copy.c i386_module.c nullconsole.c pxe.c pxetramp.s \ time.c vidconsole.c -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ - -I${.CURDIR}/../../../contrib/dev/acpica \ - -I${.CURDIR}/../../.. -I. - +CFLAGS+= -ffreestanding BOOT_COMCONSOLE_PORT?= 0x3f8 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} BOOT_COMCONSOLE_SPEED?= 9600 CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED} -# the location of libstand -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ - .ifdef(BOOT_BIOSDISK_DEBUG) # Make the disk code more talkative CFLAGS+= -DDISK_DEBUG @@ -32,6 +26,12 @@ CFLAGS+= -DDISK_DEBUG # Include simple terminal emulation (cons25-compatible) CFLAGS+= -DTERM_EMU +CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ + -I${.CURDIR}/../../../contrib/dev/acpica \ + -I${.CURDIR}/../../.. -I. +# the location of libstand +CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ + # Make "machine" required for all objects # (based on the more complete case in sys/i386/boot/Makefile.inc) ${SRCS:M*.c:R:S/$/.o/g}: machine diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile index 33f23f0364e5..0ad12764afe4 100644 --- a/sys/boot/i386/loader/Makefile +++ b/sys/boot/i386/loader/Makefile @@ -13,6 +13,7 @@ LOADER_AOUT_SUPPORT= yes # architecture-specific loader code SRCS= main.c conf.c +CFLAGS+= -ffreestanding # Enable PXE TFTP or NFS support, not both. .if defined(LOADER_TFTP_SUPPORT) CFLAGS+= -DLOADER_TFTP_SUPPORT