Changeset View
Changeset View
Standalone View
Standalone View
sys/conf/Makefile.arm
Show All 26 Lines | |||||
.else | .else | ||||
S= ../../.. | S= ../../.. | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.include "$S/conf/kern.pre.mk" | .include "$S/conf/kern.pre.mk" | ||||
INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include | INCLUDES+= -I$S/contrib/libfdt -I$S/gnu/dts/include | ||||
SYSTEM_LD:= ${SYSTEM_LD:$S/conf/ldscript.$M=ldscript.$M} | |||||
SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/ldscript.$M=ldscript.$M} | |||||
.if !defined(DEBUG) && !defined(PROFLEVEL) | .if !defined(DEBUG) && !defined(PROFLEVEL) | ||||
STRIP_FLAGS = -S | STRIP_FLAGS = -S | ||||
.endif | .endif | ||||
# We don't support gcc's thump interwork stuff, so disable it | # We don't support gcc's thump interwork stuff, so disable it | ||||
CFLAGS.gcc += -mno-thumb-interwork | CFLAGS.gcc += -mno-thumb-interwork | ||||
# We generally don't want fpu instructions in the kernel. | # We generally don't want fpu instructions in the kernel. | ||||
CFLAGS.clang += -mfpu=none | CFLAGS.clang += -mfpu=none | ||||
.if !empty(DDB_ENABLED) | .if !empty(DDB_ENABLED) | ||||
CFLAGS += -funwind-tables | CFLAGS += -funwind-tables | ||||
.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500 | .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500 | ||||
# clang < 3.5.0 requires us to tell it to emit assembly with unwind information | # clang < 3.5.0 requires us to tell it to emit assembly with unwind information | ||||
CFLAGS += -mllvm -arm-enable-ehabi | CFLAGS += -mllvm -arm-enable-ehabi | ||||
.endif | .endif | ||||
.endif | .endif | ||||
# "makeoptions KERNVIRTADDR=" is now optional, supply the default value. | # "makeoptions KERNVIRTADDR=" is now optional, supply the default value. | ||||
.if empty(KERNVIRTADDR) | .if empty(KERNVIRTADDR) | ||||
KERNVIRTADDR= 0xc0000000 | KERNVIRTADDR= 0xc0000000 | ||||
.endif | .endif | ||||
# Generate both the ELF and the BIN (no elf headers) kernels; we must | |||||
# relink to generate the BIN kernel, because without headers the location | |||||
# of everything changes. | |||||
mmel: whitespace at EOL. | |||||
# Strip the "arm mapping symbols" which have names like $a.0 and $d.2; | |||||
# see the document "ELF for the ARM architecture" for details. | |||||
SYSTEM_LD= \ | |||||
${SYSTEM_LD_BASECMD} \ | |||||
--defsym='kernbase=${KERNVIRTADDR}+SIZEOF_HEADERS' \ | |||||
-o ${FULLKERNEL} ${SYSTEM_OBJS} vers.o; \ | |||||
$(OBJCOPY) \ | |||||
--strip-symbol='$[adt]*' \ | |||||
${FULLKERNEL}; \ | |||||
${SYSTEM_LD_BASECMD} \ | |||||
--defsym='kernbase=${KERNVIRTADDR}' \ | |||||
-o ${KERNEL_KO}.bin ${SYSTEM_OBJS} vers.o; \ | |||||
$(OBJCOPY) \ | |||||
--strip-symbol='$[adt]*' \ | |||||
--output-target=binary \ | |||||
${KERNEL_KO}.bin | |||||
impUnsubmitted Done Inline ActionsI'm torn on this... This isn't a no, but just a question... Do we want additional targets here to do this work? Or all of it in the psuedo shell script here? Eg, would there be an advantage to that over this approach? imp: I'm torn on this... This isn't a no, but just a question...
Do we want additional targets here… | |||||
ianAuthorUnsubmitted Done Inline ActionsI would like separate targets a bit better I think, but things overall don't seem to be structured that way. ian: I would like separate targets a bit better I think, but things overall don't seem to be… | |||||
# hack because genassym.c includes sys/bus.h which includes these. | # hack because genassym.c includes sys/bus.h which includes these. | ||||
genassym.o: bus_if.h device_if.h | genassym.o: bus_if.h device_if.h | ||||
SYSTEM_LD_ = ${LD} -m ${LD_EMULATION} -Bdynamic -T ldscript.$M.noheader \ | |||||
${_LDFLAGS} --no-warn-mismatch --warn-common --export-dynamic \ | |||||
--dynamic-linker /red/herring \ | |||||
-o ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o | |||||
SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M \ | |||||
impUnsubmitted Not Done Inline ActionsSYSTEM_LD_TAIL will become unused with these changes.... Are you planning on followups? Or did mips become a consumer while I wasn't looking? imp: SYSTEM_LD_TAIL will become unused with these changes.... Are you planning on followups? Or did… | |||||
ianAuthorUnsubmitted Done Inline ActionsUnused only in the sense of not being overridden in Makefile.arm, but it's still used in all arches to (uselessly, I think) strip a gcc2_compiled symbol (probably long-obsolete and we should gc it), and to print the linked sizes. ian: Unused only in the sense of not being overridden in Makefile.arm, but it's still used in all… | |||||
>ldscript.$M.noheader; \ | |||||
${SYSTEM_LD_}; \ | |||||
${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \ | |||||
${KERNEL_KO}.bin; \ | |||||
rm ${FULLKERNEL}.noheader | |||||
%BEFORE_DEPEND | %BEFORE_DEPEND | ||||
%OBJS | %OBJS | ||||
%FILES.c | %FILES.c | ||||
%FILES.s | %FILES.s | ||||
%FILES.m | %FILES.m | ||||
%CLEAN | %CLEAN | ||||
CLEAN+= ldscript.$M ${KERNEL_KO}.bin ldscript.$M.noheader | CLEAN+= ${KERNEL_KO}.bin | ||||
ldscript.$M: $S/conf/ldscript.$M | |||||
sed s/KERNVIRTADDR/${KERNVIRTADDR}/g > ldscript.$M < $S/conf/ldscript.$M | |||||
%RULES | %RULES | ||||
.include "$S/conf/kern.post.mk" | .include "$S/conf/kern.post.mk" |
whitespace at EOL.