CPU_FLAGS_X86 conversion

From Gentoo Wiki
Jump to:navigation Jump to:search

The basic idea is rather simple: replace CPU feature flags with matching flags from the profiles/desc/cpu_flags_x86.desc file. Few notes though:

  1. Make sure not to accidentally change the option name, e.g. $(use_enable mmx) -> $(use_enable cpu_flags_x86_mmx mmx).
  2. The list of packages may be incomplete, esp. wrt packages that use custom local flag names. It may also contain extraneous packages, e.g. we need to check all uses of USE=aes.
  3. Some flags were renamed, e.g. aes-ni -> cpu_flags_x86_aes.
  4. Some flags are incorrect, e.g. sse4 doesn't exist. It's either sse4_1, sse4_2, see4a or some combination of the three.
  5. If you need extra flags, please bring it up for discussion first. Do not introduce more local flags, we have enough mess with them.
  6. Flags should be used when code (e.g. assembly) is compiled conditionally. When used only to control -mfoo options, the flags should be removed.
  7. Remember to update metadata.xml. If descriptions are generic, remove them. If they're not, rename them to cpu_flags_x86_*.

Script to find packages

You can use the cpuflags-search script to look for packages that still use the old flags. Optionally passed a repository name, it lists all packages that use the old flags. Note that it may list false positives (i.e. it can't know if USE=aes was used for the instruction set or AES algorithm support).


Science Overlay