From 150f500426b4bfe1c4b037c40d989a81aa3b6f9c Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 20 Jan 2013 12:58:22 +0000 Subject: [PATCH] arch: allow adding a suffix to the arch-part of a tuple For some architectures, it is legit to have an alternate value in the 'architecture' part of the tuple. For example: armv5te-* armv7a8-* Besides, some packages expect the tuple to reflect the arch variant (eg. openMPI) to detect the variant's capabilities (eg. atomic primitives). This patch adds an option for the user to specify a suffix to be added to the arch-part of the tuple. Signed-off-by: Willy Tarreau Message-ID: <20130120225822.GS6838@1wt.eu> Patch-Id: 213994 [yann.morin.1998@free.fr: make it a suffix, not an override] Signed-off-by: "Yann E. MORIN" --- config/target.in | 15 +++++++++++++++ scripts/build/arch/alpha.sh | 2 +- scripts/build/arch/arm.sh | 2 +- scripts/build/arch/avr32.sh | 3 --- scripts/build/arch/blackfin.sh | 2 +- scripts/build/arch/microblaze.sh | 2 +- scripts/build/arch/mips.sh | 10 +++++----- scripts/build/arch/powerpc.sh | 2 +- scripts/build/arch/s390.sh | 2 +- scripts/build/arch/sh.sh | 2 +- scripts/build/arch/sparc.sh | 2 +- scripts/build/arch/x86.sh | 2 +- scripts/functions | 2 +- 13 files changed, 30 insertions(+), 18 deletions(-) diff --git a/config/target.in b/config/target.in index 6c5e1825..930876f9 100644 --- a/config/target.in +++ b/config/target.in @@ -41,6 +41,21 @@ config TARGET_LDFLAGS source "config.gen/arch.in" +config ARCH_SUFFIX + string + prompt "Suffix to the arch-part" + help + Some architectures have multiple variants and being able to specify + the variant instead of the arch is quite convenient. This is commonly + seen for instance when "armv5tel-" is used as a prefix instead of the + more generic "arm-", or with "alphaev6-" instead of "alpha-". + + Whatever you enter here will be appended to the architecture-part of the + tuple, just before the first '-'. It will override any architecture- + specific suffix that crosstool-NG may compute. + + If you are not sure about what this is, leave it blank. + #-------------------------------------- comment "Generic target options" diff --git a/scripts/build/arch/alpha.sh b/scripts/build/arch/alpha.sh index 7a503350..cf6d40d9 100644 --- a/scripts/build/arch/alpha.sh +++ b/scripts/build/arch/alpha.sh @@ -2,5 +2,5 @@ CT_DoArchTupleValues () { # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_ALPHA_VARIANT}" + CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX:-${CT_ARCH_ALPHA_VARIANT}}" } diff --git a/scripts/build/arch/arm.sh b/scripts/build/arch/arm.sh index 2c9be91e..f111b036 100644 --- a/scripts/build/arch/arm.sh +++ b/scripts/build/arch/arm.sh @@ -2,7 +2,7 @@ CT_DoArchTupleValues() { # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}${target_endian_eb}" + CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX:-${target_endian_eb}}" # The system part of the tuple: case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in diff --git a/scripts/build/arch/avr32.sh b/scripts/build/arch/avr32.sh index 03843a7b..2faf8d86 100644 --- a/scripts/build/arch/avr32.sh +++ b/scripts/build/arch/avr32.sh @@ -1,9 +1,6 @@ # Compute AVR32-specific values CT_DoArchTupleValues() { - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}" - # gcc ./configure flags CT_ARCH_WITH_ARCH= CT_ARCH_WITH_ABI= diff --git a/scripts/build/arch/blackfin.sh b/scripts/build/arch/blackfin.sh index e707617f..768b07ab 100644 --- a/scripts/build/arch/blackfin.sh +++ b/scripts/build/arch/blackfin.sh @@ -2,7 +2,7 @@ CT_DoArchTupleValues() { # The architecture part of the tuple: - CT_TARGET_ARCH="bfin" + CT_TARGET_ARCH="bfin${CT_ARCH_SUFFIX}" # gcc ./configure flags CT_ARCH_WITH_ARCH= diff --git a/scripts/build/arch/microblaze.sh b/scripts/build/arch/microblaze.sh index 2dc810a6..456a6e3a 100644 --- a/scripts/build/arch/microblaze.sh +++ b/scripts/build/arch/microblaze.sh @@ -2,7 +2,7 @@ CT_DoArchTupleValues () { # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}${target_endian_el}" + CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX:-${target_endian_el}}" # gcc ./configure flags CT_ARCH_WITH_ARCH= diff --git a/scripts/build/arch/mips.sh b/scripts/build/arch/mips.sh index f7b7e3bd..97a077f8 100644 --- a/scripts/build/arch/mips.sh +++ b/scripts/build/arch/mips.sh @@ -1,13 +1,13 @@ # Compute MIPS-specific values CT_DoArchTupleValues() { - # The architecture part of the tuple, override only for 64-bit + local _64 + + # The architecture part of the tuple if [ "${CT_ARCH_64}" = "y" ]; then - CT_TARGET_ARCH="mips64${target_endian_el}" - else - # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH}${target_endian_el}" + _64="64" fi + CT_TARGET_ARCH="${CT_ARCH}${_64}${CT_ARCH_SUFFIX:-${target_endian_el}}" # Override CFLAGS for endianness: case "${CT_ARCH_ENDIAN}" in diff --git a/scripts/build/arch/powerpc.sh b/scripts/build/arch/powerpc.sh index ead91dc2..e5ad335e 100644 --- a/scripts/build/arch/powerpc.sh +++ b/scripts/build/arch/powerpc.sh @@ -3,7 +3,7 @@ CT_DoArchTupleValues () { # The architecture part of the tuple, override only for 64-bit if [ "${CT_ARCH_64}" = "y" ]; then - CT_TARGET_ARCH="powerpc64" + CT_TARGET_ARCH="powerpc64${CT_ARCH_SUFFIX}" fi # Only override values when ABI is not the default diff --git a/scripts/build/arch/s390.sh b/scripts/build/arch/s390.sh index 3c865e31..b4b8078c 100644 --- a/scripts/build/arch/s390.sh +++ b/scripts/build/arch/s390.sh @@ -3,6 +3,6 @@ CT_DoArchTupleValues() { # That's the only thing to override if [ "${CT_ARCH_64}" = "y" ]; then - CT_TARGET_ARCH="s390x" + CT_TARGET_ARCH="s390x${CT_ARCH_SUFFIX}" fi } diff --git a/scripts/build/arch/sh.sh b/scripts/build/arch/sh.sh index c7ac4923..7780e40f 100644 --- a/scripts/build/arch/sh.sh +++ b/scripts/build/arch/sh.sh @@ -2,7 +2,7 @@ CT_DoArchTupleValues () { # The architecture part of the tuple: - CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${target_endian_eb}" + CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${CT_ARCH_SUFFIX:-${target_endian_eb}}" # gcc ./configure flags CT_ARCH_WITH_ARCH= diff --git a/scripts/build/arch/sparc.sh b/scripts/build/arch/sparc.sh index a4d6201d..6fa38775 100644 --- a/scripts/build/arch/sparc.sh +++ b/scripts/build/arch/sparc.sh @@ -2,7 +2,7 @@ CT_DoArchTupleValues() { # That's the only thing to override if [ "${CT_ARCH_64}" = "y" ]; then - CT_TARGET_ARCH="${CT_ARCH}64" + CT_TARGET_ARCH="sparc64${CT_ARCH_SUFFIX}" fi } diff --git a/scripts/build/arch/x86.sh b/scripts/build/arch/x86.sh index f41a81d0..69407db9 100644 --- a/scripts/build/arch/x86.sh +++ b/scripts/build/arch/x86.sh @@ -3,7 +3,6 @@ # This one really needs a little love! :-( CT_DoArchTupleValues() { - # Override the architecture part of the tuple: if [ "${CT_ARCH_64}" = "y" ]; then CT_TARGET_ARCH=x86_64 @@ -20,4 +19,5 @@ CT_DoArchTupleValues() { *) CT_TARGET_ARCH=i586;; esac fi + CT_TARGET_ARCH="${CT_TARGET_ARCH}${CT_ARCH_SUFFIX}" } diff --git a/scripts/functions b/scripts/functions index a089a71f..a4118202 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1121,7 +1121,7 @@ CT_DoBuildTargetTuple() { esac # Build the default architecture tuple part - CT_TARGET_ARCH="${CT_ARCH}" + CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX}" # Set defaults for the system part of the tuple. Can be overriden # by architecture-specific values.