From e2075d4a78ea86c0d929d6d4062774faa2fb9482 Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Wed, 1 May 2013 15:21:28 -0700 Subject: [PATCH] tcmode-external-sourcery: create ld.bfd toolchain symlink Now that KERNEL_LD uses ld.bfd, we need to ensure that it exists when using an external toolchain. Signed-off-by: Christopher Larson --- .../include/tcmode-external-sourcery.inc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/conf/distro/include/tcmode-external-sourcery.inc b/conf/distro/include/tcmode-external-sourcery.inc index b86d2d8..059f7b8 100644 --- a/conf/distro/include/tcmode-external-sourcery.inc +++ b/conf/distro/include/tcmode-external-sourcery.inc @@ -4,10 +4,6 @@ EXTERNAL_TOOLCHAIN ?= "UNDEFINED" -TOOLCHAIN_PATH_ADD = "" -TOOLCHAIN_PATH_ADD_class-target = "${EXTERNAL_TOOLCHAIN}/bin:" -PATH =. "${TOOLCHAIN_PATH_ADD}" - # Don't ship any toolchain binaries in the sdk for the time being TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host meta-environment-${TRANSLATED_TARGET_ARCH}" @@ -117,9 +113,7 @@ python toolchain_metadata_setup () { if not os.path.exists(external_toolchain): bb.fatal("Error: EXTERNAL_TOOLCHAIN path '%s' does not exist" % external_toolchain) - if os.path.exists(bb.data.expand('${EXTERNAL_TOOLCHAIN}/bin/gcc', l)): - d.setVar('TOOLCHAIN_PATH_ADD_class-target', '') - populate_toolchain_links(l) + populate_toolchain_links(l) # The external toolchain may not have been built with the yocto preferred # gnu hash setting, so ensure that the corresponding sanity check is a @@ -154,6 +148,17 @@ def populate_toolchain_links(d): break bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (newpath, exc)) + # Ensure that we have a ld.bfd available, now that KERNEL_LD uses it + ld = d.expand('${TARGET_PREFIX}ld') + ld_bfd = os.path.join(bindir, ld + '.bfd') + if not os.path.exists(ld_bfd): + try: + os.symlink(ld, ld_bfd) + except OSError as exc: + if exc.errno == errno.EEXIST: + break + bb.fatal("Unable to populate toolchain binary symlink for %s: %s" % (ld_bfd, exc)) + require conf/distro/include/csl-versions.inc def get_gcc_version_prefix(d):