* [Buildroot] [PATCH] toolchain-external: download: add <CROSS>-cc symlink if not present
@ 2018-12-17 8:19 Peter Korsgaard
2018-12-17 9:11 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2018-12-17 8:19 UTC (permalink / raw)
To: buildroot
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] toolchain-external: download: add <CROSS>-cc symlink if not present
2018-12-17 8:19 [Buildroot] [PATCH] toolchain-external: download: add <CROSS>-cc symlink if not present Peter Korsgaard
@ 2018-12-17 9:11 ` Thomas Petazzoni
2018-12-17 9:58 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2018-12-17 9:11 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 17 Dec 2018 09:19:34 +0100, Peter Korsgaard wrote:
> 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.
This is not great, as it doesn't fix the problem in all cases.
What about doing this *after* the toolchain has been installed in
$(HOST_DIR), where we have write access ?
I.E:
output/host/bin (master)$ ls -l
total 108
lrwxrwxrwx 1 thomas thomas 104 Dec 17 10:09 arm-linux-gnueabihf-addr2line -> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-addr2line
lrwxrwxrwx 1 thomas thomas 97 Dec 17 10:09 arm-linux-gnueabihf-ar -> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-ar
lrwxrwxrwx 1 thomas thomas 97 Dec 17 10:09 arm-linux-gnueabihf-as -> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-as
lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-c++ -> toolchain-wrapper
lrwxrwxrwx 1 thomas thomas 102 Dec 17 10:09 arm-linux-gnueabihf-c++filt -> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-c++filt
lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-cpp -> toolchain-wrapper
lrwxrwxrwx 1 thomas thomas 102 Dec 17 10:09 arm-linux-gnueabihf-elfedit -> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-elfedit
lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-g++ -> toolchain-wrapper
lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-gcc -> toolchain-wrapper
lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-gcc-8.2.1 -> toolchain-wrapper
lrwxrwxrwx 1 thomas thomas 101 Dec 17 10:09 arm-linux-gnueabihf-gcc-ar -> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-gcc-ar
Add a -cc -> toolchain-wrapper symlink ?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] toolchain-external: download: add <CROSS>-cc symlink if not present
2018-12-17 9:11 ` Thomas Petazzoni
@ 2018-12-17 9:58 ` Peter Korsgaard
0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-12-17 9:58 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
Hi,
> Hello,
> On Mon, 17 Dec 2018 09:19:34 +0100, Peter Korsgaard wrote:
>> 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.
> This is not great, as it doesn't fix the problem in all cases.
Correct, but I don't really see how?
> What about doing this *after* the toolchain has been installed in
> $(HOST_DIR), where we have write access ?
But we do not copy a pre-installed toolchain? We only setup symlinks.
> I.E:
> output/host/bin (master)$ ls -l
> total 108
> lrwxrwxrwx 1 thomas thomas 104 Dec 17 10:09
> arm-linux-gnueabihf-addr2line ->
> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-addr2line
> lrwxrwxrwx 1 thomas thomas 97 Dec 17 10:09 arm-linux-gnueabihf-ar ->
> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-ar
> lrwxrwxrwx 1 thomas thomas 97 Dec 17 10:09 arm-linux-gnueabihf-as ->
> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-as
> lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-c++ -> toolchain-wrapper
> lrwxrwxrwx 1 thomas thomas 102 Dec 17 10:09
> arm-linux-gnueabihf-c++filt ->
> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-c++filt
> lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-cpp -> toolchain-wrapper
> lrwxrwxrwx 1 thomas thomas 102 Dec 17 10:09
> arm-linux-gnueabihf-elfedit ->
> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-elfedit
> lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-g++ -> toolchain-wrapper
> lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-gcc -> toolchain-wrapper
> lrwxrwxrwx 1 thomas thomas 17 Dec 17 10:09 arm-linux-gnueabihf-gcc-8.2.1 -> toolchain-wrapper
> lrwxrwxrwx 1 thomas thomas 101 Dec 17 10:09 arm-linux-gnueabihf-gcc-ar
->
> /home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-gcc-ar
> Add a -cc -> toolchain-wrapper symlink ?
That will not work, as it will then try to execute
/home/thomas/Downloads/gcc-arm-8.2-2018.08-x86_64-arm-linux-gnueabihf//bin/arm-linux-gnueabihf-cc
(which does not exist)
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-17 9:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17 8:19 [Buildroot] [PATCH] toolchain-external: download: add <CROSS>-cc symlink if not present Peter Korsgaard
2018-12-17 9:11 ` Thomas Petazzoni
2018-12-17 9:58 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.