Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | 2012/03/30 - Mark Hatle <mark.hatle@windriver.com> |
| 2 | - Initial Revision |
| 3 | |
| 4 | |
| 5 | Introduction |
| 6 | ============ |
| 7 | The individual CPU, and ABI tunings are contained in this directory. A |
| 8 | number of local and global variables are used to control the way the |
| 9 | tunings are setup and how they work together to specify an optimized |
| 10 | configuration. |
| 11 | |
| 12 | The following is brief summary of the generic components that are used |
| 13 | in these tunings. |
| 14 | |
| 15 | AVAILTUNES - This is a list of all of the tuning definitions currently |
| 16 | available in the system. Not all tunes in this list may be compatible |
| 17 | with the machine configuration, or each other in a multilib |
| 18 | configuration. Each tuning file can add to this list using "+=", but |
| 19 | should never replace the list using "=". |
| 20 | |
| 21 | DEFAULTTUNE - This specifies the tune to use for a particular build. |
| 22 | Each tune should specify a reasonable default, which can be overriden by |
| 23 | a machine or multilib configuration. The specified tune must be listed |
| 24 | in the AVAILTUNES. |
| 25 | |
| 26 | TUNEVALID[feature] - The <feature> is defined with a human readable |
| 27 | explanation for what it does. All architectural, cpu, abi, etc tuning |
| 28 | features must be defined using TUNEVALID. |
| 29 | |
| 30 | TUNECONFLICTS[feature] - A list of features which conflict with <feature>. |
| 31 | New sanity checks will try to reject combinations in which a single |
| 32 | tuning ends up with features which conflict with each other. |
| 33 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 34 | TUNE_FEATURES - This is automatically defined as TUNE_FEATURES:tune-<tune>. |
| 35 | See TUNE_FEATURES:tune-<tune> for more information. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | TUNE_FEATURES:tune-<tune> - Specify the features used to describe a |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | specific tune. This is a list of features that a tune support, each |
| 39 | feature must be in the TUNEVALID list. Note: the tune and a given |
| 40 | feature name may be the same, but they have different purposes. Only |
| 41 | features may be used to change behavior, while tunes are used to |
| 42 | describe an overall set of features. |
| 43 | |
| 44 | ABIEXTENSION - An ABI extension may be specified by a specific feature |
| 45 | or other tuning setting, such as TARGET_FPU. Any ABI extensions either |
| 46 | need to be defined in the architectures base arch file, i.e. |
| 47 | ABIEXTENSION = "eabi" in the arm case, or appended to in specific tune |
| 48 | files with a ".=". Spaces are not allowed in this variable. |
| 49 | |
| 50 | TUNE_CCARGS - Setup the cflags based on the TUNE_FEATURES settings. |
| 51 | These should be additive when defined using "+=". All items in this |
| 52 | list should be dynamic! i.e. |
| 53 | ${@bb.utils.contains("TUNE_FEATURES", "feature", "cflag", "!cflag", d)} |
| 54 | |
| 55 | TUNE_ARCH - The GNU canonical arch for a specific architecture. i.e. |
| 56 | arm, armeb, mips, mips64, etc. This value is used by bitbake to setup |
| 57 | configure. TUNE_ARCH definitions are specific to a given architecture. |
| 58 | They may be a single static definition, or may be dynamically adjusted. |
| 59 | See each architecture's README for details for that CPU family. |
| 60 | |
| 61 | TUNE_PKGARCH - The package architecture used by the packaging systems to |
| 62 | define the architecture, abi and tuning of a particular package. |
| 63 | Similarly to TUNE_ARCH, the definition of TUNE_PKGARCH is specific to |
| 64 | each architecture. See each architectures README for details for that |
| 65 | CPU family. |
| 66 | |
| 67 | PACKAGE_EXTRA_ARCHS - Lists all runtime compatible package |
| 68 | architectures. By default this is equal to |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 69 | PACKAGE_EXTRA_ARCHS:tune-<tune>. If an architecture deviates from the |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 70 | default it will be listed in the architecture README. |
| 71 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 72 | PACKAGE_EXTRA_ARCHS:tune-<tune> - List all of the package architectures |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | that are compatible with this specific tune. The package arch of this |
| 74 | tune must be in the list. |
| 75 | |
| 76 | TARGET_FPU - The FPU setting for a given tune, hard (generate floating |
| 77 | point instructions), soft (generate internal gcc calls), "other" |
| 78 | architecture specific floating point. This is synchronized with the |
| 79 | compiler and other toolchain items. This should be dynamically |
| 80 | configured in the same way that TUNE_CCARGS is. |
| 81 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 82 | BASE_LIB:tune-<tune> - The "/lib" location for a specific ABI. This is |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 83 | used in a multilib configuration to place the libraries in the correct, |
| 84 | non-conflicting locations. |
| 85 | |
| 86 | |
| 87 | Best Practice |
| 88 | ============= |
| 89 | The tune infrastructure is designed to be hierarchical. When writing a |
| 90 | new tune file for a "fast-forward" CPU architecture (one that supports |
| 91 | everything from a previous generation), it is recommended to require the |
| 92 | previous generation tune file and specify PACKAGE_EXTRA_ARCHS using the |
| 93 | previous generation's override and appending the new tune. Note that |
| 94 | only one previous tune file should be included to avoid mutiple includes |
| 95 | of the base arch which could lead to a broken configuration due to |
| 96 | multiple prepend and append assignments. |
| 97 | |
| 98 | For example, for x86, there is a common x86/arch-x86.inc which is |
| 99 | included in the base i586 tune file. The core2 tune builds |
| 100 | on that, and corei7 builds on core2. |