]> code.ossystems Code Review - openembedded-core.git/commitdiff
gcc_4.5.1: add DSO linking change patch
authorNitin A Kamble <nitin.a.kamble@intel.com>
Thu, 6 Jan 2011 18:13:05 +0000 (10:13 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 20 Jan 2011 21:37:02 +0000 (21:37 +0000)
This patch changes gcc's (ld's) linking behavior. It passes
--no-add-needed flag to ld. Because of it ld does not try to find
related libraries for linking, causing link failures. And these
link failures can be fixed by specifying the library to be linked
explicitely on the gcc command line.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
meta/recipes-devtools/gcc/gcc-4.5.1.inc
meta/recipes-devtools/gcc/gcc-4.5.1/fedora/gcc45-no-add-needed.patch [new file with mode: 0644]
meta/recipes-devtools/gcc/gcc-cross-canadian_4.5.1.bb
meta/recipes-devtools/gcc/gcc-cross-initial_4.5.1.bb
meta/recipes-devtools/gcc/gcc-cross-intermediate_4.5.1.bb
meta/recipes-devtools/gcc/gcc-cross_4.5.1.bb
meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.5.1.bb
meta/recipes-devtools/gcc/gcc-crosssdk-intermediate_4.5.1.bb
meta/recipes-devtools/gcc/gcc-crosssdk_4.5.1.bb
meta/recipes-devtools/gcc/gcc_4.5.1.bb

index 1786d8a8e1bfe16c2555b3448cb9642556233f48..6c600c1896edb465f717944830e56f21985f73be 100644 (file)
@@ -30,6 +30,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
            file://fedora/gcc43-rh341221.patch;striplevel=0 \
            file://fedora/gcc43-java-debug-iface-type.patch;striplevel=0 \
            file://fedora/gcc43-i386-libgomp.patch;striplevel=0 \
+           file://fedora/gcc45-no-add-needed.patch;striplevel=0 \
            file://103-uclibc-conf-noupstream.patch  \
            file://200-uclibc-locale.patch  \
            file://203-uclibc-locale-no__x.patch;striplevel=1 \
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.1/fedora/gcc45-no-add-needed.patch b/meta/recipes-devtools/gcc/gcc-4.5.1/fedora/gcc45-no-add-needed.patch
new file mode 100644 (file)
index 0000000..23704d3
--- /dev/null
@@ -0,0 +1,52 @@
+2010-02-08  Roland McGrath  <roland@redhat.com>
+
+       * config/rs6000/sysv4.h (LINK_EH_SPEC): Pass --no-add-needed to the
+       linker.
+       * config/linux.h (LINK_EH_SPEC): Likewise.
+       * config/alpha/elf.h (LINK_EH_SPEC): Likewise.
+       * config/ia64/linux.h (LINK_EH_SPEC): Likewise.
+
+--- gcc/config/alpha/elf.h.~1~
++++ gcc/config/alpha/elf.h
+@@ -421,7 +421,7 @@ extern int alpha_this_gpdisp_sequence_nu
+    I imagine that other systems will catch up.  In the meantime, it
+    doesn't harm to make sure that the data exists to be used later.  */
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} "
+ #endif
+ /* A C statement (sans semicolon) to output to the stdio stream STREAM
+--- gcc/config/ia64/linux.h.~1~
++++ gcc/config/ia64/linux.h
+@@ -58,7 +58,7 @@ do {                                         \
+    Signalize that because we have fde-glibc, we don't need all C shared libs
+    linked against -lgcc_s.  */
+ #undef LINK_EH_SPEC
+-#define LINK_EH_SPEC ""
++#define LINK_EH_SPEC "--no-add-needed "
+ #define MD_UNWIND_SUPPORT "config/ia64/linux-unwind.h"
+--- gcc/config/linux.h.~1~
++++ gcc/config/linux.h
+@@ -89,7 +89,7 @@ see the files COPYING3 and COPYING.RUNTI
+     } while (0)
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} "
+ #endif
+ /* Define this so we can compile MS code for use with WINE.  */
+--- gcc/config/rs6000/sysv4.h.~1~
++++ gcc/config/rs6000/sysv4.h
+@@ -917,7 +917,7 @@ SVR4_ASM_SPEC \
+   %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}}}"
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# define LINK_EH_SPEC "--no-add-needed %{!static:--eh-frame-hdr} "
+ #endif
+ #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
index 37c64fb4eee5d3c34498f39b3e3bc74308a44428..3eea4bcafede92b9382266010de75b307c338d2c 100644 (file)
@@ -5,7 +5,7 @@ require gcc-cross-canadian.inc
 require gcc-configure-sdk.inc
 require gcc-package-sdk.inc
 
-PR = "r2"
+PR = "r3"
 
 DEPENDS += "gmp-nativesdk mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
 RDEPENDS_${PN} += "mpfr-nativesdk libmpc-nativesdk elfutils-nativesdk"
index a121782233966259840b0d1e1bb1f1abf87af982..b2c257d9d40e4e731f5655b672ef4fe41c650dde 100644 (file)
@@ -1,5 +1,5 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-initial.inc
 
-PR = "r1"
+PR = "r2"
 
index 7aaa5b051285ba196e02a7044fee2096c4da6fc6..10681dad4b5d0961405ef999dd3f73b9b3c52d11 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-cross-intermediate.inc
-PR = "r1"
+PR = "r2"
 
index b7e43285b204da8e13d752c125c48388fece46a4..399cdf9296406fa2b9fdc50c36dee6924974bd59 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r1"
+PR = "r2"
 
 require gcc-${PV}.inc
 require gcc-cross4.inc
index 0fc5faab3e8e0be8fb56b09ea301acb4edc177f3..240caf56f78be399232b9c66d13f6a0302401cdb 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-initial_${PV}.bb
 require gcc-crosssdk-initial.inc
 
-PR = "r1"
+PR = "r2"
index 4260c358adff68838fb9ac48ea78d2e1e842d3f0..a6653ddfcc0f8c2fee3d907352f8211e78e235f8 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross-intermediate_${PV}.bb
 require gcc-crosssdk-intermediate.inc
 
-PR = "r1"
+PR = "r2"
index a23a66258aa75a6537966bdc82ce919aa2a2fb9f..129e8d31a4b9c0c8a0d43d02cfdf81f7fd5f6bb2 100644 (file)
@@ -1,4 +1,4 @@
 require gcc-cross_${PV}.bb
 require gcc-crosssdk.inc
 
-PR = "r1"
+PR = "r2"
index a21772ff5d49a8bd8fe5b83e8ab256b2108ed17d..919d4b09383ed1c61476421dc7ba8738d8dd7d2f 100644 (file)
@@ -1,4 +1,4 @@
-PR = "r1"
+PR = "r2"
 require gcc-${PV}.inc
 require gcc-configure-target.inc
 require gcc-package-target.inc