scripts/build/arch/arm.sh
author Yann Diorcet <diorcet.yann@gmail.com>
Fri Nov 16 15:25:57 2012 +0100 (2012-11-16)
changeset 3119 1c56c03b7ed5
parent 1597 fa8f3ab724f9
child 3158 1161ea79915b
permissions -rw-r--r--
scripts: add BUILD/HOST extra cflags/ldflags

On some hosts, and for certain toolchains (eg. toolchain targetting
the upcoming Darwin), it may be necessary to pass arbitrary CFLAGS
and/or LDFLAGS when building the components.

And necessary infrastructure:
- EXTRA_{CFLAGS,LDFLAGS}_FOR_{BUILD,HOST} as config options
- pass those extra flags to components

Fix-up a slight typo in elf2flt at the same time (misnamed cflags).

Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com>
Message-Id: <d24043276c9243a35421.1353077450@macbook-smorlat.local>
Patchwork-Id: 199645
yann@383
     1
# Compute ARM-specific values
yann@383
     2
yann@964
     3
CT_DoArchTupleValues() {
yann@383
     4
    # The architecture part of the tuple:
yann@383
     5
    CT_TARGET_ARCH="${CT_ARCH}${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@383
    27
}