From f5f34fe0e16239f40270b1babb002e8aec3d3fed Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 24 May 2014 13:16:10 +0200 Subject: fix uclibc compile for qemu-arm (experimental fix), use DODEBUG as default --- toolchain/uclibc/Makefile | 7 +- .../patches/xxx-remove-duplicate-symbols-arm.patch | 122 +++++++++++++++++++++ 2 files changed, 123 insertions(+), 6 deletions(-) create mode 100644 toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch (limited to 'toolchain') diff --git a/toolchain/uclibc/Makefile b/toolchain/uclibc/Makefile index 90399ae39..7184d6220 100644 --- a/toolchain/uclibc/Makefile +++ b/toolchain/uclibc/Makefile @@ -104,11 +104,6 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers touch $@ $(WRKBUILD)/.fixup: - # DOSTRIP kills x86 target (ld.so can not map libc.so.0), always use DODEBUG - # DODEBUG compile failure linking with libgcc_eh.a on arm hf -ifneq ($(ADK_LINUX_ARM),y) - $(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config -endif $(MAKE) -C $(WRKBUILD) \ PREFIX=$(STAGING_TARGET_DIR) \ DEVEL_PREFIX=/usr/ \ @@ -116,9 +111,9 @@ endif RUNTIME_PREFIX=/ \ CPU_CFLAGS="$(TARGET_CFLAGS)" \ all install_runtime +ifeq ($(ADK_TARGET_TOOLCHAIN),y) # cleanup toolchain -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete -ifeq ($(ADK_TARGET_TOOLCHAIN),y) # strip target libs and host tools for toolchain builds PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \ $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME) diff --git a/toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch b/toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch new file mode 100644 index 000000000..69f338f6e --- /dev/null +++ b/toolchain/uclibc/patches/xxx-remove-duplicate-symbols-arm.patch @@ -0,0 +1,122 @@ +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) -- cgit v1.2.3