]> code.ossystems Code Review - openembedded-core.git/commitdiff
binutils: allow distro to select gold as default linker
authorPhil Blundell <pb@pbcl.net>
Mon, 27 Jun 2011 15:51:16 +0000 (16:51 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 Jun 2011 21:40:31 +0000 (22:40 +0100)
But ensure that gcc-cross-intermediate always uses ld.bfd since
(e)glibc won't build with gold.

Signed-off-by: Phil Blundell <philb@gnu.org>
meta/recipes-devtools/binutils/binutils-cross.inc
meta/recipes-devtools/gcc/gcc-cross-intermediate.inc

index 4b909720de2ec4ce7197097044a317dfa4b1705b..5a41970ce22d7c49bfb6bc0f5d65f58639fc4d21 100644 (file)
@@ -5,7 +5,8 @@ EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
                 --program-prefix=${TARGET_PREFIX} \
                 --disable-install-libbfd \
                 --disable-werror \
-                --enable-poison-system-directories"
+                --enable-poison-system-directories \
+               ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default', '', d)}"
 
 do_install () {
        oe_runmake 'DESTDIR=${D}' install
index 92c3ce20594df8d8d5901f3fae37dc25ac0a431f..05b5dbc089a4fb7b8534de07c1488495ba0154fa 100644 (file)
@@ -7,6 +7,10 @@ CROSS_TARGET_SYS_DIR_append = ".${PN}"
 
 # This is intended to be a -very- basic config
 # sysroot is needed in case we use libc-initial
+#
+# Glibc won't compile with gold, and building glibc is the whole point of
+# this recipe.   So we select ld.bfd explicitly here if gold is the distro's 
+# preferred linker.
 EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
                --enable-shared \
                --disable-multilib \
@@ -17,7 +21,8 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
                --with-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
                --with-build-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
                ${EXTRA_OECONF_INTERMEDIATE} \
-               ${@get_gcc_fpu_setting(bb, d)}"
+               ${@get_gcc_fpu_setting(bb, d)} \
+               ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)}"
 
 do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST} ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}"
 do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST} ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}"