binutils/binutils: add blind option to force use of ld.bfd during build
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Apr 05 01:02:28 2011 +0200 (2011-04-05)
changeset 2376369664fd7cba
parent 2375 1752ade7dc52
child 2377 32c08de1d54f
binutils/binutils: add blind option to force use of ld.bfd during build

gold is not capable of building glibc/eglibc, so we have to
force using the BFD linker, ld.bfd.

Offer a blind option that affected components can select to
force use of the BFD linker during the build.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/binutils/binutils.in
scripts/build/binutils/binutils.sh
     1.1 --- a/config/binutils/binutils.in	Tue Apr 05 23:34:16 2011 +0200
     1.2 +++ b/config/binutils/binutils.in	Tue Apr 05 01:02:28 2011 +0200
     1.3 @@ -80,6 +80,12 @@
     1.4  config ARCH_x86
     1.5      select BINUTILS_GOLD_SUPPORTS_ARCH
     1.6  
     1.7 +# Force using the BFD linker if needed
     1.8 +# This is the case for some C libraries (eg. glibc and
     1.9 +# eglibc at least) and affected components can select this
    1.10 +config BINUTILS_FORCE_LD_BFD
    1.11 +    bool
    1.12 +
    1.13  choice
    1.14      bool
    1.15      prompt "Linkers to enable"
    1.16 @@ -95,6 +101,7 @@
    1.17      prompt "gold"
    1.18      depends on BINUTILS_HAS_GOLD
    1.19      depends on BINUTILS_GOLD_SUPPORTS_ARCH
    1.20 +    depends on ! BINUTILS_FORCE_LD_BFD
    1.21      depends on EXPERIMENTAL
    1.22      select BINUTILS_GOLD_INSTALLED
    1.23      help
    1.24 @@ -125,6 +132,7 @@
    1.25      depends on EXPERIMENTAL
    1.26      select BINUTILS_GOLD_INSTALLED
    1.27      select BINUTILS_LINKER_BOTH
    1.28 +    select BINUTILS_LD_WRAPPER if BINUTILS_FORCE_LD_BFD
    1.29      help
    1.30        Both the historical ld and the new gold linkers will be
    1.31        installed, with gold being the default linker used.
     2.1 --- a/scripts/build/binutils/binutils.sh	Tue Apr 05 23:34:16 2011 +0200
     2.2 +++ b/scripts/build/binutils/binutils.sh	Tue Apr 05 01:02:28 2011 +0200
     2.3 @@ -96,6 +96,11 @@
     2.4          chmod +x "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ld"
     2.5          cp -a "${CT_PREFIX_DIR}/bin/${CT_TARGET}-ld"    \
     2.6                "${CT_PREFIX_DIR}/${CT_TARGET}/bin/ld"
     2.7 +
     2.8 +        # If needed, force using ld.bfd during the toolchain build
     2.9 +        if [ "${CT_BINUTILS_FORCE_LD_BFD}" = "y" ]; then
    2.10 +            export CTNG_LD_IS=bfd
    2.11 +        fi
    2.12      fi
    2.13  
    2.14      # Make those new tools available to the core C compilers to come.