patches/glibc/2.9/550-2.9-elf-begin.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:06:16 2011 +0200 (2011-05-19)
changeset 2461 ec30b191f0e3
permissions -rw-r--r--
complibs/ppl: build only C and C++ interfaces for PPL

By default, PPL wants to build interfaces for any of a variety of
langauges it finds on the local host (python, java, possibly perl, also
more esoteric languages such as ocaml and prolog).

These extra interfaces can double the compile time for the library. For
single-process builds, I found a savings of more than 40%:

default / j1: 716s total, 143.2s avg, 0.52s stdev
just_c / j1: 406s total, 81.2s avg, 0.33s stdev
just_c_cpp / j1: 413s total, 82.6s avg, 0.22s stdev

And for multi-process builds, it approached 50%:

default / j4: 625s total, 125.0s avg, 0.57s stdev
just_c / j4: 338s total, 67.6s avg, 1.25s stdev
just_c_cpp / j4: 327s total, 65.4s avg, 0.36s stdev

Since the PPL we build within ct-ng is only used by GCC, we only need to
build the C and C++ interfaces.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
     1 [ALL  ]    powerpc-860-linux-gnu-gcc       -nostdlib -nostartfiles -shared                        -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs -Wl,--verbose 2>&1 |                    LC_ALL=C                sed -e '/^=========/,/^=========/!d;/^=========/d'                          -e 's/. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/'              > /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so.lds
     2 [ALL  ]    powerpc-860-linux-gnu-gcc       -nostdlib -nostartfiles -shared -o /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so                                         -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs                         /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/librtld.os -Wl,--version-script=/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/ld.map                                  -Wl,-soname=ld.so.1 -T /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so.lds
     3 [ALL  ]    /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/librtld.os: In function `_dl_start_final':
     4 [ALL  ]    rtld.c:(.text+0x2fe): undefined reference to `_begin'
     5 [ALL  ]    /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/gcc-core-shared/lib/gcc/powerpc-860-linux-gnu/4.3.3/../../../../powerpc-860-linux-gnu/bin/ld: /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so: hidden symbol `_begin' isn't defined
     6 [ALL  ]    /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/gcc-core-shared/lib/gcc/powerpc-860-linux-gnu/4.3.3/../../../../powerpc-860-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
     7 [ALL  ]    collect2: ld returned 1 exit status
     8 [ERROR]    make[3]: *** [/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so] Error 1
     9 [ALL  ]    make[3]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/src/glibc-2.9/elf'
    10 [ERROR]    make[2]: *** [elf/subdir_lib] Error 2
    11 [ALL  ]    make[2]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/src/glibc-2.9'
    12 [ERROR]    make[1]: *** [all] Error 2
    13 [ALL  ]    make[1]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc'
    14 [ERROR]    Build failed in step 'Installing C library'
    15 [ERROR]    Error happened in '/local/nyet-build/crosstool-ng-svn/scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
    16 [ERROR]          called from '/local/nyet-build/crosstool-ng-svn/scripts/build/libc/glibc.sh' at line # 504 in function 'do_libc'
    17 [ERROR]          called from '/local/nyet-build/crosstool-ng-svn/scripts/crosstool-NG.sh' at line # 478 in function 'main'
    18 
    19 --- glibc-2.9_orig/elf/Makefile	2009-03-26 20:26:42.000000000 -0700
    20 +++ glibc-2.9/elf/Makefile	2009-03-26 20:14:11.000000000 -0700
    21 @@ -304,7 +304,7 @@
    22  		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
    23  		  LC_ALL=C \
    24  		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
    25 -		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
    26 +		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
    27  		  > $@.lds
    28  	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
    29  		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\