diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-28 21:51:24 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2014-06-28 21:52:30 +0200 |
commit | 7d9f958d550ee7ac394794738eaa35086a64545d (patch) | |
tree | c92855ba8ae7c86d89cd0d5d8d83acdd0755e86d /toolchain/uclibc/patches | |
parent | dcd6c2ef08fc808fbb99fcc1ba326505b612360e (diff) |
enable shared libgcc for uClibc/glibc
unfortunately uClibc/glibc uses dlopen to access exception
handling code from libgcc_s.so.1. Pure static build is only
provided by musl.
Diffstat (limited to 'toolchain/uclibc/patches')
-rw-r--r-- | toolchain/uclibc/patches/xxx-disable-gcc_eh.patch | 14 | ||||
-rw-r--r-- | toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch | 122 |
2 files changed, 14 insertions, 122 deletions
diff --git a/toolchain/uclibc/patches/xxx-disable-gcc_eh.patch b/toolchain/uclibc/patches/xxx-disable-gcc_eh.patch new file mode 100644 index 000000000..a7f1a2db8 --- /dev/null +++ b/toolchain/uclibc/patches/xxx-disable-gcc_eh.patch @@ -0,0 +1,14 @@ +diff -Nur uClibc-0.9.33.2.orig/Rules.mak uClibc-0.9.33.2/Rules.mak +--- uClibc-0.9.33.2.orig/Rules.mak 2014-06-28 12:12:25.000000000 +0200 ++++ uClibc-0.9.33.2/Rules.mak 2014-06-28 12:14:15.000000000 +0200 +@@ -819,10 +819,7 @@ + LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y) + $(eval $(call cache-output-var,LIBGCC,$(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name)) + $(eval $(call cache-output-var,LIBGCC_EH,$(CC) $(LIBGCC_CFLAGS) -print-file-name=libgcc_eh.a)) +-# with -O0 we (e.g. lockf) might end up with references to +-# _Unwind_Resume, so pull in gcc_eh in this case.. + LIBGCC_DIR:=$(dir $(LIBGCC)) +-LIBGCC += $(if $(DODEBUG),$(LIBGCC_EH)) + + # moved from libpthread/linuxthreads + ifeq ($(UCLIBC_CTOR_DTOR),y) diff --git a/toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch b/toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch deleted file mode 100644 index 69f338f6e..000000000 --- a/toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch +++ /dev/null @@ -1,122 +0,0 @@ -diff -Nur uClibc-0.9.33.2.orig/libc/sysdeps/linux/arm/Makefile.arch uClibc-0.9.33.2/libc/sysdeps/linux/arm/Makefile.arch ---- uClibc-0.9.33.2.orig/libc/sysdeps/linux/arm/Makefile.arch 2014-05-23 15:42:33.000000000 +0200 -+++ uClibc-0.9.33.2/libc/sysdeps/linux/arm/Makefile.arch 2014-05-23 15:53:57.000000000 +0200 -@@ -40,5 +40,4 @@ - aeabi_lcsts.os \ - aeabi_math.os \ - aeabi_sighandlers.os \ -- aeabi_unwind_cpp_pr1.o \ - ) -diff -Nur uClibc-0.9.33.2.orig/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c uClibc-0.9.33.2/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c ---- uClibc-0.9.33.2.orig/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c 2014-05-23 15:42:33.000000000 +0200 -+++ uClibc-0.9.33.2/libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c 2014-05-23 20:40:14.000000000 +0200 -@@ -97,6 +97,7 @@ - } - } - -+/* - void - _Unwind_Resume (struct _Unwind_Exception *exc) - { -@@ -107,6 +108,7 @@ - PTR_DEMANGLE (resume); - resume (exc); - } -+*/ - - _Unwind_Reason_Code - __gcc_personality_v0 (int version, _Unwind_Action actions, -@@ -129,6 +131,7 @@ - return personality (version, actions, exception_class, ue_header, context); - } - -+/* - _Unwind_Reason_Code - _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, - void *stop_argument) -@@ -153,3 +156,4 @@ - PTR_DEMANGLE (getcfa); - return getcfa (context); - } -+*/ -diff -Nur uClibc-0.9.33.2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c ---- uClibc-0.9.33.2.orig/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c 2014-05-23 15:42:33.000000000 +0200 -+++ uClibc-0.9.33.2/libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c 2014-05-23 21:08:02.000000000 +0200 -@@ -47,62 +47,6 @@ - libgcc_s_resume = resume; - libgcc_s_personality = personality; - } --#ifdef __thumb__ --void --_Unwind_Resume (struct _Unwind_Exception *exc) --{ -- if (__builtin_expect (libgcc_s_resume == NULL, 0)) -- init (); -- libgcc_s_resume (exc); --} --#else --/* It's vitally important that _Unwind_Resume not have a stack frame; the -- ARM unwinder relies on register state at entrance. So we write this in -- assembly. */ -- --__asm__ ( --" .globl _Unwind_Resume\n" --" .type _Unwind_Resume, %function\n" --"_Unwind_Resume:\n" --" " CFI_SECTIONS (.debug_frame) "\n" --" " CFI_STARTPROC "\n" --" stmfd sp!, {r4, r5, r6, lr}\n" --" " CFI_ADJUST_CFA_OFFSET (16)" \n" --" " CFI_REL_OFFSET (r4, 0) "\n" --" " CFI_REL_OFFSET (r5, 4) "\n" --" " CFI_REL_OFFSET (r6, 8) "\n" --" " CFI_REL_OFFSET (lr, 12) "\n" --" " CFI_REMEMBER_STATE "\n" --" ldr r4, 1f\n" --" ldr r5, 2f\n" --"3: add r4, pc, r4\n" --" ldr r3, [r4, r5]\n" --" mov r6, r0\n" --" cmp r3, #0\n" --" beq 4f\n" --"5: mov r0, r6\n" --" ldmfd sp!, {r4, r5, r6, lr}\n" --" " CFI_ADJUST_CFA_OFFSET (-16) "\n" --" " CFI_RESTORE (r4) "\n" --" " CFI_RESTORE (r5) "\n" --" " CFI_RESTORE (r6) "\n" --" " CFI_RESTORE (lr) "\n" --" bx r3\n" --" " CFI_RESTORE_STATE "\n" --"4: bl init\n" --" ldr r3, [r4, r5]\n" --" b 5b\n" --" " CFI_ENDPROC "\n" --" .align 2\n" --#ifdef __thumb2__ --"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 4\n" --#else --"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - 8\n" --#endif --"2: .word libgcc_s_resume(GOTOFF)\n" --" .size _Unwind_Resume, .-_Unwind_Resume\n" --); --#endif - - _Unwind_Reason_Code - __gcc_personality_v0 (_Unwind_State state, -diff -Nur uClibc-0.9.33.2.orig/Rules.mak uClibc-0.9.33.2/Rules.mak ---- uClibc-0.9.33.2.orig/Rules.mak 2014-05-23 15:42:33.000000000 +0200 -+++ uClibc-0.9.33.2/Rules.mak 2014-05-23 20:13:43.000000000 +0200 -@@ -818,11 +818,7 @@ - - LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y) - $(eval $(call cache-output-var,LIBGCC,$(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name)) --$(eval $(call cache-output-var,LIBGCC_EH,$(CC) $(LIBGCC_CFLAGS) -print-file-name=libgcc_eh.a)) --# with -O0 we (e.g. lockf) might end up with references to --# _Unwind_Resume, so pull in gcc_eh in this case.. - LIBGCC_DIR:=$(dir $(LIBGCC)) --LIBGCC += $(if $(DODEBUG),$(LIBGCC_EH)) - - # moved from libpthread/linuxthreads - ifeq ($(UCLIBC_CTOR_DTOR),y) |