scripts/build/arch/arm.sh
author willy tarreau <w@1wt.eu>
Sun Jan 20 12:58:22 2013 +0000 (2013-01-20)
changeset 3169 9d0b37f08a10
parent 3158 1161ea79915b
child 3262 87ad9e82546d
permissions -rw-r--r--
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>
yann@383
     1
# Compute ARM-specific values
yann@383
     2
yann@964
     3
CT_DoArchTupleValues() {
yann@383
     4
    # The architecture part of the tuple:
w@3169
     5
    CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX:-${target_endian_eb}}"
yann@383
     6
yann@385
     7
    # The system part of the tuple:
yann@385
     8
    case "${CT_LIBC},${CT_ARCH_ARM_EABI}" in
yann@787
     9
        *glibc,y)   CT_TARGET_SYS=gnueabi;;
yann@385
    10
        uClibc,y)   CT_TARGET_SYS=uclibcgnueabi;;
yann@1591
    11
        *,y)        CT_TARGET_SYS=eabi;;
yann@385
    12
    esac
yann@1596
    13
antony@2563
    14
    # Set the default instruction set mode
yann@1596
    15
    case "${CT_ARCH_ARM_MODE}" in
yann@1596
    16
        arm)    ;;
yann@1596
    17
        thumb)
yann@1596
    18
            CT_ARCH_CC_CORE_EXTRA_CONFIG="--with-mode=thumb"
yann@1596
    19
            CT_ARCH_CC_EXTRA_CONFIG="--with-mode=thumb"
yann@1596
    20
#            CT_ARCH_TARGET_CFLAGS="-mthumb"
yann@1596
    21
            ;;
yann@1596
    22
    esac
yann@1597
    23
yann@1597
    24
    if [ "${CT_ARCH_ARM_INTERWORKING}" = "y" ]; then
yann@1597
    25
        CT_ARCH_TARGET_CFLAGS+=" -mthumb-interwork"
yann@1597
    26
    fi
yann@3158
    27
yann@3158
    28
    if [ "${CT_ARCH_ARM_TUPLE_USE_EABIHF}" = "y" ]; then
yann@3158
    29
        CT_TARGET_SYS="${CT_TARGET_SYS}hf"
yann@3158
    30
    fi
yann@383
    31
}