config/target.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Nov 25 23:57:55 2011 +0100 (2011-11-25)
changeset 2789 e6b5bd481942
parent 2788 b6faa28e76e0
child 2794 561bce585313
permissions -rw-r--r--
config/target: add float support selection

Changeset #149c33923f47 broke the architectures that do not
support the --with-float=X ./configure flag (in gcc). For example,
x86_64 does not support it.

Add a new blind config option that architectures can set to tell
they support floating point selection.

Reported-by: Morten Thunberg Svendsen <mts@doredevelopment.dk>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 # Target definition: architecture, optimisations, etc...
     2 
     3 menu "Target options"
     4 
     5 config ARCH
     6     string
     7 
     8 # Pre-declare target optimisation variables
     9 config ARCH_SUPPORTS_BOTH_MMU
    10 config ARCH_SUPPORTS_BOTH_ENDIAN
    11 config ARCH_SUPPORTS_32
    12 config ARCH_SUPPORTS_64
    13 config ARCH_SUPPORTS_WITH_ARCH
    14 config ARCH_SUPPORTS_WITH_ABI
    15 config ARCH_SUPPORTS_WITH_CPU
    16 config ARCH_SUPPORTS_WITH_TUNE
    17 config ARCH_SUPPORTS_WITH_FLOAT
    18 config ARCH_SUPPORTS_WITH_FPU
    19 config ARCH_SUPPORTS_SOFTFP
    20 
    21 config ARCH_DEFAULT_HAS_MMU
    22 config ARCH_DEFAULT_BE
    23 config ARCH_DEFAULT_LE
    24 config ARCH_DEFAULT_32
    25 config ARCH_DEFAULT_64
    26 
    27 config ARCH_ARCH
    28 config ARCH_ABI
    29 config ARCH_CPU
    30 config ARCH_TUNE
    31 config ARCH_FPU
    32 config ARCH_BE
    33 config ARCH_LE
    34 config ARCH_32
    35 config ARCH_64
    36 config ARCH_BITNESS
    37 config ARCH_FLOAT_HW
    38 config ARCH_FLOAT_SW
    39 config TARGET_CFLAGS
    40 config TARGET_LDFLAGS
    41 
    42 source "config.gen/arch.in"
    43 
    44 #--------------------------------------
    45 comment "Generic target options"
    46 
    47 config ARCH_SUPPORTS_BOTH_MMU
    48     bool
    49 
    50 config ARCH_DEFAULT_HAS_MMU
    51     bool
    52 
    53 config ARCH_USE_MMU
    54     bool
    55     prompt "Use the MMU" if ARCH_SUPPORTS_BOTH_MMU
    56     default y if ARCH_DEFAULT_HAS_MMU
    57     help
    58       If your architecture has an MMU and you want to use it,
    59       say 'Y' here.
    60       
    61       OTOH, if you don't want to use the MMU, or your arch
    62       lacks an MMU, say 'N' here.
    63       
    64       Note that some architectures (eg. ARM) has variants that
    65       lacks an MMU (eg. ARM Cortex-M3), while other variants
    66       have one (eg. ARM Cortex-A8).
    67 
    68 #--------------------------------------
    69 config ARCH_SUPPORTS_BOTH_ENDIAN
    70     bool
    71 
    72 config ARCH_DEFAULT_BE
    73     bool
    74 
    75 config ARCH_DEFAULT_LE
    76     bool
    77 
    78 choice
    79     bool
    80     prompt "Endianness:"
    81     depends on ARCH_SUPPORTS_BOTH_ENDIAN
    82     default ARCH_BE if ARCH_DEFAULT_BE
    83     default ARCH_LE if ARCH_DEFAULT_LE
    84 
    85 config ARCH_BE
    86     bool
    87     prompt "Big endian"
    88 
    89 config ARCH_LE
    90     bool
    91     prompt "Little endian"
    92 
    93 endchoice
    94 
    95 config ARCH_ENDIAN
    96     string
    97     depends on ARCH_SUPPORTS_BOTH_ENDIAN
    98     default "big"       if ARCH_BE
    99     default "little"    if ARCH_LE
   100 
   101 #--------------------------------------
   102 config ARCH_SUPPORTS_32
   103     bool
   104 
   105 config ARCH_SUPPORTS_64
   106     bool
   107 
   108 config ARCH_DEFAULT_32
   109     bool
   110 
   111 config ARCH_DEFAULT_64
   112     bool
   113 
   114 config ARCH_BITNESS
   115     int
   116     default "32"    if ARCH_32
   117     default "64"    if ARCH_64
   118 
   119 choice
   120     bool
   121     prompt "Bitness:"
   122     default ARCH_32 if ARCH_DEFAULT_32
   123     default ARCH_64 if ARCH_DEFAULT_64
   124 
   125 config ARCH_32
   126     bool
   127     prompt "32-bit"
   128     depends on ARCH_SUPPORTS_32
   129 
   130 config ARCH_64
   131     bool
   132     prompt "64-bit"
   133     depends on ARCH_SUPPORTS_64
   134 
   135 endchoice
   136 
   137 #--------------------------------------
   138 comment "Target optimisations"
   139 
   140 config ARCH_SUPPORTS_WITH_ARCH
   141     bool
   142 
   143 config ARCH_SUPPORTS_WITH_ABI
   144     bool
   145 
   146 config ARCH_SUPPORTS_WITH_CPU
   147     bool
   148 
   149 config ARCH_SUPPORTS_WITH_TUNE
   150     bool
   151 
   152 config ARCH_SUPPORTS_WITH_FLOAT
   153     bool
   154 
   155 config ARCH_SUPPORTS_WITH_FPU
   156     bool
   157 
   158 config ARCH_SUPPORTS_SOFTFP
   159     bool
   160 
   161 config ARCH_ARCH
   162     string
   163     prompt "Architecture level"
   164     depends on ARCH_SUPPORTS_WITH_ARCH
   165     default ""
   166     help
   167       GCC uses this name to determine what kind of instructions it can emit
   168       when generating assembly code. This option can be used in conjunction
   169       with or instead of the ARCH_CPU option (above), or a (command-line)
   170       -mcpu= option.
   171       
   172       This is the configuration flag --with-arch=XXXX, and the runtime flag
   173       -march=XXX.
   174       
   175       Pick a value from the gcc manual for your choosen gcc version and your
   176       target CPU.
   177       
   178       Leave blank if you don't know, or if your target architecture does not
   179       offer this option.
   180 
   181 config ARCH_ABI
   182     string
   183     prompt "Generate code for the specific ABI"
   184     depends on ARCH_SUPPORTS_WITH_ABI
   185     default ""
   186     help
   187       Generate code for the given ABI.
   188 
   189       This is the configuration flag --with-abi=XXXX, and the runtime flag
   190       -mabi=XXX.
   191 
   192       Pick a value from the gcc manual for your choosen gcc version and your
   193       target CPU.
   194 
   195       Leave blank if you don't know, or if your target architecture does not
   196       offer this option.
   197 
   198 config ARCH_CPU
   199     string
   200     prompt "Emit assembly for CPU"
   201     depends on ARCH_SUPPORTS_WITH_CPU
   202     default ""
   203     help
   204       This specifies the name of the target processor. GCC uses this name
   205       to determine what kind of instructions it can emit when generating
   206       assembly code.
   207       
   208       This is the configuration flag --with-cpu=XXXX, and the runtime flag
   209       -mcpu=XXX.
   210 
   211       Pick a value from the gcc manual for your choosen gcc version and your
   212       target CPU.
   213       
   214       Leave blank if you don't know, or if your target architecture does not
   215       offer this option.
   216 
   217 config ARCH_TUNE
   218     string
   219     prompt "Tune for CPU"
   220     depends on ARCH_SUPPORTS_WITH_TUNE
   221     default ""
   222     help
   223       This option is very similar to the ARCH_CPU option (above), except
   224       that instead of specifying the actual target processor type, and hence
   225       restricting which instructions can be used, it specifies that GCC should
   226       tune the performance of the code as if the target were of the type
   227       specified in this option, but still choosing the instructions that it
   228       will generate based on the cpu specified by the ARCH_CPU option
   229       (above), or a (command-line) -mcpu= option.
   230       
   231       This is the configuration flag --with-tune=XXXX, and the runtime flag
   232       -mtune=XXX.
   233       
   234       Pick a value from the gcc manual for your choosen gcc version and your
   235       target CPU.
   236       
   237       Leave blank if you don't know, or if your target architecture does not
   238       offer this option.
   239 
   240 config ARCH_FPU
   241     string
   242     prompt "Use specific FPU"
   243     depends on ARCH_SUPPORTS_WITH_FPU
   244     default ""
   245     help
   246       On some targets (eg. ARM), you can specify the kind of FPU to emit
   247       code for.
   248 
   249       This is the configuration flag --with-fpu=XXX, and the runtime flag
   250       -mfpu=XXX.
   251       
   252       See below wether to actually emit FP opcodes, or to emulate them.
   253       
   254       Pick a value from the gcc manual for your choosen gcc version and your
   255       target CPU.
   256       
   257       Leave blank if you don't know, or if your target architecture does not
   258       offer this option.
   259 
   260 choice
   261     bool
   262     prompt "Floating point:"
   263 
   264 config ARCH_FLOAT_HW
   265     bool
   266     prompt "hardware (FPU)"
   267     help
   268       Emit hardware floating point opcodes.
   269       
   270       If you've got a processor with a FPU, then you want that.
   271       If your hardware has no FPU, you still can use HW floating point, but
   272       need to compile support for FPU emulation in your kernel. Needless to
   273       say that emulating the FPU is /slooowwwww/...
   274       
   275       One situation you'd want HW floating point without a FPU is if you get
   276       binary blobs from different vendors that are compiling this way and
   277       can't (don't wan't to) change.
   278 
   279 config ARCH_FLOAT_SW
   280     bool
   281     prompt "software"
   282     help
   283       Do not emit any hardware floating point opcode.
   284       
   285       If your processor has no FPU, then you most probably want this, as it
   286       is faster than emulating the FPU in the kernel.
   287 
   288 config ARCH_FLOAT_SOFTFP
   289     bool
   290     prompt "softfp"
   291     depends on ARCH_SUPPORTS_SOFTFP
   292     help
   293       Emit hardware floating point opcodes but use the software
   294       floating point calling convention.
   295 
   296       Architectures such as ARM use different registers for passing
   297       floating point values depending on if they're in software mode
   298       or hardware mode.  softfp emits FPU instructions but uses the
   299       software FP calling convention allowing softfp code to
   300       interoperate with legacy software only code.
   301 
   302       If in doubt, use 'software' or 'hardware' mode instead.
   303 
   304 endchoice
   305 
   306 config TARGET_CFLAGS
   307     string
   308     prompt "Target CFLAGS"
   309     default ""
   310     help
   311       Used to add specific options when compiling libraries of the toolchain,
   312       that will run on the target (eg. libc.so).
   313       
   314       Note that the options above for ARCH, ABI, CPU, TUNE and FPU will be
   315       automatically used. You don't need to specify them here.
   316       
   317       Leave blank if you don't know better.
   318 
   319 config TARGET_LDFLAGS
   320     string
   321     prompt "Target LDFLAGS"
   322     default ""
   323     help
   324       Used to add specific options when linking libraries of the toolchain,
   325       that will run on your target.
   326       
   327       Leave blank if you don't know better.
   328 
   329 config ARCH_FLOAT
   330     string
   331     default "hard"   if ARCH_FLOAT_HW
   332     default "soft"   if ARCH_FLOAT_SW
   333     default "softfp" if ARCH_FLOAT_SOFTFP
   334 
   335 source "config.gen/arch.in.2"
   336 
   337 endmenu