Skip to contentSkip to conversation

toolchain-external-custom: allow specifying relative path to binaries

PATCH Superseded Calin Crisan 2 participants 4 messages Mar 23, 2018 – Mar 25, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain-external-custom: allow specifying relative path to binaries

There are cases where a downloaded toolchain doesn't have its binaries placed directly in a "bin" subfolder (where BuildRoot currently looks for them).

A common example is the official Raspberry Pi Toolchain
(https://github.com/raspberrypi/tools), which has its binaries in "arm-bcm2708/arm-linux-gnueabihf/bin".

This commit introduces BR2_TOOLCHAIN_EXTERNAL_BIN_PATH that defaults to "bin" and can be changed as needed.

---
 toolchain/toolchain-external/pkg-toolchain-external.mk            | 2 +-
 .../toolchain-external-custom/Config.in.options                   | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -1
index 3bf9fac412..4dfe3815ae 100644
@@ -77,7 +77,7 @@ ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
 TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
 endif
 else
-TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin
+TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_BIN_PATH))
 endif
 
 # If this is a buildroot toolchain, it already has a wrapper which we want to
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +8 -0
index 70c7d8e3c3..bb199aab85 100644
@@ -12,6 +12,14 @@ config BR2_TOOLCHAIN_EXTERNAL_URL
 	help
 	  URL of the custom toolchain tarball to download and install.
 
+config BR2_TOOLCHAIN_EXTERNAL_BIN_PATH
+    string "Toolchain bin path"
+    default "bin"
+    depends on BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+    help
+      Path to where the binaries (e.g. the compiler) can be found,
+      relative to the downloaded toolchain root directory.
+
 config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
 	string "Toolchain prefix"
 	default "$(ARCH)-linux"
Signature · 1 line
2.16.2
#1 lore raw

PATCH 1/1 toolchain-external-custom: allow specifying relative path to binaries

Calin, All,

On 2018-03-23 23:40 +0200, Calin Crisan spake thusly:

Quoted 35 lines

There are cases where a downloaded toolchain doesn't have its binaries placed directly in a "bin" subfolder (where BuildRoot currently looks for them).

A common example is the official Raspberry Pi Toolchain
(https://github.com/raspberrypi/tools), which has its binaries in "arm-bcm2708/arm-linux-gnueabihf/bin".

This commit introduces BR2_TOOLCHAIN_EXTERNAL_BIN_PATH that defaults to "bin" and can be changed as needed.

---
 toolchain/toolchain-external/pkg-toolchain-external.mk            | 2 +-
 .../toolchain-external-custom/Config.in.options                   | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -1
index 3bf9fac412..4dfe3815ae 100644
@@ -77,7 +77,7 @@ ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
 TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))
 endif
 else
-TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin
+TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_BIN_PATH))
 endif
 
 # If this is a buildroot toolchain, it already has a wrapper which we want to
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +0 -0
index 70c7d8e3c3..bb199aab85 100644

toolchain/toolchain-external/toolchain-external-custom/Config.in.options config BR2_TOOLCHAIN_EXTERNAL_URL · line 21

Quoted 10 lines
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +7 -0
@@ -12,6 +12,14 @@ config BR2_TOOLCHAIN_EXTERNAL_URL
 	help
 	  URL of the custom toolchain tarball to download and install.
 
+config BR2_TOOLCHAIN_EXTERNAL_BIN_PATH
+    string "Toolchain bin path"
+    default "bin"
+    depends on BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+    help
+      Path to where the binaries (e.g. the compiler) can be found,
+      relative to the downloaded toolchain root directory.

Indentation is incorrect: it should be a leading TAB for option, and a leading TAB and two spaces for the help text.

See:
https://buildroot.org/downloads/manual/manual.html#writing-rules-config-in

Otherwise, looks sensible to me...

Regards,
Yann E. MORIN.

Quoted 10 lines
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +0 -0
 config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
 	string "Toolchain prefix"
 	default "$(ARCH)-linux"
Signature · 6 lines
2.16.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 toolchain-external-custom: allow specifying relative path to binaries

Yann, I have posted a v2 that fixes this and another issue with supported external toolchains. Please let me know if there's anything else that needs to be addressed.

Thanks,

Calin.

Quoted 94 lines · On Sun, Mar 25, 2018, 11:35 Yann E. MORIN <[email protected]> wrote:

Calin, All,

On 2018-03-23 23:40 +0200, Calin Crisan spake thusly:

Quoted 8 lines

There are cases where a downloaded toolchain doesn't have its binaries placed directly in a "bin" subfolder (where BuildRoot currently looks for them).

A common example is the official Raspberry Pi Toolchain
(https://github.com/raspberrypi/tools), which has its binaries in "arm-bcm2708/arm-linux-gnueabihf/bin".

Quoted 6 lines

This commit introduces BR2_TOOLCHAIN_EXTERNAL_BIN_PATH that defaults to "bin" and can be changed as needed.

---
 toolchain/toolchain-external/pkg-toolchain-external.mk            | 2
+-
>  .../toolchain-external-custom/Config.in.options                   | 8

++++++++

Review

Quoted 3 lines
 2 files changed, 9 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/toolchain/toolchain-external/pkg-toolchain-external.mk

toolchain/toolchain-external/pkg-toolchain-external.mk ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),) · line 77

Quoted 5 lines

index 3bf9fac412..4dfe3815ae 100644

toolchain/toolchain-external/pkg-toolchain-external.mk +0 -0
@@ -77,7 +77,7 @@ ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
 TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which

$(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))

toolchain/toolchain-external/pkg-toolchain-external.mk ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)

Quoted 4 lines
toolchain/toolchain-external/pkg-toolchain-external.mk +1 -1
 endif
 else
-TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin
+TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/$(call

qstrip,$(BR2_TOOLCHAIN_EXTERNAL_BIN_PATH))

toolchain/toolchain-external/pkg-toolchain-external.mk ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),) · line 83

Quoted 3 lines
toolchain/toolchain-external/pkg-toolchain-external.mk +0 -0
 endif
 
 # If this is a buildroot toolchain, it already has a wrapper which we

want to

Quoted 1 line

diff --git

a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options

Quoted 2 lines

index 70c7d8e3c3..bb199aab85 100644
---

a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options

Quoted 1 line

+++

b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options

toolchain/toolchain-external/pkg-toolchain-external.mk config BR2_TOOLCHAIN_EXTERNAL_URL · line 21

Quoted 11 lines
toolchain/toolchain-external/pkg-toolchain-external.mk +7 -0
@@ -12,6 +12,14 @@ config BR2_TOOLCHAIN_EXTERNAL_URL
      help
        URL of the custom toolchain tarball to download and install.
 
+config BR2_TOOLCHAIN_EXTERNAL_BIN_PATH
+    string "Toolchain bin path"
+    default "bin"
+    depends on BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+    help
+      Path to where the binaries (e.g. the compiler) can be found,
+      relative to the downloaded toolchain root directory.

Indentation is incorrect: it should be a leading TAB for option, and a leading TAB and two spaces for the help text.

See:

https://buildroot.org/downloads/manual/manual.html#writing-rules-config-in

Otherwise, looks sensible to me...

Regards,
Yann E. MORIN.

Quoted 10 lines
toolchain/toolchain-external/pkg-toolchain-external.mk +0 -1
 config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
      string "Toolchain prefix"
      default "$(ARCH)-linux"
--

2.16.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--

.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
     |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is
no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
 conspiracy.  |
Quoted 2 lines

'------------------------------^-------^------------------^--------------------'

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180325/f80f60e4/attachment.html>

#3 lore raw

PATCH 1/1 toolchain-external-custom: allow specifying relative path to binaries

Calin, All,

On 2018-03-25 08:46 +0000, Calin Crisan spake thusly:

Quoted 2 lines

Yann, I have posted a v2 that fixes this and another issue with supported external toolchains. Please let me know if there's anything else that needs to be addressed.

Ah, I had missed your v2. Sorry. Lemme review that now, then.

Regards,
Yann E. MORIN.

Quoted 100 lines

Thanks,
Calin.
On Sun, Mar 25, 2018, 11:35 Yann E. MORIN < [1][email protected]> wrote:

Calin, All,

On 2018-03-23 23:40 +0200, Calin Crisan spake thusly:

Quoted 8 lines

There are cases where a downloaded toolchain doesn't have its binaries placed directly in a "bin" subfolder (where BuildRoot currently looks for them).

A common example is the official Raspberry Pi Toolchain
( [2]https://github.com/raspberrypi/tools), which has its binaries in "arm-bcm2708/arm-linux-gnueabihf/bin".

Quoted 7 lines

This commit introduces BR2_TOOLCHAIN_EXTERNAL_BIN_PATH that defaults to "bin" and can be changed as needed.

---
? toolchain/toolchain-external/ [4]pkg-toolchain-external.mk? ? ? ? ? ? | 2 +- ? .../toolchain-external-custom/Config.in.options? ? ? ? ? ? ? ? ? ?| 8

++++++++

toolchain/toolchain-external/

Quoted 3 lines

? 2 files changed, 9 insertions(+), 1 deletion(-)

toolchain/toolchain-external/ renamed from toolchain/toolchain-external/ [5]pkg-toolchain-external.mk +0 -0

[6]pkg-toolchain-external.mk

Quoted 11 lines

index 3bf9fac412..4dfe3815ae 100644

toolchain/toolchain-external/ [8]pkg-toolchain-external.mk renamed from toolchain/toolchain-external/ [7]pkg-toolchain-external.mk +0 -0
@@ -77,7 +77,7 @@ ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),)
 ? TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc))

? endif
? else

toolchain/toolchain-external/ [8]pkg-toolchain-external.mk renamed from toolchain/toolchain-external/ [7]pkg-toolchain-external.mk +1 -1
-TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin
+TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_BIN_PATH))

? endif

Review

Quoted 2 lines

? # If this is a buildroot toolchain, it already has a wrapper which we want to

(quoted diff) +0 -0

b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options

Quoted 7 lines

index 70c7d8e3c3..bb199aab85 100644

toolchain/toolchain-external/toolchain-external-custom/Config.in.options +0 -0
@@ -12,6 +12,14 @@ config BR2_TOOLCHAIN_EXTERNAL_URL

? ? ? ?help
? ? ? ? ?URL of the custom toolchain tarball to download and install.

Quoted 7 lines

+config BR2_TOOLCHAIN_EXTERNAL_BIN_PATH
+? ? string "Toolchain bin path"
+? ? default "bin"
+? ? depends on BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD
+? ? help
+? ? ? Path to where the binaries (e.g. the compiler) can be found, +? ? ? relative to the downloaded toolchain root directory.

Indentation is incorrect: it should be a leading TAB for option, and a leading TAB and two spaces for the help text.

See:
? ? [9]https://buildroot.org/downloads/manual/manual.html#writing-rules-config-in

Otherwise, looks sensible to me...

Regards,
Yann E. MORIN.

Quoted 10 lines

? config BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX
? ? ? ?string "Toolchain prefix"
? ? ? ?default "$(ARCH)-linux"
--
2.16.2

_______________________________________________
buildroot mailing list
[10]buildroot at busybox.net [11]http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

  |? Yann E. MORIN? | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
  | +33 662 376 056 | Software? Designer | \ / CAMPAIGN? ? ?|? ___? ? ? ? ? ?
  ? ?|
  | +33 223 225 172 `------------.-------:? X? AGAINST? ? ? |? \e/? There is no? |
  | [12]http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL? ? |? ?v? ?conspiracy.? |

'------------------------------^-------^------------------^--------------------'

Links:
1. mailto:yann.morin.1998 at free.fr
2. https://github.com/raspberrypi/tools
3. mailto:ccrisan at gmail.com
4. http://pkg-toolchain-external.mk
5. http://pkg-toolchain-external.mk
6. http://pkg-toolchain-external.mk
7. http://pkg-toolchain-external.mk
8. http://pkg-toolchain-external.mk
9. https://buildroot.org/downloads/manual/manual.html#writing-rules-config-in
10. mailto:buildroot at busybox.net
11. http://lists.busybox.net/mailman/listinfo/buildroot
12. http://ymorin.is-a-geek.org/

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'