From 49f4cdad96af110a9d02ea8389a49706a89d4f9e Mon Sep 17 00:00:00 2001 From: Hajime Tazaki Date: Wed, 10 Jul 2024 21:11:39 +0900 Subject: [PATCH] fix undefined reference to __getauxval Signed-off-by: Hajime Tazaki --- build.sh | 5 ++++- patches/aarch64.patch | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 patches/aarch64.patch diff --git a/build.sh b/build.sh index 6b5da08a..79a0bd78 100755 --- a/build.sh +++ b/build.sh @@ -51,7 +51,10 @@ case ${TARGET} in *-linux*) OS=linux export HOST_CFLAGS="-fcommon" - EXTRA_CFLAGS+=" -fcommon" + EXTRA_CFLAGS="${EXTRA_CFLAGS} -fcommon" + if [ ${TARGET} = "aarch64-linux-gnu" ] ; then + EXTRA_CFLAGS="${EXTRA_CFLAGS} -mno-outline-atomics" + fi ;; *-netbsd*) OS=netbsd diff --git a/patches/aarch64.patch b/patches/aarch64.patch new file mode 100644 index 00000000..d89aafb6 --- /dev/null +++ b/patches/aarch64.patch @@ -0,0 +1,14 @@ +Submodule linux contains modified content +diff --git a/linux/arch/lkl/Makefile b/linux/arch/lkl/Makefile +index 5236ac6cf5e1..dabd02ee2b44 100644 +--- a/linux/arch/lkl/Makefile ++++ b/linux/arch/lkl/Makefile +@@ -8,6 +8,8 @@ KBUILD_CFLAGS += -fPIC + ifeq ($(OUTPUT_FORMAT),mach-o-x86-64) + # workaround for Mach-O section name + LINUXINCLUDE := -I $(srctree)/arch/lkl/include/mach $(LINUXINCLUDE) ++else ifeq ($(OUTPUT_FORMAT),elf64-littleaarch64) ++KBUILD_CFLAGS += -mno-outline-atomics + endif + else ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386 pe-x86-64 )) + ifneq ($(OUTPUT_FORMAT),pe-x86-64)