Move some more common stuff up to Makefile.inc. In particular, the no
simd / no float stuff is centeralized here. Also centralise -ffreestanding since it is specified everywhere. This, along with a change to share/mk/bsd.cpu.mk to include -mno-avx2 in CFLAGS_NO_SIMD should fix building for newer machines (eg with CPUTYPE=haswell) where clang was generating avx2 instructions. Sponsored by: Netflix
This commit is contained in:
parent
11e5eeaa48
commit
f097f35b37
@ -9,6 +9,20 @@ CFLAGS+=-I${SASRC}
|
||||
|
||||
SSP_CFLAGS=
|
||||
|
||||
# Add in the no float / no SIMD stuff and announce we're freestanding
|
||||
CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD}
|
||||
.if ${MACHINE_CPUARCH} == "aarch64"
|
||||
CFLAGS+= -mgeneral-regs-only
|
||||
.else
|
||||
CFLAGS+= -msoft-float
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1)
|
||||
CFLAGS+= -march=i386
|
||||
CFLAGS.gcc+= -mpreferred-stack-boundary=2
|
||||
.endif
|
||||
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "arm"
|
||||
# Do not generate movt/movw, because the relocation fixup for them does not
|
||||
# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
|
||||
|
@ -33,8 +33,6 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt
|
||||
# Always add MI sources
|
||||
.include "${BOOTSRC}/loader.mk"
|
||||
|
||||
CFLAGS+= -ffreestanding -msoft-float
|
||||
|
||||
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
|
||||
LDFLAGS+= -Wl,-znotext
|
||||
|
||||
|
@ -1,23 +1,13 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.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 ${CFLAGS_NO_SIMD}
|
||||
CFLAGS+= -Wformat
|
||||
LDFLAGS+= -nostdlib
|
||||
|
||||
.if ${MACHINE_CPUARCH} != "aarch64"
|
||||
CFLAGS+= -msoft-float
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "amd64"
|
||||
CFLAGS+= -fshort-wchar
|
||||
CFLAGS+= -mno-red-zone
|
||||
CFLAGS+= -mno-aes
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "aarch64"
|
||||
|
@ -10,13 +10,6 @@ WARNS?= 6
|
||||
|
||||
SRCS= efi_fdt.c
|
||||
|
||||
CFLAGS+= -ffreestanding
|
||||
.if ${MACHINE_CPUARCH} == "aarch64"
|
||||
CFLAGS+= -mgeneral-regs-only
|
||||
.else
|
||||
CFLAGS+= -msoft-float
|
||||
.endif
|
||||
|
||||
# EFI library headers
|
||||
CFLAGS+= -I${EFISRC}/include
|
||||
CFLAGS+= -I${EFISRC}/include/${MACHINE}
|
||||
|
@ -16,12 +16,6 @@ SRCS+= fdt_loader_cmd.c fdt_overlay.c
|
||||
|
||||
CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC}
|
||||
|
||||
CFLAGS+= -ffreestanding
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
|
||||
CFLAGS+= -msoft-float
|
||||
.endif
|
||||
|
||||
CFLAGS+= -Wformat -Wall
|
||||
|
||||
.include <bsd.stand.mk>
|
||||
|
@ -3,9 +3,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
LOADER_ADDRESS?=0x200000
|
||||
CFLAGS+= -march=i386 -ffreestanding
|
||||
CFLAGS.gcc+= -mpreferred-stack-boundary=2
|
||||
CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
|
||||
LDFLAGS+= -nostdlib
|
||||
|
||||
# BTX components
|
||||
|
@ -1,6 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
CFLAGS+= -ffreestanding
|
||||
LDFLAGS+= -nostdlib
|
||||
|
||||
.include "../Makefile.inc"
|
||||
|
@ -47,15 +47,13 @@ MAN=
|
||||
|
||||
AFLAGS= -G0
|
||||
|
||||
CFLAGS= -ffreestanding \
|
||||
-I${.CURDIR} \
|
||||
CFLAGS+= -I${.CURDIR} \
|
||||
-I${SASRC} \
|
||||
-I${LDRSRC} \
|
||||
-D_KERNEL \
|
||||
-Wall \
|
||||
-G0 \
|
||||
-fno-pic -mno-abicalls \
|
||||
-msoft-float \
|
||||
-g
|
||||
|
||||
LDFLAGS= -nostdlib \
|
||||
|
@ -83,7 +83,6 @@ CFLAGS+= -I${.CURDIR}
|
||||
CFLAGS+= -G0 \
|
||||
-fno-pic \
|
||||
-mno-abicalls \
|
||||
-msoft-float \
|
||||
-g
|
||||
|
||||
LDFLAGS= -nostdlib \
|
||||
|
@ -29,7 +29,7 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt
|
||||
# Always add MI sources
|
||||
.include "${BOOTSRC}/loader.mk"
|
||||
|
||||
CFLAGS+= -ffreestanding -msoft-float -g
|
||||
CFLAGS+= -g
|
||||
|
||||
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
|
||||
|
||||
|
@ -14,9 +14,7 @@ SRCS+= devicename_stubs.c
|
||||
# Pick up the bootstrap header for some interface items
|
||||
CFLAGS+= -I${LDRSRC}
|
||||
|
||||
CFLAGS+= -ffreestanding
|
||||
.if ${MACHINE_CPUARCH} == "powerpc"
|
||||
CFLAGS+= -msoft-float
|
||||
SRCS+= ppc64_elf_freebsd.c
|
||||
.endif
|
||||
|
||||
|
@ -13,9 +13,7 @@ SRCS= boot1.c ashldi3.c syncicache.c
|
||||
|
||||
MAN=
|
||||
|
||||
CFLAGS= -ffreestanding -msoft-float \
|
||||
-I${LDRSRC} -I${SYSDIR} -I${SASRC} \
|
||||
-D_STANDALONE
|
||||
CFLAGS= -I${LDRSRC} -I${SYSDIR} -I${SASRC} -D_STANDALONE
|
||||
LDFLAGS=-nostdlib -static -Wl,-N
|
||||
|
||||
.PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR}
|
||||
|
@ -32,7 +32,7 @@ HELP_FILES= # Disable
|
||||
.include "${BOOTSRC}/loader.mk"
|
||||
.PATH: ${SYSDIR}/libkern
|
||||
|
||||
CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM
|
||||
CFLAGS+= -Wall -DAIM
|
||||
# load address. set in linker script
|
||||
RELOC?= 0x0
|
||||
CFLAGS+= -DRELOC=${RELOC}
|
||||
|
@ -34,7 +34,6 @@ HELP_FILES+= ${FDTSRC}/help.fdt
|
||||
|
||||
.PATH: ${SYSDIR}/libkern
|
||||
|
||||
CFLAGS+= -ffreestanding -msoft-float
|
||||
# load address. set in linker script
|
||||
RELOC?= 0x1C00000
|
||||
CFLAGS+= -DRELOC=${RELOC}
|
||||
|
@ -30,7 +30,7 @@ HELP_FILES= # Disable
|
||||
.include "${BOOTSRC}/loader.mk"
|
||||
.PATH: ${SYSDIR}/libkern
|
||||
|
||||
CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM
|
||||
CFLAGS+= -Wall -DAIM
|
||||
# load address. set in linker script
|
||||
RELOC?= 0x0
|
||||
CFLAGS+= -DRELOC=${RELOC}
|
||||
|
@ -25,8 +25,6 @@ HELP_FILES= # Disable
|
||||
.include "${BOOTSRC}/loader.mk"
|
||||
.PATH: ${SYSDIR}/libkern
|
||||
|
||||
CFLAGS+= -ffreestanding
|
||||
|
||||
LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc
|
||||
|
||||
.include "${BOOTSRC}/uboot.mk"
|
||||
|
@ -1,6 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
CFLAGS+= -ffreestanding
|
||||
LDFLAGS+= -nostdlib
|
||||
|
||||
.include "../Makefile.inc"
|
||||
|
@ -10,8 +10,6 @@ WARNS?= 2
|
||||
|
||||
SRCS= uboot_fdt.c
|
||||
|
||||
CFLAGS+= -ffreestanding -msoft-float
|
||||
|
||||
# U-Boot library headers
|
||||
CFLAGS+= -I${UBOOTSRC}/lib
|
||||
|
||||
|
@ -11,8 +11,6 @@ WARNS?= 2
|
||||
SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c
|
||||
SRCS+= module.c net.c reboot.c time.c
|
||||
|
||||
CFLAGS+= -ffreestanding -msoft-float
|
||||
|
||||
.if ${LOADER_DISK_SUPPORT:Uyes} == "yes"
|
||||
SRCS+= disk.c
|
||||
.endif
|
||||
|
@ -36,15 +36,10 @@ INTERNALLIB=
|
||||
|
||||
CFLAGS+= -DBOOTPROG=\"usbloader\"
|
||||
CFLAGS+= -ffunction-sections -fdata-sections
|
||||
CFLAGS+= -ffreestanding
|
||||
CFLAGS+= -Wformat -Wall
|
||||
CFLAGS+= -g
|
||||
CFLAGS+= -fno-pic
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
||||
CFLAGS+= -march=i386
|
||||
CFLAGS.gcc+= -mpreferred-stack-boundary=2
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "amd64"
|
||||
CFLAGS+= -m32
|
||||
.endif
|
||||
|
@ -38,10 +38,6 @@ SRCS=
|
||||
CFLAGS+= -Wall
|
||||
CFLAGS+= -g
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
||||
CFLAGS+= -march=i386
|
||||
CFLAGS.gcc+= -mpreferred-stack-boundary=2
|
||||
.endif
|
||||
.if ${MACHINE_CPUARCH} == "amd64"
|
||||
CFLAGS+= -m32
|
||||
.endif
|
||||
|
@ -36,7 +36,6 @@ SRCS+= vers.c
|
||||
|
||||
CFLAGS+= -Wall
|
||||
CFLAGS+= -I${BOOTSRC}/userboot
|
||||
CFLAGS+= -ffreestanding
|
||||
|
||||
CWARNFLAGS.main.c += -Wno-implicit-function-declaration
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user