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