patches/gcc/4.3.1/190-libstdc++-pic.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Sep 09 00:02:01 2009 +0200 (2009-09-09)
changeset 1525 4647e6fb994a
parent 746 b150d6f590fc
permissions -rw-r--r--
gcc: add patch to fix EABI for armv4t

As pointed out by Martin GUY, gcc incorrectly generates armv5t
instrcutions for EABI, even for cores that are an armv4t.
The new patch (for the 4.3 series) fixes the problem by downgrading
the default CPU for EABI to being an armv4t core.
     1 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/gentoo/54_all_300-libstdc++-pic.patch
     2 install libstdc++_pic.a if we have pic objs
     3 
     4 diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am gcc-4.3.1/libstdc++-v3/src/Makefile.am
     5 --- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.am	2008-02-29 19:26:50.000000000 +0100
     6 +++ gcc-4.3.1/libstdc++-v3/src/Makefile.am	2008-06-10 14:58:09.000000000 +0200
     7 @@ -289,6 +289,13 @@
     8  	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
     9  
    10  
    11 +install-exec-local:
    12 +	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
    13 +	if [ x"$$pic_objs" != x ]; then \
    14 +		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
    15 +		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
    16 +	fi
    17 +
    18  # Added bits to build debug library.
    19  if GLIBCXX_BUILD_DEBUG
    20  all-local: build_debug
    21 diff -durN gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in gcc-4.3.1/libstdc++-v3/src/Makefile.in
    22 --- gcc-4.3.1.orig/libstdc++-v3/src/Makefile.in	2008-02-29 19:26:50.000000000 +0100
    23 +++ gcc-4.3.1/libstdc++-v3/src/Makefile.in	2008-06-10 14:58:09.000000000 +0200
    24 @@ -693,7 +693,7 @@
    25  
    26  install-data-am: install-data-local
    27  
    28 -install-exec-am: install-toolexeclibLTLIBRARIES
    29 +install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
    30  
    31  install-info: install-info-am
    32  
    33 @@ -732,7 +732,7 @@
    34  	maintainer-clean-generic mostlyclean mostlyclean-compile \
    35  	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
    36  	tags uninstall uninstall-am uninstall-info-am \
    37 -	uninstall-toolexeclibLTLIBRARIES
    38 +	uninstall-toolexeclibLTLIBRARIES install-exec-local
    39  
    40  
    41  # Symbol versioning for shared libraries.
    42 @@ -858,6 +858,14 @@
    43  install_debug:
    44  	(cd ${debugdir} && $(MAKE) \
    45  	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
    46 +
    47 +install-exec-local:
    48 +	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
    49 +	if [ x"$$pic_objs" != x ]; then \
    50 +		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
    51 +		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
    52 +	fi
    53 +
    54  # Tell versions [3.59,3.63) of GNU make to not export all variables.
    55  # Otherwise a system limit (for SysV at least) may be exceeded.
    56  .NOEXPORT: