diff mbox series

[v1,09/30] package/Makefile.in: Provide TARGET_CROSS without path and trailing -

Message ID 20191205171517.96639-10-michael.drake@codethink.co.uk
State Rejected
Headers show
Series Add Chromium Embedded Framework library | expand

Commit Message

Michael Drake Dec. 5, 2019, 5:14 p.m. UTC
The LLVM/Clang toolchain takes the target triple as a `--target=`
argument, rather than having separate binaries with different
names for each target.

This change exposes just the triple as TARGET_CROSS_TRIPLE.

Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
---
 package/Makefile.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Romain Naour Feb. 29, 2020, 7:03 p.m. UTC | #1
Hi Michael,

Le 05/12/2019 à 18:14, Michael Drake a écrit :
> The LLVM/Clang toolchain takes the target triple as a `--target=`
> argument, rather than having separate binaries with different
> names for each target.
> 
> This change exposes just the triple as TARGET_CROSS_TRIPLE.
> 
> Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
> ---
>  package/Makefile.in | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 47808292b0..273e9de5d9 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -192,11 +192,13 @@ TARGET_CXXFLAGS += -mid-shared-library -mshared-library-id=0
>  endif
>  
>  ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
> -TARGET_CROSS = $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-
> +TARGET_CROSS_TRIPLE = $(GNU_TARGET_NAME)

GNU_TARGET_NAME is used all over the place in Buildroot. Adding
TARGET_CROSS_TRIPLE would require in the manual [1] to clarify the use of one or
the other.

[1] docs/manual/adding-packages-generic.txt

>  else
> -TARGET_CROSS = $(HOST_DIR)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
> +TARGET_CROSS_TRIPLE = $(TOOLCHAIN_EXTERNAL_PREFIX)
>  endif
>  
> +TARGET_CROSS = $(HOST_DIR)/bin/$(TARGET_CROSS_TRIPLE)-

TOOLCHAIN_EXTERNAL_PREFIX can be used in a package, see [2] as example.

[2] https://git.buildroot.net/buildroot/tree/package/wine/wine.mk?h=2020.02-rc2#n39

> +
>  # Define TARGET_xx variables for all common binutils/gcc
>  TARGET_AR       = $(TARGET_CROSS)ar
>  TARGET_AS       = $(TARGET_CROSS)as
>
diff mbox series

Patch

diff --git a/package/Makefile.in b/package/Makefile.in
index 47808292b0..273e9de5d9 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -192,11 +192,13 @@  TARGET_CXXFLAGS += -mid-shared-library -mshared-library-id=0
 endif
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
-TARGET_CROSS = $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-
+TARGET_CROSS_TRIPLE = $(GNU_TARGET_NAME)
 else
-TARGET_CROSS = $(HOST_DIR)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
+TARGET_CROSS_TRIPLE = $(TOOLCHAIN_EXTERNAL_PREFIX)
 endif
 
+TARGET_CROSS = $(HOST_DIR)/bin/$(TARGET_CROSS_TRIPLE)-
+
 # Define TARGET_xx variables for all common binutils/gcc
 TARGET_AR       = $(TARGET_CROSS)ar
 TARGET_AS       = $(TARGET_CROSS)as