]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/Makefile.inc
MFC r326038,r326069,r326072: More stand simplification and fixes
[FreeBSD/FreeBSD.git] / stand / Makefile.inc
1 # $FreeBSD$
2
3 .include "defs.mk"
4
5 .if !defined(__BOOT_MAKEFILE_INC__)
6 __BOOT_MAKEFILE_INC__=${MFILE}
7
8 CFLAGS+=-I${SASRC}
9
10 SSP_CFLAGS=
11
12 # Add in the no float / no SIMD stuff and announce we're freestanding
13 # aarch64 and riscv don't have -msoft-float, but all others do. riscv
14 # currently has no /boot/loader, but may soon.
15 CFLAGS+=        -ffreestanding ${CFLAGS_NO_SIMD}
16 .if ${MACHINE_CPUARCH} == "aarch64"
17 CFLAGS+=        -mgeneral-regs-only
18 .elif ${MACHINE_CPUARCH} != "riscv"
19 CFLAGS+=        -msoft-float
20 .endif
21
22 .if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1)
23 CFLAGS+=        -march=i386
24 CFLAGS.gcc+=    -mpreferred-stack-boundary=2
25 .endif
26
27
28 .if ${MACHINE_CPUARCH} == "arm"
29 # Do not generate movt/movw, because the relocation fixup for them does not
30 # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
31 # Also, the fpu is not available in a standalone environment.
32 .if ${COMPILER_VERSION} < 30800
33 CFLAGS.clang+=  -mllvm -arm-use-movt=0
34 .else
35 CFLAGS.clang+=  -mno-movt
36 .endif
37 CFLAGS.clang+=  -mfpu=none
38 .endif
39
40 # The boot loader build uses dd status=none, where possible, for reproducible
41 # build output (since performance varies from run to run). Trouble is that
42 # option was recently (10.3) added to FreeBSD and is non-standard. Only use it
43 # when this test succeeds rather than require dd to be a bootstrap tool.
44 DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true
45 DD=dd ${DD_NOSTATUS}
46
47 .if ${MK_LOADER_FORCE_LE} != "no"
48 .if ${MACHINE_ARCH} == "powerpc64"
49 CFLAGS+=        -mlittle-endian
50 .endif
51 .endif
52
53 .endif