config/target.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Fri Nov 25 23:59:29 2011 +0100 (2011-11-25)
changeset 2794 561bce585313
parent 2789 e6b5bd481942
child 2815 446a17b5dd1e
permissions -rw-r--r--
config/target: enforce floating point support

Do not prompt for the type of floating-point support, if the
architecture did not explicitly stated that it did support it.

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     depends on ARCH_SUPPORTS_WITH_FLOAT
   264 
   265 config ARCH_FLOAT_HW
   266     bool
   267     prompt "hardware (FPU)"
   268     help
   269       Emit hardware floating point opcodes.
   270       
   271       If you've got a processor with a FPU, then you want that.
   272       If your hardware has no FPU, you still can use HW floating point, but
   273       need to compile support for FPU emulation in your kernel. Needless to
   274       say that emulating the FPU is /slooowwwww/...
   275       
   276       One situation you'd want HW floating point without a FPU is if you get
   277       binary blobs from different vendors that are compiling this way and
   278       can't (don't wan't to) change.
   279 
   280 config ARCH_FLOAT_SW
   281     bool
   282     prompt "software"
   283     help
   284       Do not emit any hardware floating point opcode.
   285       
   286       If your processor has no FPU, then you most probably want this, as it
   287       is faster than emulating the FPU in the kernel.
   288 
   289 config ARCH_FLOAT_SOFTFP
   290     bool
   291     prompt "softfp"
   292     depends on ARCH_SUPPORTS_SOFTFP
   293     help
   294       Emit hardware floating point opcodes but use the software
   295       floating point calling convention.
   296 
   297       Architectures such as ARM use different registers for passing
   298       floating point values depending on if they're in software mode
   299       or hardware mode.  softfp emits FPU instructions but uses the
   300       software FP calling convention allowing softfp code to
   301       interoperate with legacy software only code.
   302 
   303       If in doubt, use 'software' or 'hardware' mode instead.
   304 
   305 endchoice
   306 
   307 config TARGET_CFLAGS
   308     string
   309     prompt "Target CFLAGS"
   310     default ""
   311     help
   312       Used to add specific options when compiling libraries of the toolchain,
   313       that will run on the target (eg. libc.so).
   314       
   315       Note that the options above for ARCH, ABI, CPU, TUNE and FPU will be
   316       automatically used. You don't need to specify them here.
   317       
   318       Leave blank if you don't know better.
   319 
   320 config TARGET_LDFLAGS
   321     string
   322     prompt "Target LDFLAGS"
   323     default ""
   324     help
   325       Used to add specific options when linking libraries of the toolchain,
   326       that will run on your target.
   327       
   328       Leave blank if you don't know better.
   329 
   330 config ARCH_FLOAT
   331     string
   332     default ""       if ! ARCH_SUPPORTS_WITH_FLOAT
   333     default "hard"   if ARCH_FLOAT_HW
   334     default "soft"   if ARCH_FLOAT_SW
   335     default "softfp" if ARCH_FLOAT_SOFTFP
   336 
   337 source "config.gen/arch.in.2"
   338 
   339 endmenu