patches/gcc/4.4.6/240-libstdc++-pic.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Wed Jun 08 15:47:43 2011 +0200 (2011-06-08)
changeset 2508 9e2761e59a75
parent 2149 98b7806295cc
permissions -rw-r--r--
debug/cross-gdb: check host dependencies

Cross-gdb depends on expat and python. If either is missing, cross-gdb will
build successfully, but lacking some features.

Especially, if expat is missing, cross-gdb will be unable to parse the target
description, which may lead to runtime malfunctions and the following GDB
warning:
"Can not parse XML target description; XML support was disabled at compile time"

Hence, expat should be considered mandatory.

On the other hand, the features missing without python are not critical, so
python should not be considered mandatory.

This patch does the following:
- At configure time, warn the user if either expat or python is missing.
- In menuconfig, disable the static build options regarding cross-gdb if no
static version of expat is available, and disable cross-gdb if expat is
missing.

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