Skip to contentSkip to conversation

toolchain: control vendor part in GNU_TARGET_NAME

PATCH Superseded Noam Camus 2 participants 2 messages Mar 7, 2014 1 message not in the archive

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Noam Camus

author
#1 lore raw

PATCH v5 1/1 toolchain: control vendor part in GNU_TARGET_NAME

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.

---
 package/Makefile.in                     |   17 ++++++++++++++++-
 toolchain/toolchain-buildroot/Config.in |   16 ++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)
package/Makefile.in +16 -1
index 454f614..bd9f18c 100644
@@ -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)
toolchain/toolchain-buildroot/Config.in +16 -0
index 07db50b..3487327 100644
@@ -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"

--
1.7.1

#2 lore raw

PATCH v5 1/1 toolchain: control vendor part in GNU_TARGET_NAME

Noam, All,

On 2014-03-07 01:32 +0000, Noam Camus spake thusly:

Quoted 46 lines

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.

---
 package/Makefile.in                     |   17 ++++++++++++++++-
 toolchain/toolchain-buildroot/Config.in |   16 ++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)
package/Makefile.in +16 -1
index 454f614..bd9f18c 100644
@@ -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)
toolchain/toolchain-buildroot/Config.in +0 -0
index 07db50b..3487327 100644

toolchain/toolchain-buildroot/Config.in config BR2_TOOLCHAIN_BUILDROOT_LIBC · line 71

Quoted 2 lines
toolchain/toolchain-buildroot/Config.in +0 -0
@@ -70,6 +70,22 @@ config BR2_TOOLCHAIN_BUILDROOT_LIBC
        default "glibc"  if BR2_TOOLCHAIN_BUILDROOT_EGLIBC
        default "glibc"  if BR2_TOOLCHAIN_BUILDROOT_GLIBC

Your mailer (or editor?) is mangling the patch: the above are leading tabs in the current source tree, so your patch won't apply, since it has leading spaces instead.

toolchain/toolchain-buildroot/Config.in config BR2_TOOLCHAIN_BUILDROOT_LIBC · line 76

Quoted 4 lines
toolchain/toolchain-buildroot/Config.in +4 -0
+config BR2_TOOLCHAIN_BUILDROOT_VENDOR
+       string "custom toolchain vendor name"
+       default "buildroot"
+       help

This should be a leading tab in front of 'string', 'default' and 'help'

toolchain/toolchain-buildroot/Config.in config BR2_TOOLCHAIN_BUILDROOT_LIBC · line 87

Quoted 11 lines
toolchain/toolchain-buildroot/Config.in +11 -0
+         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.

This should be a leading tab and two spaces in front of the help text.

Regards,
Yann E. MORIN.

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.  |
'------------------------------^-------^------------------^--------------------'