diff mbox

[1/1,V4] toolchain: control vendor part in GNU_TARGET_NAME

Message ID 884EA965490E3C4D8E66AEF41E980250096191@ezex10.ezchip.com
State Superseded
Headers show

Commit Message

Noam Camus March 6, 2014, 11:25 a.m. UTC
This option allows to customize the "vendor" part of the toolchain tuple, where the toolchain tuple has the form <arch>-<vendor>-<os>-<libc>. Use this option in situations where gcc might make different decisions based on the vendor part of the tuple.

Signed-off-by: Noam Camus <noamc@ezchip.com>
---
 package/Makefile.in                     |   17 ++++++++++++++++-
 toolchain/toolchain-buildroot/Config.in |   16 ++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)

--
1.7.1

Comments

Yann E. MORIN March 6, 2014, 11:17 p.m. UTC | #1
Noam, All,

On 2014-03-06 11:25 +0000, Noam Camus spake thusly:
> This option allows to customize the "vendor" part of the toolchain tuple, where the toolchain tuple has the form <arch>-<vendor>-<os>-<libc>. Use this option in situations where gcc might make different decisions based on the vendor part of the tuple.

Overly-long line, please wrap at <80 chars.

(Or maybe your mailer is broken?)

> Signed-off-by: Noam Camus <noamc@ezchip.com>
> ---
>  package/Makefile.in                     |   17 ++++++++++++++++-
>  toolchain/toolchain-buildroot/Config.in |   16 ++++++++++++++++
>  2 files changed, 32 insertions(+), 1 deletions(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in index 454f614..bd9f18c 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -20,8 +20,23 @@ endif
>  MAKE1:=$(HOSTMAKE) -j1
>  MAKE:=$(HOSTMAKE) $(if $(PARALLEL_JOBS),-j$(PARALLEL_JOBS))
>  
> +ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
> +TARGET_VENDOR = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_VENDOR))
> +else
> +TARGET_VENDOR = buildroot
> +endif
> +
> +# Sanity checks
> +ifeq ($(TARGET_VENDOR),)
> +$(error BR2_TOOLCHAIN_BUILDROOT_VENDOR is not allowed to be empty) 
> +endif ifeq ($(TARGET_VENDOR),unknown) $(error 
> +BR2_TOOLCHAIN_BUILDROOT_VENDOR cannot be 'unknown'. \
> +        It might be confused with the native toolchain) endif

Highly broken.

Regards,
Yann E. MORIN.
diff mbox

Patch

diff --git a/package/Makefile.in b/package/Makefile.in index 454f614..bd9f18c 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -20,8 +20,23 @@  endif
 MAKE1:=$(HOSTMAKE) -j1
 MAKE:=$(HOSTMAKE) $(if $(PARALLEL_JOBS),-j$(PARALLEL_JOBS))
 
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
+TARGET_VENDOR = $(call qstrip,$(BR2_TOOLCHAIN_BUILDROOT_VENDOR))
+else
+TARGET_VENDOR = buildroot
+endif
+
+# Sanity checks
+ifeq ($(TARGET_VENDOR),)
+$(error BR2_TOOLCHAIN_BUILDROOT_VENDOR is not allowed to be empty) 
+endif ifeq ($(TARGET_VENDOR),unknown) $(error 
+BR2_TOOLCHAIN_BUILDROOT_VENDOR cannot be 'unknown'. \
+        It might be confused with the native toolchain) endif
+
 # Compute GNU_TARGET_NAME
-GNU_TARGET_NAME=$(ARCH)-buildroot-$(TARGET_OS)-$(LIBC)$(ABI)
+GNU_TARGET_NAME=$(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
 
 # Blackfin FLAT needs uclinux
 ifeq ($(BR2_bfin)$(BR2_BINFMT_FLAT),yy)
diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
index 07db50b..3487327 100644
--- a/toolchain/toolchain-buildroot/Config.in
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -70,6 +70,22 @@  config BR2_TOOLCHAIN_BUILDROOT_LIBC
 	default "glibc"  if BR2_TOOLCHAIN_BUILDROOT_EGLIBC
 	default "glibc"  if BR2_TOOLCHAIN_BUILDROOT_GLIBC
 
+config BR2_TOOLCHAIN_BUILDROOT_VENDOR
+	string "custom toolchain vendor name"
+	default "buildroot"
+	help
+	  This option allows to customize the "vendor" part of the
+	  toolchain tuple, where the toolchain tuple has the form
+	  <arch>-<vendor>-<os>-<libc>. The default value, "buildroot",
+	  is fine for most cases, except in very specific situations
+	  where gcc might make different decisions based on the vendor
+	  part of the tuple. The value "unknown" is not allowed, as the
+	  cross-compiling toolchain might then be confused with the
+	  native toolchain when the target and host architecture are
+	  identical.
+
+	  If you're not sure, just leave the default "buildroot" value.
+
 source "package/uclibc/Config.in"
 source "package/glibc/Config.in"
 source "package/binutils/Config.in.host"