From d3b03d746b9f12c8e6e55ca6d9528247e3bb3a84 Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Mon, 25 Jun 2018 20:33:04 +0000 Subject: [PATCH] linux64: add arm64 linuxulator build details The arm64 linuxulator needs different arguments for the objcopy invocation used to build the linux VDSO. These arguments are both arch- and OS-dependent, so I did not try to use some common setting for them. Reviewed by: imp Sponsored by: Turing Robotic Industries Differential Revision: https://reviews.freebsd.org/D16011 --- sys/modules/linux64/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 17f2f87e843..21ed35c4f06 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -35,9 +35,16 @@ linux_locore.o: linux_locore.s linux_assym.h -Wl,-soname=${VDSO}.so.1,-warn-common -nostdlib \ ${.IMPSRC} -o ${.TARGET} +.if ${MACHINE_CPUARCH} == "aarch64" +OBJCOPY_TARGET=--output-target elf64-littleaarch64 --binary-architecture aarch64 +.elif ${MACHINE_CPUARCH} == "amd64" +OBJCOPY_TARGET=--output-target elf64-x86-64 --binary-architecture i386:x86-64 +.else +.error ${MACHINE_CPUARCH} not yet supported by linux64 +.endif ${VDSO}.so: linux_locore.o - ${OBJCOPY} --input-target binary --output-target elf64-x86-64 \ - -S -g --binary-architecture i386:x86-64 linux_locore.o ${.TARGET} + ${OBJCOPY} --input-target binary ${OBJCOPY_TARGET} -S -g \ + linux_locore.o ${.TARGET} strip -N _binary_linux_locore_o_size ${.TARGET} linux_support.o: assym.inc linux_assym.h