config/target.in
author Michael Hope <michael.hope@linaro.org>
Wed Oct 19 15:27:32 2011 +1300 (2011-10-19)
changeset 2739 f320e22f2cba
parent 2737 b5179235b925
child 2772 d4ac8609878e
permissions -rw-r--r--
arch: add softfp support

Some architectures support a mixed hard/soft floating point, where
the compiler emits hardware floating point instructions, but passes
the operands in core (aka integer) registers.

For example, ARM supports this mode (to come in the next changeset).

Add support for softfp cross compilers to the GCC and GLIBC
configuration. Needed for Ubuntu and other distros that are softfp.

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