[oe-commits] Khem Raj : gcc-4.4.4.inc: Fix ppc issues of requiring libgcc at link time when using -Os

git version control git at git.openembedded.org
Sat May 15 03:42:05 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 5203790c015a01b4ea3a1c0a75726773fb31a639
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=5203790c015a01b4ea3a1c0a75726773fb31a639

Author: Khem Raj <raj.khem at gmail.com>
Date:   Fri May 14 20:38:40 2010 -0700

gcc-4.4.4.inc: Fix ppc issues of requiring libgcc at link time when using -Os

* This change converts libgcc_s.so to a linker script so when -lgcc_s is
  used then it actually links to a group of libraries and one of those
  libraries is libgcc. This fixes the problem of requiring to link with
  libgcc _always_ on ppc to get the out-of-line epilogue/prologue
  functions.

Signed-off-by: Khem Raj <raj.khem at gmail.com>

---

 recipes/gcc/gcc-4.4.4.inc                          |    3 +-
 .../gcc/gcc-4.4.4/gcc-add-t-slibgcc-libgcc.patch   |  126 ++++++++++++++++++++
 2 files changed, 128 insertions(+), 1 deletions(-)

diff --git a/recipes/gcc/gcc-4.4.4.inc b/recipes/gcc/gcc-4.4.4.inc
index da8e27e..de91611 100644
--- a/recipes/gcc/gcc-4.4.4.inc
+++ b/recipes/gcc/gcc-4.4.4.inc
@@ -8,7 +8,7 @@ LICENSE = "GPLv3"
 DEPENDS = "mpfr gmp"
 NATIVEDEPS = "mpfr-native gmp-native"
 
-INC_PR = "r0"
+INC_PR = "r1"
 
 FILESPATHPKG .= ":gcc-$PV"
 
@@ -25,6 +25,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2;name=gcc444tarbz2 \
 	file://gcc-ppc_add_d_constraint.patch;patch=1 \
 	file://gcc-pr41175.patch;patch=1 \
 	file://gcc-armv4-pass-fix-v4bx-to-ld.patch;patch=1 \
+	file://gcc-add-t-slibgcc-libgcc.patch;patch=1 \
 	"
 SRC_URI[gcc444tarbz2.md5sum] = "7ff5ce9e5f0b088ab48720bbd7203530"
 SRC_URI[gcc444tarbz2.sha256sum] = "e1c13696b45752ad3f652304fab5120a43a8a5c0f438d3bda78cf16b620c0c58"
diff --git a/recipes/gcc/gcc-4.4.4/gcc-add-t-slibgcc-libgcc.patch b/recipes/gcc/gcc-4.4.4/gcc-add-t-slibgcc-libgcc.patch
new file mode 100644
index 0000000..337bd92
--- /dev/null
+++ b/recipes/gcc/gcc-4.4.4/gcc-add-t-slibgcc-libgcc.patch
@@ -0,0 +1,126 @@
+This is a backport of commit revision 151568 from trunk into 4.4
+the changes for config/t-slibgcc-elf-ver are already available in 4.4
+so they dont reflect in the patch as they are mentioned in the changelog
+message. 
+
+This patch converts the libgcc_s.so to a linker script stub which should
+let static libgcc link in on affected architectures they should include
+t-slibgcc-libgcc in there tmake_file variable. For OE its ppc for now
+which has this problem when using libtool and -Os flag.
+
+-Khem
+
+2009-09-09  Jakub Jelinek  <jakub at redhat.com>
+
+	* config/t-slibgcc-elf-ver (SHLIB_MAKE_SOLINK, SHLIB_INSTALL_SOLINK):
+	New variables.
+	(SHLIB_LINK, SHLIB_INSTALL): Use them.
+	* config/t-slibgcc-libgcc: New file.
+	* config.gcc (powerpc*-*-linux*, powerpc*-*-gnu*): Use it.
+
+Index: gcc-4.4.4/gcc/config.gcc
+===================================================================
+--- gcc-4.4.4.orig/gcc/config.gcc	2010-02-17 20:24:04.000000000 -0800
++++ gcc-4.4.4/gcc/config.gcc	2010-05-14 13:57:33.701847829 -0700
+@@ -1745,12 +1745,12 @@ powerpc64-*-linux*)
+ 		tm_file="rs6000/secureplt.h ${tm_file}"
+ 	fi
+ 	extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
+-	tmake_file="t-dfprules rs6000/t-fprules ${tmake_file} rs6000/t-ppccomm rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp"
++	tmake_file="t-dfprules rs6000/t-fprules ${tmake_file} rs6000/t-ppccomm rs6000/t-linux64 t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp"
+ 	;;
+ powerpc64-*-gnu*)
+ 	tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h rs6000/gnu.h"
+ 	extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
+-	tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-gnu rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp"
++	tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-slibgcc-libgcc t-gnu rs6000/t-linux64 rs6000/t-fprules-softfp soft-fp/t-softfp"
+ 	;;
+ powerpc-*-darwin*)
+ 	extra_options="${extra_options} rs6000/darwin.opt"
+@@ -1827,17 +1827,17 @@ powerpc-*-rtems*)
+ powerpc-*-linux*altivec*)
+ 	tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h"
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+-	tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
++	tmake_file="rs6000/t-fprules t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+ 	;;
+ powerpc-*-linux*spe*)
+ 	tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h rs6000/e500.h"
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+-	tmake_file="t-dfprules rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
++	tmake_file="t-dfprules rs6000/t-fprules t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+ 	;;
+ powerpc-*-linux*paired*)
+         tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/750cl.h"
+         extra_options="${extra_options} rs6000/sysv4.opt"
+-        tmake_file="rs6000/t-fprules rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
++        tmake_file="rs6000/t-fprules t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+         ;;
+ powerpc-*-linux*)
+ 	tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
+@@ -1856,7 +1856,7 @@ powerpc-*-linux*)
+ 		tm_file="${tm_file} rs6000/linux.h"
+ 		;;
+ 	esac
+-	tmake_file="${tmake_file} rs6000/t-fprules-softfp soft-fp/t-softfp"
++	tmake_file="${tmake_file} t-slibgcc-libgcc rs6000/t-fprules-softfp soft-fp/t-softfp"
+ 	if test x${enable_secureplt} = xyes; then
+ 		tm_file="rs6000/secureplt.h ${tm_file}"
+ 	fi
+@@ -1864,14 +1864,14 @@ powerpc-*-linux*)
+ powerpc-*-gnu-gnualtivec*)
+ 	tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h"
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+-	tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm"
++	tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-slibgcc-libgcc t-gnu rs6000/t-ppccomm"
+ 	if test x$enable_threads = xyes; then
+ 		thread_file='posix'
+ 	fi
+ 	;;
+ powerpc-*-gnu*)
+ 	tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/gnu.h"
+-	tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm"
++	tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcos t-slibgcc-elf-ver t-slibgcc-libgcc t-gnu rs6000/t-ppccomm"
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+ 	if test x$enable_threads = xyes; then
+ 		thread_file='posix'
+Index: gcc-4.4.4/gcc/config/t-slibgcc-libgcc
+===================================================================
+--- gcc-4.4.4.orig/gcc/config/t-slibgcc-libgcc	2010-01-04 07:13:08.000000000 -0800
++++ gcc-4.4.4/gcc/config/t-slibgcc-libgcc	2010-05-14 13:44:41.339352736 -0700
+@@ -30,3 +30,35 @@ SHLIB_MAKE_SOLINK = \
+ SHLIB_INSTALL_SOLINK = \
+ 	$(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SOLINK) \
+ 	  $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
++# Copyright (C) 2009 Free Software Foundation, Inc.
++#
++# This file is part of GCC.
++#
++# GCC is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++#
++# GCC is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with GCC; see the file COPYING3.  If not see
++# <http://www.gnu.org/licenses/>.
++
++# Instead of creating $(SHLIB_SOLINK) symlink create a GNU ld
++# linker script which sources in both $(SHLIB_SONAME) and libgcc.a.
++# This is needed on targets where libgcc.a contains routines that aren't in
++# $(SHLIB_SONAME) and are needed for shared libraries.
++
++SHLIB_MAKE_SOLINK = \
++	(echo "/* GNU ld script"; \
++	 echo "   Use the shared library, but some functions are only in"; \
++	 echo "   the static library.  */"; \
++	 echo "GROUP ( $(SHLIB_SONAME) libgcc.a )" \
++	) > $(SHLIB_DIR)/$(SHLIB_SOLINK)
++SHLIB_INSTALL_SOLINK = \
++	$(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SOLINK) \
++	  $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)





More information about the Openembedded-commits mailing list