gcc_4.5.1: add DSO linking change patch

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>
This commit is contained in:
Nitin A Kamble 2011-01-06 10:13:05 -08:00 committed by Richard Purdie
parent b46ce7cacd
commit 95fc6ae164
10 changed files with 61 additions and 8 deletions

View 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 \

View File

@ -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__ \

View 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"

View File

@ -1,5 +1,5 @@
require gcc-cross_${PV}.bb
require gcc-cross-initial.inc
PR = "r1"
PR = "r2"

View File

@ -1,4 +1,4 @@
require gcc-cross_${PV}.bb
require gcc-cross-intermediate.inc
PR = "r1"
PR = "r2"

View File

@ -1,4 +1,4 @@
PR = "r1"
PR = "r2"
require gcc-${PV}.inc
require gcc-cross4.inc

View File

@ -1,4 +1,4 @@
require gcc-cross-initial_${PV}.bb
require gcc-crosssdk-initial.inc
PR = "r1"
PR = "r2"

View File

@ -1,4 +1,4 @@
require gcc-cross-intermediate_${PV}.bb
require gcc-crosssdk-intermediate.inc
PR = "r1"
PR = "r2"

View File

@ -1,4 +1,4 @@
require gcc-cross_${PV}.bb
require gcc-crosssdk.inc
PR = "r1"
PR = "r2"

View File

@ -1,4 +1,4 @@
PR = "r1"
PR = "r2"
require gcc-${PV}.inc
require gcc-configure-target.inc
require gcc-package-target.inc