Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] toolchain-external: download: add <CROSS>-cc symlink if not present
Date: Mon, 17 Dec 2018 09:19:34 +0100	[thread overview]
Message-ID: <20181217081934.24807-1-peter@korsgaard.com> (raw)

Fixes:
http://autobuild.buildroot.net/results/dbb/dbb3c4634d5fc726ca0b27c2dac0befbbab70912
http://autobuild.buildroot.net/results/dbb/dbb69acadc20b4bb559311348eca276c1e6343f7

Some external toolchains do not have a <CROSS>-cc binary/symlink, which is
used by some packages.  As a workaround, add a symlink to <CROSS>-gcc.

Notice that we can only do this for external toolchains we download
ourselves, and not pre-installed ones as we might not have write access to
them.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index db3570d96f..753a6c5207 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -106,6 +106,16 @@ define TOOLCHAIN_EXTERNAL_MOVE
 	mkdir -p $(TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR)
 	mv $(@D)/* $(TOOLCHAIN_EXTERNAL_DOWNLOAD_INSTALL_DIR)/
 endef
+
+# Some external toolchains do not have a <CROSS>-cc binary/symlink,
+# which is used by some packages. As a workaround, add a (relative)
+# symlink to <CROSS>-gcc
+define TOOLCHAIN_EXTERNAL_ADD_CC_SYMLINK
+	if [ ! -e $(TOOLCHAIN_EXTERNAL_CROSS)cc ]; then \
+		ln -s $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc $(TOOLCHAIN_EXTERNAL_CROSS)cc; \
+	fi
+endef
+
 endif
 
 #
@@ -515,7 +525,8 @@ ifeq ($$(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
 $(2)_EXCLUDES = usr/lib/locale/*
 
 $(2)_POST_EXTRACT_HOOKS += \
-	TOOLCHAIN_EXTERNAL_MOVE
+	TOOLCHAIN_EXTERNAL_MOVE \
+	TOOLCHAIN_EXTERNAL_ADD_CC_SYMLINK
 endif
 
 # Checks for an already installed toolchain: check the toolchain
-- 
2.11.0

             reply	other threads:[~2018-12-17  8:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17  8:19 Peter Korsgaard [this message]
2018-12-17  9:11 ` [Buildroot] [PATCH] toolchain-external: download: add <CROSS>-cc symlink if not present Thomas Petazzoni
2018-12-17  9:58   ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181217081934.24807-1-peter@korsgaard.com \
    --to=peter@korsgaard.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox