patches/gcc/4.4.4/240-libstdc++-pic.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 12 23:38:18 2010 +0200 (2010-09-12)
changeset 2120 48de021b3a9e
child 2148 ada9128c98b8
permissions -rw-r--r--
arch/mips: add experimental mips64 samples

Both toolchains were tested to successfully:
- _build_ busybox, giving respectively an n32 and an n64 binary
although it has not been run-tested.
- build linux-2.6.36-rc3 for Loongson, giving an n64 vmlinux
(which is expected, due to the way the kernel is built),
and the kernel properly boots!

Credits are due to Julien MOUTHINO (julm on freenode#uClibc) for
testing that the kernel boots on his hardware! Cheers! ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 diff -durN gcc-4.4.0.orig/libstdc++-v3/src/Makefile.am gcc-4.4.0/libstdc++-v3/src/Makefile.am
     2 
     3 diff -durN gcc-4.4.4.orig/libstdc++-v3/src/Makefile.am gcc-4.4.4/libstdc++-v3/src/Makefile.am
     4 --- gcc-4.4.4.orig/libstdc++-v3/src/Makefile.am	2009-08-26 21:04:11.000000000 +0200
     5 +++ gcc-4.4.4/libstdc++-v3/src/Makefile.am	2010-05-16 19:13:50.000000000 +0200
     6 @@ -356,6 +356,13 @@
     7  	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
     8  
     9  
    10 +install-exec-local:
    11 +	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
    12 +	if [ x"$$pic_objs" != x ]; then \
    13 +		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
    14 +		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
    15 +	fi
    16 +
    17  # Added bits to build debug library.
    18  if GLIBCXX_BUILD_DEBUG
    19  all-local: build_debug
    20 diff -durN gcc-4.4.4.orig/libstdc++-v3/src/Makefile.in gcc-4.4.4/libstdc++-v3/src/Makefile.in
    21 --- gcc-4.4.4.orig/libstdc++-v3/src/Makefile.in	2009-08-26 21:04:11.000000000 +0200
    22 +++ gcc-4.4.4/libstdc++-v3/src/Makefile.in	2010-05-16 19:13:50.000000000 +0200
    23 @@ -726,7 +726,7 @@
    24  
    25  install-data-am: install-data-local
    26  
    27 -install-exec-am: install-toolexeclibLTLIBRARIES
    28 +install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
    29  
    30  install-info: install-info-am
    31  
    32 @@ -765,7 +765,7 @@
    33  	maintainer-clean-generic mostlyclean mostlyclean-compile \
    34  	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
    35  	tags uninstall uninstall-am uninstall-info-am \
    36 -	uninstall-toolexeclibLTLIBRARIES
    37 +	uninstall-toolexeclibLTLIBRARIES install-exec-local
    38  
    39  
    40  # Symbol versioning for shared libraries.
    41 @@ -947,6 +947,14 @@
    42  install_debug:
    43  	(cd ${debugdir} && $(MAKE) \
    44  	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
    45 +
    46 +install-exec-local:
    47 +	pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
    48 +	if [ x"$$pic_objs" != x ]; then \
    49 +		$(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
    50 +		$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
    51 +	fi
    52 +
    53  # Tell versions [3.59,3.63) of GNU make to not export all variables.
    54  # Otherwise a system limit (for SysV at least) may be exceeded.
    55  .NOEXPORT: