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 <w@1wt.eu>
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" <yann.morin.1998@free.fr>
This commit is contained in:
Yann E. MORIN" 2013-01-20 12:58:22 +00:00 committed by willy tarreau
parent d82f1c6f2a
commit 150f500426
13 changed files with 30 additions and 18 deletions

View File

@ -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"

View File

@ -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}}"
}

View File

@ -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

View File

@ -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=

View File

@ -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=

View File

@ -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=

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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=

View File

@ -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
}

View File

@ -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}"
}

View File

@ -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.