patches/glibc/2.9/550-2.9-elf-begin.patch
author Cody Schafer <dev@codyps.com>
Fri May 09 19:13:49 2014 -0700 (2014-05-09)
changeset 3312 4876ff97e039
permissions -rw-r--r--
cc/gcc: allow CC_EXTRA_CONFIG_ARRAY on baremetal

The final bare-metal compiler is built using the core backend.
Currently the core uses the CC_CORE_EXTRA_CONFIG_ARRAY variable.

While this works as supposed to, this can leave the user puzzled
in the menuconfig, since all he can see is the core options, not
the final options.

Only show the core options if any of the core passes are needed,
and use the final options in the core-backend if we're issuing
the bare-metal compiler.

Signed-off-by: Cody P Schafer <dev@codyps.com>
[yann.morin.1998@free.fr: hide core options if no core pass needed;
use final option in core backend if issuing the bare-metal compiler]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <22181e546ba746202489.1399688067@localhost>
Patchwork-Id: 347586
yann@1327
     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
yann@1327
     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
yann@1327
     3
[ALL  ]    /local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/librtld.os: In function `_dl_start_final':
yann@1327
     4
[ALL  ]    rtld.c:(.text+0x2fe): undefined reference to `_begin'
yann@1327
     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
yann@1327
     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
yann@1327
     7
[ALL  ]    collect2: ld returned 1 exit status
yann@1327
     8
[ERROR]    make[3]: *** [/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc/elf/ld.so] Error 1
yann@1327
     9
[ALL  ]    make[3]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/src/glibc-2.9/elf'
yann@1327
    10
[ERROR]    make[2]: *** [elf/subdir_lib] Error 2
yann@1327
    11
[ALL  ]    make[2]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/src/glibc-2.9'
yann@1327
    12
[ERROR]    make[1]: *** [all] Error 2
yann@1327
    13
[ALL  ]    make[1]: Leaving directory `/local/nyet-build/crosstool-ng-svn/targets/powerpc-860-linux-gnu/build/build-libc'
yann@1327
    14
[ERROR]    Build failed in step 'Installing C library'
yann@1327
    15
[ERROR]    Error happened in '/local/nyet-build/crosstool-ng-svn/scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
yann@1327
    16
[ERROR]          called from '/local/nyet-build/crosstool-ng-svn/scripts/build/libc/glibc.sh' at line # 504 in function 'do_libc'
yann@1327
    17
[ERROR]          called from '/local/nyet-build/crosstool-ng-svn/scripts/crosstool-NG.sh' at line # 478 in function 'main'
yann@1327
    18
yann@1327
    19
--- glibc-2.9_orig/elf/Makefile	2009-03-26 20:26:42.000000000 -0700
yann@1327
    20
+++ glibc-2.9/elf/Makefile	2009-03-26 20:14:11.000000000 -0700
yann@1327
    21
@@ -304,7 +304,7 @@
yann@1327
    22
 		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
yann@1327
    23
 		  LC_ALL=C \
yann@1327
    24
 		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
yann@1327
    25
-		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
yann@1327
    26
+		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
yann@1327
    27
 		  > $@.lds
yann@1327
    28
 	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
yann@1327
    29
 		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\