From b78173f176eeff553e2e941bd06ff032daebc7be Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Mon, 27 Jun 2011 16:51:16 +0100 Subject: binutils: allow distro to select gold as default linker But ensure that gcc-cross-intermediate always uses ld.bfd since (e)glibc won't build with gold. (From OE-Core rev: 207a9013670560d62c793a66f01e19f4760a71a8) Signed-off-by: Phil Blundell Signed-off-by: Richard Purdie --- meta/recipes-devtools/gcc/gcc-cross-intermediate.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'meta/recipes-devtools/gcc') diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc index 92c3ce2059..05b5dbc089 100644 --- a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc +++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc @@ -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}" -- cgit v1.2.3-54-g00ecf