aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/files.amd64
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2016-08-24 10:51:33 +0000
committerEd Schouten <ed@FreeBSD.org>2016-08-24 10:51:33 +0000
commit22f2f875ad5dc8e2a0474a3713022df478577603 (patch)
treed8c827c222046d8ff6591f23b555b6d1ad3df6a1 /sys/conf/files.amd64
parent3b36d1e469d42a25c74051e00940408c8b905a93 (diff)
downloadsrc-22f2f875ad5dc8e2a0474a3713022df478577603.tar.gz
src-22f2f875ad5dc8e2a0474a3713022df478577603.zip
Make execution of 32-bit CloudABI executables work on amd64.
A nice thing about requiring a vDSO is that it makes it incredibly easy to provide full support for running 32-bit processes on 64-bit systems. Instead of letting the kernel be responsible for composing/decomposing 64-bit arguments across multiple registers/stack slots, all of this can now be done in the vDSO. This means that there is no need to provide duplicate copies of certain system calls, like the sys_lseek() and freebsd32_lseek() we have for COMPAT_FREEBSD32. This change imports a new vDSO from the CloudABI repository that has automatically generated code in it that copies system call arguments into a buffer, padding them to eight bytes and zero-extending any pointers/size_t arguments. After returning from the kernel, it does the inverse: extracting return values, in the process truncating pointers/size_t values to 32 bits. Obtained from: https://github.com/NuxiNL/cloudabi
Notes
Notes: svn path=/head/; revision=304744
Diffstat (limited to 'sys/conf/files.amd64')
-rw-r--r--sys/conf/files.amd6413
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index f32ebf62d9b0..f4c2bb7724b2 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -8,6 +8,18 @@
# dependency lines other than the first are silently ignored.
#
#
+cloudabi32_vdso.o optional compat_cloudabi32 \
+ dependency "$S/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S" \
+ compile-with "${CC} -x assembler-with-cpp -m32 -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S -o ${.TARGET}" \
+ no-obj no-implicit-rule \
+ clean "cloudabi32_vdso.o"
+#
+cloudabi32_vdso_blob.o optional compat_cloudabi32 \
+ dependency "cloudabi32_vdso.o" \
+ compile-with "${OBJCOPY} --input-target binary --output-target elf64-x86-64-freebsd --binary-architecture i386 cloudabi32_vdso.o ${.TARGET}" \
+ no-implicit-rule \
+ clean "cloudabi32_vdso_blob.o"
+#
cloudabi64_vdso.o optional compat_cloudabi64 \
dependency "$S/contrib/cloudabi/cloudabi_vdso_x86_64.S" \
compile-with "${CC} -x assembler-with-cpp -shared -nostdinc -nostdlib -Wl,-T$S/compat/cloudabi/cloudabi_vdso.lds $S/contrib/cloudabi/cloudabi_vdso_x86_64.S -o ${.TARGET}" \
@@ -146,6 +158,7 @@ amd64/amd64/trap.c standard
amd64/amd64/uio_machdep.c standard
amd64/amd64/uma_machdep.c standard
amd64/amd64/vm_machdep.c standard
+amd64/cloudabi32/cloudabi32_sysvec.c optional compat_cloudabi32
amd64/cloudabi64/cloudabi64_sysvec.c optional compat_cloudabi64
amd64/pci/pci_cfgreg.c optional pci
cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S optional zfs | dtrace compile-with "${ZFS_S}"