scripts/build/arch/arm.sh
author Daniel Price <daniel.price@gmail.com>
Tue Nov 20 16:59:17 2012 -0800 (2012-11-20)
changeset 3126 333d3e40cbd1
parent 1597 fa8f3ab724f9
child 3158 1161ea79915b
permissions -rw-r--r--
scripts: refine static linking check to better guide the user

The current mechanism to check if static linking is possible, and the mesage
displayed on failure, can be puzzling to the unsuspecting user.

Also, the current implementation is not using the existing infrastructure,
and is thus difficult to enhance with new tests.

So, switch to using the standard CT_DoExecLog infra, and use four tests to
check for the host compiler:
- check we can run it
- check it can build a trivial program
- check it can statically link that program
- check if it statically link with libstdc++

That should cover most of the problems. Hopefully.

(At the same time, fix a typo in a comment)

Signed-off-by: Daniel Price <daniel.price@gmail.com>
[yann.morin.1998@free.fr: split original patch for self-contained changes]
[yann.morin.1998@free.fr: use steps to better see gcc's output]
[yann.morin.1998@free.fr: commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Message-Id: <163f86b5216fc08c672a.1353459722@nipigon.dssd.com>
Patchwork-Id: 200536
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
}