From: Matthew Dillon Date: Sun, 7 Aug 2016 08:34:54 +0000 (-0700) Subject: boot - Force -O X-Git-Tag: v4.8.0rc~1249 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/46ddd68f6ccef49373c7505b2bb6b95e9ac0097d boot - Force -O * Always force -O for the boot code. -O2 will implode it. This is a bit weird but -O will override any prior -O2. We still want other CFLAGS that mk scripts supply so we can't just set CFLAGS= --- diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc index e1f5e81d50..617bd0e55b 100644 --- a/sys/boot/common/Makefile.inc +++ b/sys/boot/common/Makefile.inc @@ -27,3 +27,7 @@ SRCS+= do_dloader.c .endif MAN+= loader.8 + +# Force -O, -O2 implodes +# +CFLAGS+= -O diff --git a/sys/boot/dloader/Makefile b/sys/boot/dloader/Makefile index 8f0efb2832..a271c85265 100644 --- a/sys/boot/dloader/Makefile +++ b/sys/boot/dloader/Makefile @@ -4,6 +4,10 @@ SRCS= subs.c config.c cmds.c +# Force -O, -O2 implodes +# +CFLAGS+= -O + # For i386, dloader32/Makefile takes care of the extra CFLAGS .if ${MACHINE_ARCH} != "i386" CFLAGS+= -fPIC -mno-red-zone diff --git a/sys/boot/efi/Makefile.inc b/sys/boot/efi/Makefile.inc index ba170f1d9b..2f0bba4b41 100644 --- a/sys/boot/efi/Makefile.inc +++ b/sys/boot/efi/Makefile.inc @@ -4,6 +4,7 @@ BINDIR?= /boot # Options used when building app-specific efi components # See conf/kern.mk for the correct set of these +CFLAGS+= -O CFLAGS+= -ffreestanding -Wformat CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float LDFLAGS+= -nostdlib diff --git a/sys/boot/libstand32/Makefile b/sys/boot/libstand32/Makefile index c2bd993568..2da20a3415 100644 --- a/sys/boot/libstand32/Makefile +++ b/sys/boot/libstand32/Makefile @@ -8,4 +8,8 @@ LIB= stand32 MAN= .PATH: ${LIBSTAND_SRC} +# Force -O, -O2 implodes +# +CFLAGS+= -O + .include "${LIBSTAND_SRC}/Makefile" diff --git a/sys/boot/pc32/Makefile.inc b/sys/boot/pc32/Makefile.inc index 6c8405c26a..1834a99f25 100644 --- a/sys/boot/pc32/Makefile.inc +++ b/sys/boot/pc32/Makefile.inc @@ -4,6 +4,9 @@ __pc32__: LOADER_ADDRESS?= 0x200000 +# Force -O, -O2 implodes +# +CFLAGS+= -O CFLAGS+= -ffreestanding CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float