[klibc] Finalize ARM EABI support
This checkin should complete EABI support for ARM.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
diff --git a/defconfig b/defconfig
index 017f0b7..c10a4f5 100644
--- a/defconfig
+++ b/defconfig
@@ -5,4 +5,4 @@
CONFIG_REGPARM=y
# ARM options
# CONFIG_KLIBC_THUMB is not set
-# CONFIG_EABI is not set
+# CONFIG_AEABI is not set
diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG
index 360904d..b2cc208 100644
--- a/usr/klibc/arch/arm/MCONFIG
+++ b/usr/klibc/arch/arm/MCONFIG
@@ -7,20 +7,26 @@
# accordingly.
#
-THUMB = n
CPU_ARCH := armv4
CPU_TUNE := strongarm
KLIBCOPTFLAGS = -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
KLIBCBITSIZE = 32
KLIBCREQFLAGS = -fno-exceptions -mno-thumb-interwork
+KLIBCSTRIPFLAGS += -R .ARM.exidx
ifeq ($(CONFIG_KLIBC_THUMB),y)
CPU_ARCH := $(CPU_ARCH)t
-KLIBCOPTFLAGS += -mthumb
+KLIBCREQFLAGS += -mthumb
KLIBCLDFLAGS += --thumb-entry _start
endif
+ifeq ($(CONFIG_AEABI),y)
+KLIBCREQFLAGS += -mabi=aapcs-linux
+else
+KLIBCREQFLAGS += -mabi=apcs-gnu
+endif
+
# Extra linkflags when building the shared version of the library
# This address needs to be reachable using normal inter-module
# calls, and work on the memory models for this architecture
diff --git a/usr/klibc/arch/arm/Makefile.inc b/usr/klibc/arch/arm/Makefile.inc
index a03924d..63249fb 100644
--- a/usr/klibc/arch/arm/Makefile.inc
+++ b/usr/klibc/arch/arm/Makefile.inc
@@ -10,6 +10,7 @@
KLIBCARCHOBJS = \
arch/arm/syscall.o \
arch/arm/vfork.o \
+ arch/arm/aeabi_nonsense.o \
libgcc/__udivmodsi4.o \
libgcc/__divdi3.o \
libgcc/__moddi3.o \
diff --git a/usr/klibc/arch/arm/aeabi_nonsense.S b/usr/klibc/arch/arm/aeabi_nonsense.S
new file mode 100644
index 0000000..c69eb11
--- /dev/null
+++ b/usr/klibc/arch/arm/aeabi_nonsense.S
@@ -0,0 +1,9 @@
+ .text
+ .globl __aeabi_unwind_cpp_pr0
+__aeabi_unwind_cpp_pr0:
+ .globl __aeabi_unwind_cpp_pr1
+__aeabi_unwind_cpp_pr1:
+ .globl __aeabi_unwind_cpp_pr2
+__aeabi_unwind_cpp_pr2:
+ .globl __aeabi_unwind_cpp_pr3
+__aeabi_unwind_cpp_pr3: