aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2015-08-27 23:46:42 +0000
committerWarner Losh <imp@FreeBSD.org>2015-08-27 23:46:42 +0000
commit9d2edd63d4d10fb2cd9732a602706d8990892c54 (patch)
tree4b5ef87fae8f2c0ca7f1556f0b1c771c81437d7b
parentae1f3df43466466a21c7da0df93ecb58a3e53d74 (diff)
Notes
-rw-r--r--lib/libstand/Makefile27
-rw-r--r--share/mk/bsd.stand.mk24
-rw-r--r--sys/boot/efi/Makefile.inc7
-rw-r--r--sys/boot/ficl/Makefile18
-rw-r--r--sys/boot/i386/Makefile.inc2
-rw-r--r--sys/boot/libstand32/Makefile24
-rw-r--r--sys/boot/pc98/Makefile.inc2
-rw-r--r--sys/boot/userboot/ficl/Makefile16
-rw-r--r--sys/boot/userboot/libstand/Makefile21
-rw-r--r--sys/boot/zfs/Makefile7
10 files changed, 35 insertions, 113 deletions
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 2ee29212f2cf9..a038087dfa44b 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -21,34 +21,8 @@ MAN= libstand.3
WARNS?= 0
-CFLAGS+= -ffreestanding -Wformat
CFLAGS+= -I${LIBSTAND_SRC}
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
-.endif
-.if ${MACHINE_CPUARCH} == "i386"
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-.endif
-.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -fPIC -mno-red-zone
-.endif
-.if ${MACHINE} == "pc98"
-CFLAGS+= -Os
-.endif
-.if ${MACHINE_CPUARCH} == "powerpc"
-CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG
-.endif
-.if ${MACHINE_CPUARCH} == "arm"
-CFLAGS+= -msoft-float -D_STANDALONE
-.endif
-.if ${MACHINE_CPUARCH} == "aarch64"
-CFLAGS+= -D_STANDALONE -mgeneral-regs-only
-.endif
-.if ${MACHINE_CPUARCH} == "mips"
-CFLAGS+= -G0 -fno-pic -mno-abicalls
-.endif
-
# standalone components and stuff we have modified locally
SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \
@@ -168,4 +142,5 @@ SRCS+= pkgfs.c
SRCS+= nandfs.c
.endif
+.include <bsd.stand.mk>
.include <bsd.lib.mk>
diff --git a/share/mk/bsd.stand.mk b/share/mk/bsd.stand.mk
new file mode 100644
index 0000000000000..965171b9ff677
--- /dev/null
+++ b/share/mk/bsd.stand.mk
@@ -0,0 +1,24 @@
+# $FreeBSD$
+#
+# Common definitons for programs building in the stand-alone environment
+# and/or using libstand.
+#
+
+CFLAGS+= -ffreestanding -Wformat
+CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -D_STANDALONE
+
+.if ${MACHINE_CPUARCH} == "i386"
+CFLAGS.gcc+= -mpreferred-stack-boundary=2
+.endif
+.if ${MACHINE_CPUARCH} == "amd64"
+CFLAGS+= -fPIC -mno-red-zone
+.endif
+.if ${MACHINE} == "pc98"
+CFLAGS+= -Os
+.endif
+.if ${MACHINE_CPUARCH} == "aarch64"
+CFLAGS+= -mgeneral-regs-only
+.endif
+.if ${MACHINE_CPUARCH} == "mips"
+CFLAGS+= -G0 -fno-pic -mno-abicalls
+.endif
diff --git a/sys/boot/efi/Makefile.inc b/sys/boot/efi/Makefile.inc
index 33ce9d2f5fcb3..9ed0cdaa71d61 100644
--- a/sys/boot/efi/Makefile.inc
+++ b/sys/boot/efi/Makefile.inc
@@ -4,19 +4,18 @@ BINDIR?= /boot
.if ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -march=i386
+CFLAGS+= -mno-aes
.endif
# Options used when building app-specific efi components
# See conf/kern.mk for the correct set of these
-CFLAGS+= -ffreestanding -Wformat -msoft-float
+CFLAGS+= -ffreestanding -Wformat -msoft-float ${CFLAGS_NO_SIMD}
LDFLAGS+= -nostdlib
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -fshort-wchar
CFLAGS+= -mno-red-zone
-CFLAGS+= -mno-mmx -mno-sse
-CFLAGS.clang+= -mno-aes -mno-avx
+CFLAGS+= -mno-aes
.endif
-
.include "../Makefile.inc"
diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
index 15baae3f49089..e404acd280b0d 100644
--- a/sys/boot/ficl/Makefile
+++ b/sys/boot/ficl/Makefile
@@ -15,30 +15,14 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
SRCS= ${BASE_SRCS} sysdep.c softcore.c
CLEANFILES= softcore.c testmain testmain.o
-CFLAGS+= -ffreestanding
.if ${MACHINE_CPUARCH} == "i386" || \
(${MACHINE_CPUARCH} == "amd64" && defined(FICL32))
CFLAGS+= -march=i386
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-.endif
-.if ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -mno-red-zone
-.endif
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
-.endif
-.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
-CFLAGS+= -msoft-float
-.endif
-.if ${MACHINE} == "pc98"
-CFLAGS+= -Os -DPC98
-.endif
-.if ${MACHINE_CPUARCH} == "mips"
-CFLAGS+= -G0 -fno-pic -mno-abicalls
.endif
.if HAVE_PNP
CFLAGS+= -DHAVE_PNP
.endif
+.include <bsd.stand.mk>
.ifmake testmain
CFLAGS+= -DTESTMAIN -D_TESTMAIN
SRCS+= testmain.c
diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc
index 0378683f0ff7b..d209b5f28bb13 100644
--- a/sys/boot/i386/Makefile.inc
+++ b/sys/boot/i386/Makefile.inc
@@ -7,7 +7,7 @@ BINDIR?= /boot
LOADER_ADDRESS?=0x200000
CFLAGS+= -march=i386 -ffreestanding
CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
LDFLAGS+= -nostdlib
.if ${MACHINE_CPUARCH} == "amd64"
diff --git a/sys/boot/libstand32/Makefile b/sys/boot/libstand32/Makefile
index c41dc21f6c50f..93aec6077c573 100644
--- a/sys/boot/libstand32/Makefile
+++ b/sys/boot/libstand32/Makefile
@@ -22,29 +22,6 @@ NO_PIC=
WARNS?= 0
-CFLAGS+= -ffreestanding -Wformat
-CFLAGS+= -I${LIBSTAND_SRC}
-
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
-.endif
-.if ${MACHINE} == "pc98"
-CFLAGS+= -Os
-.endif
-.if ${MACHINE_CPUARCH} == "powerpc"
-CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG
-.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
-CFLAGS+= -m32 -I.
-.endif
-.if ${MACHINE_CPUARCH} == "arm"
-CFLAGS+= -msoft-float -D_STANDALONE
-.endif
-.if ${MACHINE_CPUARCH} == "mips"
-CFLAGS+= -G0 -fno-pic -mno-abicalls
-.endif
-
# standalone components and stuff we have modified locally
SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \
@@ -164,6 +141,7 @@ SRCS+= pkgfs.c
SRCS+= nandfs.c
.endif
+.include <bsd.stand.mk>
.include <bsd.lib.mk>
.if ${MACHINE_CPUARCH} == "amd64"
diff --git a/sys/boot/pc98/Makefile.inc b/sys/boot/pc98/Makefile.inc
index b61330229f9a2..76774b3b6b2a5 100644
--- a/sys/boot/pc98/Makefile.inc
+++ b/sys/boot/pc98/Makefile.inc
@@ -7,7 +7,7 @@ BINDIR?= /boot
LOADER_ADDRESS?=0x200000
CFLAGS+= -march=i386 -ffreestanding
CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
CFLAGS+= -Os -DPC98
LDFLAGS+= -nostdlib
diff --git a/sys/boot/userboot/ficl/Makefile b/sys/boot/userboot/ficl/Makefile
index 7bd8dd56a9b85..d8f749f9c6eba 100644
--- a/sys/boot/userboot/ficl/Makefile
+++ b/sys/boot/userboot/ficl/Makefile
@@ -10,24 +10,10 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
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"
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= -mno-sse3
-.endif
-.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
-CFLAGS+= -msoft-float
-.endif
-.if ${MACHINE} == "pc98"
-CFLAGS+= -Os -DPC98
-.endif
.if HAVE_PNP
CFLAGS+= -DHAVE_PNP
.endif
+.include <bsd.stand.mk>
.ifmake testmain
CFLAGS+= -DTESTMAIN -D_TESTMAIN
SRCS+= testmain.c
diff --git a/sys/boot/userboot/libstand/Makefile b/sys/boot/userboot/libstand/Makefile
index 88eb98f44e0b5..401bbdacdbefb 100644
--- a/sys/boot/userboot/libstand/Makefile
+++ b/sys/boot/userboot/libstand/Makefile
@@ -22,26 +22,6 @@ NO_PIC=
WARNS?= 0
-CFLAGS+= -ffreestanding -Wformat -fPIC
-CFLAGS+= -I${LIBSTAND_SRC}
-
-.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
-.endif
-.if ${MACHINE_CPUARCH} == "i386"
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= -mno-sse3
-.endif
-.if ${MACHINE} == "pc98"
-CFLAGS+= -Os
-.endif
-.if ${MACHINE_CPUARCH} == "powerpc"
-CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG
-.endif
-.if ${MACHINE_CPUARCH} == "arm"
-CFLAGS+= -msoft-float -D_STANDALONE
-.endif
-
# standalone components and stuff we have modified locally
SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c gets.c \
globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \
@@ -152,4 +132,5 @@ SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
SRCS+= dosfs.c ext2fs.c
SRCS+= splitfs.c
+.include <bsd.stand.mk>
.include <bsd.lib.mk>
diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile
index 24076437d337d..6f8c26b011396 100644
--- a/sys/boot/zfs/Makefile
+++ b/sys/boot/zfs/Makefile
@@ -10,14 +10,8 @@ CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I.
CFLAGS+= -I${.CURDIR}/../../../lib/libstand
CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs
-CFLAGS+= -ffreestanding
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -march=i386
-CFLAGS.gcc+= -mpreferred-stack-boundary=2
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
-.endif
-.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
-CFLAGS+= -msoft-float
.endif
.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32
@@ -31,6 +25,7 @@ machine:
ln -sf ${.CURDIR}/../../i386/include machine
.endif
+.include <bsd.stand.mk>
.include <bsd.lib.mk>
.if ${MACHINE_CPUARCH} == "amd64"