# HG changeset patch # User willy tarreau # Date 1358686702 0 # Node ID 9d0b37f08a10ce5d5920c69b8ed3a4a856214803 # Parent 9b991363c01c72bda0909639534e932979353075 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" diff -r 9b991363c01c -r 9d0b37f08a10 config/target.in --- a/config/target.in Tue Jan 22 00:32:38 2013 +0100 +++ b/config/target.in Sun Jan 20 12:58:22 2013 +0000 @@ -41,6 +41,21 @@ 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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/alpha.sh --- a/scripts/build/arch/alpha.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/alpha.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/arm.sh --- a/scripts/build/arch/arm.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/arm.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/avr32.sh --- a/scripts/build/arch/avr32.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/avr32.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/blackfin.sh --- a/scripts/build/arch/blackfin.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/blackfin.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/microblaze.sh --- a/scripts/build/arch/microblaze.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/microblaze.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/mips.sh --- a/scripts/build/arch/mips.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/mips.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/powerpc.sh --- a/scripts/build/arch/powerpc.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/powerpc.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/s390.sh --- a/scripts/build/arch/s390.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/s390.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/sh.sh --- a/scripts/build/arch/sh.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/sh.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/sparc.sh --- a/scripts/build/arch/sparc.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/sparc.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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 -r 9b991363c01c -r 9d0b37f08a10 scripts/build/arch/x86.sh --- a/scripts/build/arch/x86.sh Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/build/arch/x86.sh Sun Jan 20 12:58:22 2013 +0000 @@ -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_TARGET_ARCH=i586;; esac fi + CT_TARGET_ARCH="${CT_TARGET_ARCH}${CT_ARCH_SUFFIX}" } diff -r 9b991363c01c -r 9d0b37f08a10 scripts/functions --- a/scripts/functions Tue Jan 22 00:32:38 2013 +0100 +++ b/scripts/functions Sun Jan 20 12:58:22 2013 +0000 @@ -1121,7 +1121,7 @@ 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.