Browse Source

fix uclibc compile for qemu-arm (experimental fix), use DODEBUG as default

Waldemar Brodkorb 10 years ago
parent
commit
f5f34fe0e1

+ 1 - 1
target/arm/Makefile

@@ -23,7 +23,7 @@ ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VERSATILEPB),y)
 QEMU_ARGS+=-M versatilepb -net user -net nic,model=smc91c111
 endif
 ifeq ($(ADK_TARGET_QEMU_ARM_MODEL_VEXPRESS_A9),y)
-QEMU_ARGS+=vexpress-a9 -cpu cortex-a9 -net user -net nic,model=lan9118
+QEMU_ARGS+=-M vexpress-a9 -cpu cortex-a9 -net user -net nic,model=lan9118
 endif
 ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
 QEMU_ARGS+=-drive file=qemu-${CPU_ARCH}.img,if=virtio,index=0 -net nic,model=virtio -net user

+ 1 - 2
target/arm/uclibc.config

@@ -244,8 +244,7 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+DODEBUG=y
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 1 - 4
target/linux/config/Config.in.ethernet

@@ -200,13 +200,10 @@ config ADK_KERNEL_E1000
 	select ADK_KERNEL_NETDEV_1000
 	depends on ADK_TARGET_WITH_PCI || ADK_TARGET_QEMU
 	default y if ADK_TARGET_SYSTEM_IBM_X40
-	default y if ADK_TARGET_SYSTEM_QEMU_I486
-	default y if ADK_TARGET_SYSTEM_QEMU_I686
+	default y if ADK_TARGET_SYSTEM_QEMU_X86
 	default y if ADK_TARGET_SYSTEM_QEMU_X86_64
 	default y if ADK_TARGET_SYSTEM_QEMU_MIPS
-	default y if ADK_TARGET_SYSTEM_QEMU_MIPSEL
 	default y if ADK_TARGET_SYSTEM_QEMU_MIPS64
-	default y if ADK_TARGET_SYSTEM_QEMU_MIPS64EL
 	default n
 	help
 	  Intel(R) PRO/1000 gigabit ethernet driver

+ 1 - 0
target/mips/systems/qemu-mips

@@ -2,6 +2,7 @@ config ADK_TARGET_SYSTEM_QEMU_MIPS
 	bool "Qemu Emulator"
 	select ADK_mips
 	select ADK_qemu_mips
+	select ADK_CPU_MIPS32
 	select ADK_TARGET_QEMU
 	select ADK_TARGET_KERNEL_VMLINUZ
 	help

+ 2 - 2
target/mips/uclibc.config

@@ -250,8 +250,8 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+DODEBUG=y
+# DOSTRIP is not set
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 2 - 2
target/mips64/uclibc.config

@@ -250,8 +250,8 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+DODEBUG=y
+# DOSTRIP is not set
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 2 - 2
target/ppc/uclibc.config

@@ -242,8 +242,8 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+DODEBUG=y
+# DOSTRIP is not set
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 2 - 2
target/sh/uclibc.config

@@ -243,8 +243,8 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+DODEBUG=y
+# DOSTRIP is not set
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 2 - 2
target/sparc/uclibc.config

@@ -243,8 +243,8 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+DODEBUG=y
+# DOSTRIP is not set
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 2 - 2
target/x86/uclibc.config

@@ -246,8 +246,8 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+# DOSTRIP is not set
+DODEBUG=y
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 2 - 2
target/x86_64/uclibc.config

@@ -241,8 +241,8 @@ UCLIBC_BUILD_NOEXECSTACK=y
 #
 CROSS_COMPILER_PREFIX=""
 UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-DOSTRIP=y
+DODEBUG=y
+# DOSTRIP is not set
 # DOASSERTS is not set
 # SUPPORT_LD_DEBUG is not set
 # SUPPORT_LD_DEBUG_EARLY is not set

+ 1 - 6
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)

+ 122 - 0
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)