arch/mips: add option for MIPS ABIs
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Sep 12 22:14:04 2010 +0200 (2010-09-12)
changeset 2118034de6dca38f
parent 2117 24aacb93191d
child 2119 f5de4d088dc9
arch/mips: add option for MIPS ABIs

This adds selection for one of the o32, n32 and n64 ABIs.
Later, we can easily use those boolean options, rather than
relying on a user-supplied string option.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
config/arch/mips.in
config/arch/mips.in.2
scripts/build/arch/mips.sh
     1.1 --- a/config/arch/mips.in	Sat Sep 11 17:55:54 2010 +0200
     1.2 +++ b/config/arch/mips.in	Sun Sep 12 22:14:04 2010 +0200
     1.3 @@ -8,7 +8,6 @@
     1.4      select ARCH_SUPPORTS_BOTH_ENDIAN
     1.5      select ARCH_DEFAULT_BE
     1.6      select ARCH_SUPPORT_ARCH
     1.7 -    select ARCH_SUPPORT_ABI
     1.8      select ARCH_SUPPORT_TUNE
     1.9      help
    1.10        The MIPS architecture, as defined by:
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/config/arch/mips.in.2	Sun Sep 12 22:14:04 2010 +0200
     2.3 @@ -0,0 +1,38 @@
     2.4 +# MIPS specific config options
     2.5 +
     2.6 +choice
     2.7 +    bool
     2.8 +    prompt "ABI"
     2.9 +
    2.10 +config ARCH_mips_o32
    2.11 +    bool
    2.12 +    prompt "o32"
    2.13 +    depends on ARCH_32
    2.14 +    help
    2.15 +      This is the -mabi=32 gcc option.
    2.16 +
    2.17 +config ARCH_mips_n32
    2.18 +    bool
    2.19 +    prompt "n32"
    2.20 +    depends on ARCH_64
    2.21 +    help
    2.22 +      This is the -mabi=n32 gcc option.
    2.23 +
    2.24 +config ARCH_mips_n64
    2.25 +    bool
    2.26 +    prompt "n64"
    2.27 +    depends on ARCH_64
    2.28 +    help
    2.29 +      This is the -mabi=64 gcc option.
    2.30 +
    2.31 +# Not supported on Linux:
    2.32 +# o64   : seems related to *BSD
    2.33 +# eabi  : seems related to bare-metal
    2.34 +
    2.35 +endchoice
    2.36 +
    2.37 +config ARCH_mips_ABI
    2.38 +    string
    2.39 +    default "32"    if ARCH_mips_o32
    2.40 +    default "n32"   if ARCH_mips_n32
    2.41 +    default "64"    if ARCH_mips_n64
     3.1 --- a/scripts/build/arch/mips.sh	Sat Sep 11 17:55:54 2010 +0200
     3.2 +++ b/scripts/build/arch/mips.sh	Sun Sep 12 22:14:04 2010 +0200
     3.3 @@ -14,4 +14,8 @@
     3.4          y,) CT_ARCH_ENDIAN_CFLAG="-EB";;
     3.5          ,y) CT_ARCH_ENDIAN_CFLAG="-EL";;
     3.6      esac
     3.7 +
     3.8 +    # Override ABI flags
     3.9 +    CT_ARCH_ABI_CFLAG="-mabi=${CT_ARCH_mips_ABI}"
    3.10 +    CT_ARCH_WITH_ABI="--with-abi=${CT_ARCH_mips_ABI}"
    3.11  }