scripts/build/arch/sh.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:43:07 2011 +0200 (2011-07-17)
changeset 2893 a8a65758664f
parent 2760 b402a49734a3
child 3169 9d0b37f08a10
permissions -rw-r--r--
cc/gcc: do not use the core pass-2 to build the baremetal compiler

In case we build a baremetal compiler, use the standard passes:
- core_cc is used to build the C library;
- as such, it is meant to run on build, not host;
- the final compiler is meant to run on host;

As the current final compiler step can not build a baremetal compiler,
call the core backend from the final step.

NB: Currently, newlib is built during the start_files pass, so we have
to have a core compiler by then... Once we can build the baremetal
compiler from the final cc step, then we can move the newlib build to
the proper step, and then get rid of the core pass-1 static compiler...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
yann@413
     1
# Compute sh-specific values
yann@413
     2
yann@964
     3
CT_DoArchTupleValues () {
yann@413
     4
    # The architecture part of the tuple:
yann@413
     5
    CT_TARGET_ARCH="${CT_ARCH_SH_VARIANT}${target_endian_eb}"
yann@413
     6
yann@413
     7
    # gcc ./configure flags
yann@413
     8
    CT_ARCH_WITH_ARCH=
yann@413
     9
    CT_ARCH_WITH_ABI=
yann@413
    10
    CT_ARCH_WITH_CPU=
yann@413
    11
    CT_ARCH_WITH_TUNE=
yann@413
    12
    CT_ARCH_WITH_FPU=
yann@413
    13
    CT_ARCH_WITH_FLOAT=
yann@413
    14
yann@413
    15
    # Endianness stuff
yann@2775
    16
    case "${CT_ARCH_ENDIAN}" in
yann@2775
    17
        big)    CT_ARCH_ENDIAN_CFLAG=-mb;;
yann@2775
    18
        little) CT_ARCH_ENDIAN_CFLAG=-ml;;
yann@413
    19
    esac
yann@413
    20
yann@413
    21
    # CFLAGS
yann@1936
    22
    case "${CT_ARCH_SH_VARIANT}" in
yann@413
    23
        sh3)    CT_ARCH_ARCH_CFLAG=-m3;;
yann@413
    24
        sh4*)
yann@2760
    25
            # softfp is not possible for SuperH, no need to test for it.
yann@2760
    26
            case "${CT_ARCH_FLOAT}" in
yann@2760
    27
                hard)
yann@2760
    28
                    CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}"
yann@2760
    29
                    ;;
yann@2760
    30
                soft)
yann@2760
    31
                    CT_ARCH_ARCH_CFLAG="-m4${CT_ARCH_SH_VARIANT##sh?}-nofpu"
yann@2760
    32
                    ;;
yann@413
    33
            esac
yann@413
    34
            ;;
yann@413
    35
    esac
yann@413
    36
    CT_ARCH_FLOAT_CFLAG=
yann@413
    37
}