mirror of
https://github.com/opnsense/src.git
synced 2026-02-13 07:44:48 -05:00
When fixing this module to build on PC98, I actually broke the build on ARM64. On PC98 we need to pull in the sources from the MACHINE_CPUARCH (i386), but on ARM64 we need to use the MACHINE, as MACHINE_CPUARCH is set to aarch64 instead of just arm64.
38 lines
1.1 KiB
Makefile
38 lines
1.1 KiB
Makefile
# $FreeBSD$
|
|
|
|
SYSDIR?=${.CURDIR}/../..
|
|
|
|
.PATH: ${SYSDIR}/compat/cloudabi32
|
|
.PATH: ${SYSDIR}/${MACHINE_CPUARCH}/cloudabi32
|
|
.PATH: ${SYSDIR}/${MACHINE}/cloudabi32
|
|
|
|
KMOD= cloudabi32
|
|
SRCS= cloudabi32_fd.c cloudabi32_module.c cloudabi32_poll.c \
|
|
cloudabi32_sock.c cloudabi32_syscalls.c cloudabi32_sysent.c \
|
|
cloudabi32_sysvec.c cloudabi32_thread.c
|
|
|
|
OBJS= cloudabi32_vdso_blob.o
|
|
CLEANFILES=cloudabi32_vdso.o
|
|
|
|
.if ${MACHINE_CPUARCH} == "i386"
|
|
VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686.S
|
|
OUTPUT_TARGET=elf32-i386-freebsd
|
|
BINARY_ARCHITECTURE=aarch32
|
|
.elif ${MACHINE_CPUARCH} == "amd64"
|
|
VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
|
|
OUTPUT_TARGET=elf64-x86-64-freebsd
|
|
BINARY_ARCHITECTURE=i386
|
|
.endif
|
|
|
|
cloudabi32_vdso.o: ${VDSO_SRCS}
|
|
${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib \
|
|
-Wl,-T${SYSDIR}/compat/cloudabi/cloudabi_vdso.lds \
|
|
${VDSO_SRCS} -o ${.TARGET}
|
|
|
|
cloudabi32_vdso_blob.o: cloudabi32_vdso.o
|
|
${OBJCOPY} --input-target binary \
|
|
--output-target ${OUTPUT_TARGET} \
|
|
--binary-architecture ${BINARY_ARCHITECTURE} \
|
|
cloudabi32_vdso.o ${.TARGET}
|
|
|
|
.include <bsd.kmod.mk>
|