patches/gcc/4.2.1/160-libstdc++-pic.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Wed Dec 14 16:55:22 2011 +0100 (2011-12-14)
branch1.13
changeset 2848 1ff89596dab0
parent 313 2f223aafc7cb
permissions -rw-r--r--
libc/eglibc: fix localedef 2.14 build

The localedef of eglibc 2.14 requires NOT_IN_libc to be defined in order to
compile intl/l10nflist.c.

This is because localedef is built separately from eglibc and uses some parts of
eglibc that don't compile in standalone without this preprocessor definition.

This fixes the following error:

[ALL ] gcc -g -O2 -DNO_SYSCONF -DNO_UNCOMPRESS
-DLOCALE_PATH='"/usr/lib/locale:/usr/share/i18n"'
-DLOCALEDIR='"/usr/lib/locale"' -DLOCALE_ALIAS_PATH='"/usr/share/locale"'
-DCHARMAP_PATH='"/usr/share/i18n/charmaps"'
-DREPERTOIREMAP_PATH='"/usr/share/i18n/repertoiremaps"'
-DLOCSRCDIR='"/usr/share/i18n/locales"' -Iglibc/locale/programs -Iglibc/locale
-I/<snip>/.build/src/eglibc-localedef-2_14/include
-I/<snip>/.build/src/eglibc-localedef-2_14 -I.
-include /<snip>/.build/src/eglibc-localedef-2_14/include/always.h -Wall
-Wno-format -c -o locarchive.o glibc/locale/programs/locarchive.c
[ALL ] glibc/locale/programs/locarchive.c: In function 'enlarge_archive':
[ALL ] glibc/locale/programs/locarchive.c:303:21: warning: variable
'oldlocrectab' set but not used [-Wunused-but-set-variable]
[ALL ] In file included from glibc/locale/programs/locarchive.c:651:0:
[ALL ] glibc/locale/programs/../../intl/l10nflist.c: In function
'_nl_normalize_codeset':
[ERROR] glibc/locale/programs/../../intl/l10nflist.c:342:9: error:
'_nl_C_locobj_ptr' undeclared (first use in this function)
[ALL ] glibc/locale/programs/../../intl/l10nflist.c:342:9: note: each
undeclared identifier is reported only once for each function it appears in
[ALL ] glibc/locale/programs/locarchive.c: In function
'add_locales_to_archive':
[ALL ] glibc/locale/programs/locarchive.c:1450:7: warning: passing argument
1 of '__xpg_basename' discards 'const' qualifier from pointer target type
[enabled by default]
[ALL ] /usr/include/libgen.h:35:14: note: expected 'char *' but argument is
of type 'const char *'
[ERROR] make[1]: *** [locarchive.o] Error 1

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
(transplanted from 4cd9134739b594451794cf61a6e1b137422cdafd)
yann@313
     1
diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am gcc-4.2.1/libstdc++-v3/src/Makefile.am
yann@313
     2
--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.am	2006-07-28 06:57:34.000000000 +0200
yann@313
     3
+++ gcc-4.2.1/libstdc++-v3/src/Makefile.am	2007-08-03 20:32:27.000000000 +0200
yann@313
     4
@@ -257,6 +257,12 @@
yann@313
     5
 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
yann@313
     6
 
yann@313
     7
 
yann@313
     8
+install-exec-local:
yann@313
     9
+ifeq ($(enable_shared),yes)
yann@313
    10
+	$(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
yann@313
    11
+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
yann@313
    12
+endif
yann@313
    13
+
yann@313
    14
 # Added bits to build debug library.
yann@313
    15
 if GLIBCXX_BUILD_DEBUG
yann@313
    16
 all-local: build_debug
yann@313
    17
diff -durN gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in gcc-4.2.1/libstdc++-v3/src/Makefile.in
yann@313
    18
--- gcc-4.2.1.orig/libstdc++-v3/src/Makefile.in	2006-10-16 21:08:22.000000000 +0200
yann@313
    19
+++ gcc-4.2.1/libstdc++-v3/src/Makefile.in	2007-08-03 20:32:27.000000000 +0200
yann@313
    20
@@ -657,7 +657,7 @@
yann@313
    21
 
yann@313
    22
 install-data-am: install-data-local
yann@313
    23
 
yann@313
    24
-install-exec-am: install-toolexeclibLTLIBRARIES
yann@313
    25
+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
yann@313
    26
 
yann@313
    27
 install-info: install-info-am
yann@313
    28
 
yann@313
    29
@@ -690,6 +690,7 @@
yann@313
    30
 	distclean-libtool distclean-tags distdir dvi dvi-am html \
yann@313
    31
 	html-am info info-am install install-am install-data \
yann@313
    32
 	install-data-am install-data-local install-exec \
yann@313
    33
+	install-exec-local \
yann@313
    34
 	install-exec-am install-info install-info-am install-man \
yann@313
    35
 	install-strip install-toolexeclibLTLIBRARIES installcheck \
yann@313
    36
 	installcheck-am installdirs maintainer-clean \
yann@313
    37
@@ -799,6 +800,13 @@
yann@313
    38
 install_debug:
yann@313
    39
 	(cd ${debugdir} && $(MAKE) \
yann@313
    40
 	toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
yann@313
    41
+
yann@313
    42
+install-exec-local:
yann@313
    43
+ifeq ($(enable_shared),yes)
yann@313
    44
+	$(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
yann@313
    45
+	$(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
yann@313
    46
+endif
yann@313
    47
+
yann@313
    48
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
yann@313
    49
 # Otherwise a system limit (for SysV at least) may be exceeded.
yann@313
    50
 .NOEXPORT: