Changeset View
Changeset View
Standalone View
Standalone View
sys/modules/vmm/Makefile
# $FreeBSD$ | # $FreeBSD$ | ||||
.include <kmod.opts.mk> | .include <kmod.opts.mk> | ||||
KMOD= vmm | KMOD= vmm | ||||
SRCS= opt_acpi.h opt_bhyve_snapshot.h opt_ddb.h | SRCS= opt_acpi.h opt_ddb.h device_if.h bus_if.h pci_if.h pcib_if.h acpi_if.h | ||||
SRCS+= device_if.h bus_if.h pci_if.h pcib_if.h acpi_if.h vnode_if.h | |||||
DPSRCS+= vmx_assym.h svm_assym.h | |||||
DPSRCS+= vmx_genassym.c svm_genassym.c offset.inc | |||||
CFLAGS+= -DVMM_KEEP_STATS | CFLAGS+= -DVMM_KEEP_STATS | ||||
CFLAGS+= -I${SRCTOP}/sys/amd64/vmm | CFLAGS+= -I${SRCTOP}/sys/${MACHINE}/vmm | ||||
CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/io | CFLAGS+= -I${SRCTOP}/sys/${MACHINE}/vmm/io | ||||
CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/intel | |||||
CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/amd | |||||
# generic vmm support | # generic vmm support | ||||
.PATH: ${SRCTOP}/sys/amd64/vmm | .PATH: ${SRCTOP}/sys/${MACHINE}/vmm | ||||
SRCS+= vmm.c \ | SRCS+= vmm.c \ | ||||
vmm_dev.c \ | vmm_dev.c \ | ||||
vmm_host.c \ | |||||
vmm_instruction_emul.c \ | vmm_instruction_emul.c \ | ||||
vmm_mem.c \ | |||||
vmm_stat.c | |||||
.if ${MACHINE_CPUARCH} == "aarch64" | |||||
# TODO: Add the new EL2 code | |||||
SRCS+= vmm_arm64.c \ | |||||
vmm_psci.c \ | |||||
vmm_reset.c \ | |||||
vmm_call.S \ | |||||
vmm_mmu.c \ | |||||
vmm_hyp_el2.S | |||||
.PATH: ${SRCTOP}/sys/${MACHINE}/vmm/io | |||||
SRCS+= vgic_v3.c \ | |||||
vtimer.c | |||||
CLEANFILES+= vmm_hyp_exception.o vmm_hyp.o vmm_hyp_blob.elf.full | |||||
CLEANFILES+= vmm_hyp_blob.elf vmm_hyp_blob.bin | |||||
CFLAGS.vmm_hyp_exception.S += -fpie | |||||
CFLAGS.vmm_hyp.c += -fpie | |||||
vmm_hyp_exception.o: vmm_hyp_exception.S | |||||
vmm_hyp.o: vmm_hyp.c | |||||
vmm_hyp_blob.elf.full: vmm_hyp_exception.o vmm_hyp.o | |||||
${CC} -o ${.TARGET} ${.ALLSRC} -fPIE -nostdlib \ | |||||
-T ${SYSDIR}/conf/ldscript.arm64 \ | |||||
-Wl,--defsym=text_start='0x0' | |||||
vmm_hyp_blob.elf: vmm_hyp_blob.elf.full | |||||
${OBJCOPY} --strip-debug ${.ALLSRC} ${.TARGET} | |||||
jrtc27: CC doesn't include crucial things like -target and, in the case of CheriBSD downstream, -march… | |||||
Not Done Inline Actions(This also applies to files.arm64 AFAICT) jrtc27: (This also applies to files.arm64 AFAICT) | |||||
vmm_hyp_blob.bin: vmm_hyp_blob.elf | |||||
${OBJCOPY} --output-target=binary ${.ALLSRC} ${.TARGET} | |||||
vmm_hyp_el2.o: vmm_hyp_blob.bin | |||||
.elif ${MACHINE_CPUARCH} == "amd64" | |||||
DPSRCS+= vmx_assym.h svm_assym.h | |||||
DPSRCS+= vmx_genassym.c svm_genassym.c offset.inc | |||||
CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/intel | |||||
CFLAGS+= -I${SRCTOP}/sys/amd64/vmm/amd | |||||
SRCS+= vmm_host.c \ | |||||
vmm_ioport.c \ | vmm_ioport.c \ | ||||
vmm_lapic.c \ | vmm_lapic.c \ | ||||
vmm_mem.c \ | |||||
vmm_stat.c \ | |||||
vmm_util.c \ | vmm_util.c \ | ||||
x86.c | x86.c | ||||
.PATH: ${SRCTOP}/sys/amd64/vmm/io | .PATH: ${SRCTOP}/sys/${MACHINE}/vmm/io | ||||
SRCS+= iommu.c \ | SRCS+= iommu.c \ | ||||
ppt.c \ | ppt.c \ | ||||
vatpic.c \ | vatpic.c \ | ||||
vatpit.c \ | vatpit.c \ | ||||
vhpet.c \ | vhpet.c \ | ||||
vioapic.c \ | vioapic.c \ | ||||
vlapic.c \ | vlapic.c \ | ||||
vpmtmr.c \ | vpmtmr.c \ | ||||
Show All 20 Lines | SRCS+= vmcb.c \ | ||||
ivrs_drv.c \ | ivrs_drv.c \ | ||||
amdvi_hw.c \ | amdvi_hw.c \ | ||||
svm_msr.c | svm_msr.c | ||||
.if ${KERN_OPTS:MBHYVE_SNAPSHOT} != "" | .if ${KERN_OPTS:MBHYVE_SNAPSHOT} != "" | ||||
SRCS+= vmm_snapshot.c | SRCS+= vmm_snapshot.c | ||||
.endif | .endif | ||||
CLEANFILES= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o | CLEANFILES+= vmx_assym.h vmx_genassym.o svm_assym.h svm_genassym.o | ||||
OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h | OBJS_DEPEND_GUESS.vmx_support.o+= vmx_assym.h | ||||
OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h | OBJS_DEPEND_GUESS.svm_support.o+= svm_assym.h | ||||
.endif | |||||
vmx_assym.h: vmx_genassym.o | vmx_assym.h: vmx_genassym.o | ||||
sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET} | sh ${SYSDIR}/kern/genassym.sh vmx_genassym.o > ${.TARGET} | ||||
svm_assym.h: svm_genassym.o | svm_assym.h: svm_genassym.o | ||||
sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET} | sh ${SYSDIR}/kern/genassym.sh svm_genassym.o > ${.TARGET} | ||||
vmx_support.o: | vmx_support.o: | ||||
${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ | ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ | ||||
${.IMPSRC} -o ${.TARGET} | ${.IMPSRC} -o ${.TARGET} | ||||
svm_support.o: | svm_support.o: | ||||
${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ | ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ | ||||
${.IMPSRC} -o ${.TARGET} | ${.IMPSRC} -o ${.TARGET} | ||||
hyp_genassym.o: offset.inc | |||||
${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC} | |||||
vmx_genassym.o: offset.inc | vmx_genassym.o: offset.inc | ||||
${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC} | ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC} | ||||
svm_genassym.o: offset.inc | svm_genassym.o: offset.inc | ||||
${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC} | ${CC} -c ${CFLAGS:N-flto:N-fno-common} -fcommon ${.IMPSRC} | ||||
.include <bsd.kmod.mk> | .include <bsd.kmod.mk> |
CC doesn't include crucial things like -target and, in the case of CheriBSD downstream, -march and -mabi. The lack of -target means that, if you're using an LLVM that has its default target triple as any of i386, powerpc, mips{,64}{,el} or riscv64 (or a whole host of other non-FreeBSD triples), you'll get an explicit emulation passed to LD that will be for a different architecture than AArch64 (note that amd64 does not pass an explicit emulation, so cross-compiling from FreeBSD/amd64 happens to not show this issue).
Also -fPIE doesn't make sense for *linking*, it's a code generation option. I'm guessing you really want -pie here?..