mtw(4) remove misplaced DEBUG_FLAGS
[freebsd/src.git] / sys / conf / Makefile.arm64
blobed9624ee5446060ab3233edef9a0352ea40a6700
1 # Makefile.arm64 -- with config changes.
2 # Copyright 1990 W. Jolitz
3 #       from FreeBSD: src/sys/conf/Makefile.i386,v 1.255 2002/02/20 23:35:49
5 # Makefile for FreeBSD
7 # This makefile is constructed from a machine description:
8 #       config machineid
9 # Most changes should be made in the machine description
10 #       /sys/arm64/conf/``machineid''
11 # after which you should do
12 #        config machineid
13 # Generic makefile changes should be made in
14 #       /sys/conf/Makefile.arm64
15 # after which config should be rerun for all machines.
18 # Which version of config(8) is required.
19 %VERSREQ=       600012
21 .if !defined(S)
22 S=      ../../..
23 .endif
24 .include "$S/conf/kern.pre.mk"
26 INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include
28 LINUX_DTS_VERSION!=     awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts
29 CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\"
31 PERTHREAD_SSP_ENABLED!= grep PERTHREAD_SSP opt_global.h || true ; echo
32 .if !empty(PERTHREAD_SSP_ENABLED)
33 . if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 130000) || \
34   ${COMPILER_TYPE} == "gcc"
35 ARM64_SSP_CFLAGS = -mstack-protector-guard=sysreg
36 ARM64_SSP_CFLAGS += -mstack-protector-guard-reg=sp_el0
37 ARM64_SSP_CFLAGS += -mstack-protector-guard-offset=0
38 . else
39 ARM64_SSP_CFLAGS += -DPERTHREAD_SSP_WARNING
40 .  warning "Compiler is too old to support PERTHREAD_SSP"
41 . endif
42 CFLAGS += ${ARM64_SSP_CFLAGS}
43 ARCH_FLAGS += ${ARM64_SSP_CFLAGS}
44 .endif
46 # Use a custom SYSTEM_LD command to generate the elf kernel, so we can
47 # set the text segment start address, and also strip the "arm mapping
48 # symbols" which have names like $a.0 and $d.2; see the document
49 # "ELF for the ARM architecture" for more info on the mapping symbols.
50 SYSTEM_LD= \
51         ${SYSTEM_LD_BASECMD} \
52             --defsym='text_start=kernbase + SIZEOF_HEADERS' \
53             -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \
54         $(OBJCOPY) \
55             --wildcard \
56             --strip-symbol='$$[adtx]*' \
57             ${.TARGET}
59 .if !empty(DDB_ENABLED) || !empty(DTRACE_ENABLED) || !empty(HWPMC_ENABLED)
60 CFLAGS += -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
61 .endif
63 %BEFORE_DEPEND
65 %OBJS
67 %FILES.c
69 %FILES.s
71 %FILES.m
73 %CLEAN
75 %RULES
77 .include "$S/conf/kern.post.mk"
79 # Create a kernel.bin file...
80 # Copy the kernel to u-boot's booti image format (the elf headers are
81 # stripped and a custom binary head blob is prepended), saving the
82 # output in a temp file.  We also strip arm "marker" symbols which are
83 # used only by elf toolchains.  Read the symbols from kernel.full and pass
84 # them to arm_kernel_boothdr.awk, which generates a binary header blob
85 # that goes on the front of the stripped kernel.  Cat the header blob
86 # and the temp file together to make the kernel.bin file.
87 ${KERNEL_KO}.bin: ${FULLKERNEL}
88         @${OBJCOPY} --wildcard --strip-symbol='$$[adtx]*' \
89             --output-target=binary ${FULLKERNEL} ${.TARGET}.temp
90         @{ ${NM} ${FULLKERNEL} | \
91             LC_ALL=C \
92             ${AWK} -f $S/tools/arm_kernel_boothdr.awk -v hdrtype=v8booti && \
93             cat ${.TARGET}.temp; \
94          } > ${.TARGET}
95         @rm ${.TARGET}.temp
96         @echo "created ${.TARGET} from ${.ALLSRC}"