安全な CFLAGS

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Safe CFLAGS and the translation is 82% complete.
Other languages:
  Note to translators
This page was improperly translated to Italian. It would be helpful if someone who can do Italian translations could use the content from this page to recreate an Italian translation using the standard wiki translation framework (click translation link at top of this page), then we can delete that imporperly translated page. See Help:Translating.
これと混同しないでください: CPU_FLAGS_*.


この記事は Gentoo Linux 上での CFLAGS の「安全な」設定のまとめを提供します。

Gentoo システムのデフォルトの CFLAGS は make.conf 内で設定することができます。CFLAGS はパッケージ単位で指定することもできます。

関連
さらなる情報については Gentoo ハンドブックの CFLAGS と CXXFLAGS および GCC の最適化の記事を参照してください。FAQ も参照してください。

コンパイラによる自動的な CPU の検出

CFLAGS または CXXFLAGS について推奨されるデフォルトの選択は、-march=native を使用することです。これは CPU のアーキテクチャの自動検出を有効化します。エントリは次のようになるでしょう:

ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -pipe -march=native"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
警告
distcc でコンパイルする場合は、make.confCFLAGS または CXXFLAGS 変数で -march=native または -mtune=native を使用しないでくださいCFLAGS/CXXFLAGS を正しく設定する方法については、distcc のページを参照してください。

特定のシステムで GCC が "native" として何を検出するかを確認するためには、以下のコマンドを実行することができます:

user $gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1 | grep mtune

出力として、内部での -march=native の解釈が表示されるでしょう。場合によっては GCC の検出モデルでは CPU が不明とされ、その場合は最適でない -mtune=generic (さらに -mtune が無いこともあります) が表示されるでしょう。この場合はマニュアルか該当する -mtune= を選択してください。また場合によっては、新しい (新しすぎる) Intel CPU で、-march= または共通の -mtune=intel が検出されることがありますが、この場合も同様です。

Also possible suboptimal -march=native detection - full l2-cache-size to single CPU thread on multi-core CPUs. Currently it used only for prefetching, but sometimes good choice to fallback to default --param=l2-cache-size=512 or own calculated value - to reduce cache concurrency on high SMP load. But this is in theory and not for all tasks - do nothing if unsure.

さらなる情報は GCC の最適化のページで見つかります。

手動で CFLAGS を設定するために CPU タイプを判別する

これらのツールはシステムの CPU 情報を報告することができます。その情報を使用して、このページの下部のリストから一致する CPU を探して、そのシステムにとって「安全な」推奨される CFLAGS を知ることができます。

プロセッサがどの CFLAGS を必要とするか分からない場合には特に、これらの設定を使用すべきです。

resolve-march-native での CPU の検出

A tool exists to automagically determine -march=native resolution values: app-misc/resolve-march-native. After installing it, issue:

user $resolve-march-native

/proc/cpuinfo での CPU タイプの報告

To identify the model of the CPU, take a look inside /proc/cpuinfo for the "cpu family" and "model" numbers like so:

user $grep -m1 -A3 "vendor_id" /proc/cpuinfo

安全な CFLAGS のリスト

x86/amd64

Generic psABI levels

If using a distcc farm with slightly different CPUs, it might make more sense to generate code that is just old enough to work for all of them, without bogging down to the really generic code. The psABI microarchitecture levels aims to provide just that for common eras of amd64 CPUs. See Wikipedia:x86-64#Microarchitecture_levels for a description of the levels.

Intel

Alder Lake
Core i3/i5/i7 12th Gen
vendor_id       : GenuineIntel
cpu family      : 6
model           : 154
model name      : 12th Gen Intel(R) Core(TM) i7-1260P
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=alderlake -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Skylake, Kaby Lake, Kaby Lake R, Coffee Lake, Comet Lake
Core i3/i5/i7 および Xeon E3/E5 *V5
vendor_id       : GenuineIntel
cpu family      : 6
model           : 94
model name      : Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
...
model           : 165
model name      : Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=skylake -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
警告
Even though they fit the family and model, this set of CFLAGS does NOT work for Skylake Pentium CPUs (e. g. G4400, or J5005) producing invalid code, which may break the system. Use -march=native for these systems instead.
Broadwell
Core i3/i5/i7 および Xeon E3/E5 *V4
vendor_id       : GenuineIntel
cpu family      : 6
model           : 79
model name      : Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz
…
model           : 79
model name      : Intel(R) Core(TM) i7-5650U CPU @ 2.20GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=broadwell -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Haswell
Core i3/i5/i7 および Xeon E3/E5/E7 *V3
vendor_id      : GenuineIntel
cpu family     : 6
model          : 60
model name     : Intel(R) Xeon(R) CPU E3-1271 v3 @ 3.60GHz
…
model          : 60
model name     : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=haswell -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Ivy Bridge
Core i3/i5/i7 および Xeon E3/E5/E7 *V2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 58
model name      : Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=ivybridge -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Pentium
vendor_id	: GenuineIntel
cpu family	: 6
model		: 58
model name	: Intel(R) Pentium(R) CPU G2020 @ 2.90GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=ivybridge -mno-avx -mno-aes -mno-rdrnd -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Sandy Bridge
Core i3/i5/i7 および Xeon E3/E5/E7
vendor_id	: GenuineIntel
cpu family	: 6
…
model		: 42
model name	: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
…
model		: 45
model name	: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
… 
model		: 42
model name	: Intel(R) Xeon(R) CPU E31245 @ 3.30GHz
… 
model           : 45
model name      : Intel(R) Xeon(R) CPU E5-2407 0 @ 2.20GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=sandybridge -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Pentium
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Pentium(R) CPU B960 @ 2.20GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=sandybridge -mno-avx -mno-aes -mno-rdrnd -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Nehalem
Core i3/i5/i7
vendor_id	: GenuineIntel
cpu family	: 6
model		: 30
model name	: Intel(R) Core(TM) i5-750 CPU @ 2.66GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=nehalem -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Westmere
Core i3/i5/i7
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i5-650 CPU @ 3.20GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=westmere -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
メモ
It may be required to add -mno-aes -mno-pclmul, especially for i3 (enabled by default). No output means not supported:
user $grep -m1 -e aes -e pclmulqdq /proc/cpuinfo
Intel Core
Intel Core
vendor_id       : GenuineIntel
cpu family      : 6
…
model		: 15
model name	: Intel(R) Core(TM)2 Duo CPU     T7500  @ 2.20GHz
…
model           : 15
model name      : Intel(R) Xeon(R) CPU            3040  @ 1.86GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=core2 -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
それ以前のマイクロアーキテクチャ
Pentium M (Dothan)
vendor_id	: GenuineIntel
cpu family	: 6
model		: 13
model name	: Intel(R) Pentium(R) M processor 2.13GHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=pentium-m -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Pentium 4 (Prescott)
vendor_id	: GenuineIntel
cpu family	: 15
model		: 4
model name	: Intel(R) Pentium(R) 4 CPU XXXGHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=nocona -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

64-bit capable models: 505, 505J, 506, 511, 516, 517, 519K, 521, 524, 531, 541, 551, 561, 571, 6xx and the 3.73(3)GHz Pentium 4 Extreme Edition.

メモ
Check the /proc/cpuinfo for the lm flag to detect 64-bit CPUs:
user $grep lm /proc/cpuinfo
The cpuid model (4 vs 3) is not an indicator of 64-bit compatibility; there are 32-bit family15/model4 CPUs!
それ以外のすべての Prescott
vendor_id	: GenuineIntel
cpu family	: 15
model		: 3
model name	: Intel(R) Pentium(R) 4 CPU XXXGHz
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=prescott -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

AMD

Ryzen (Zen ファミリ)
1000 および 2000 シリーズ
vendor_id	: AuthenticAMD
cpu family	: 23
model           : 1
model name	: AMD Ryzen 7 1800X Eight-Core Processor
…
cpu family	: 23
model           : 8
model name	: AMD Ryzen 7 2700X Eight-Core Processor
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=znver1 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
3000、4000、5000、および EPYC 7xx2 シリーズ
vendor_id	: AuthenticAMD
cpu family	: 23
model           : 113
model name	: AMD Ryzen 9 3900X 12-Core Processor
...
cpu family      : 23
model           : 49
model name      : AMD EPYC 7542 32-Core Processor
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=znver2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
5000 および EPYC 7xx3 シリーズ
vendor_id	: AuthenticAMD
cpu family	: 25
model           : 80
model name	: AMD Ryzen 7 PRO 5850U with Radeon Graphics
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=znver3 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
A6/A8/A9/A10/A12-8XXX/9XXX (Excavator)
Carrizo、Bristol Ridge、および Stoney Ridge
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 96 or 101 or 112
model name	: AMD A12-9800 RADEON R7, 12 COMPUTE CORES 4C+8G
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=bdver4 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
A4/A6/A8/A10-7XXX/8XXX (Steamroller)
Kaveri および Godavari
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 48 or 56
model name	: AMD A10-7850K Radeon R7, 12 Compute Cores 4C+8G
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=bdver3 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
重要
Various lowpower AMD APUs branded as AX-7XXX (eg. A4-7210) don't belong to cpu family 21!
E1/E2-XXXX, A4/A6/A8/A10-XXXX (Jaguar, Puma)
Kabini、Temash、Beema、Mullins、および Carrizo-L
vendor_id	: AuthenticAMD
cpu family	: 22
model		: 0 or 48
model name	: AMD A4-5000 APU with Radeon(TM) HD Graphics
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=btver2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
重要
Majority of AMD APUs branded as A4/A6/A8-XXXX (eg. A4-5300, A4-4000 or A6-5345M) don't belong to cpu family 22! They should use settings listed for AMD APU model given by the cpu family and model.
A4/A6/A8/A10-4XXX/5XXX/6XXX (Piledriver)
Trinity および Richland
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 16 or 19
model name	: AMD A8-4500M APU with Radeon(tm) HD Graphics
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=bdver2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
重要
Various low power AMD APUs branded as AX-5XXX/6XXX (eg. A4-5000, A4-5100 or A6-6310) don't belong to CPU family 21!
FX-XXXX
Bulldozer および Piledriver
vendor_id	: AuthenticAMD
cpu family	: 21
model		: 1 or 2
model name	: AMD FX(tm)-8150 Eight-Core Processor
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=bdver1 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
重要
Make sure and check the number listed by model on the system, the -march flag should be bdverX where X is the model number.
重要
Various AMD APUs branded as FX don't match model 1 or 2! They should use settings listed for AMD APU model given by the cpu family and model.
Z-XX, C-X0, E-XX0, E1/E2-1X00, E2-2000 (Bobcat)
Ontario、Hondo、Desna、および Zacate
vendor_id	: AuthenticAMD
cpu family	: 20
model		: 1 or 2
model name	: AMD E-350 Processor
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=btver1 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
A4/A6/A8-3XXX/3XXXM (12h)
Llano
vendor_id	: AuthenticAMD
cpu family	: 18
model		: 1
model name	: AMD A8-3500M APU with Radeon(tm) HD Graphics
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=amdfam10 -mcx16 -mpopcnt -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Phenom/Phenom II, Athlon II, Sempron (10h)
Agena、Deneb、Thuban、およびその派生
vendor_id	: AuthenticAMD
cpu family	: 16
model		: X
model name	: AMD Phenom(tm) II X6 1090T Processor
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=amdfam10 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
それ以前のマイクロアーキテクチャ
重要
Various AMD CPUs branded as Sempron (eg. Sempron 2200+ or Sempron 3000+) don't belong to cpu family 15!
E+ revisions - Athlon 64, Athlon 64 X2/FX, Sempron (0Fh)
vendor_id	: AuthenticAMD
cpu family	: 15
model		: >= 39
model name	: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=opteron-sse3 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Geode LX
vendor_id	: AuthenticAMD
cpu family	: 5
model		: 10
model name	: Geode(TM) Integrated Processor by AMD PCS
ファイル /etc/portage/make.conf
CHOST="i486-pc-linux-gnu"
COMMON_FLAGS="-Os -pipe -march=geode -mmmx -m3dnow -fomit-frame-pointer"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
Pre-E revisions - Athlon 64, Athlon 64 FX, Sempron (0Fh)
vendor_id	: AuthenticAMD
cpu family	: 15
model		: < 39
model name	: AMD Athlon(tm) 64 Processor 3200+
ファイル /etc/portage/make.conf
COMMON_FLAGS="-O2 -march=opteron -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

ARM

メモ
To identify the respective ARM core of the SoC, List of ARM microarchitectures and List of applications of ARM cores on Wikipedia may help.

Cortex-A

ARMv7-A/Cortex-A9 MPCore
with optional VFPv3 FPU
processor       : 0
model name      : ARMv7 Processor rev 0 (v7l)
BogoMIPS        : 2.00
Features        : half thumb fastmult vfp edsp vfpv3 vfpv3d16 tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x1
CPU part        : 0xc09
CPU revision    : 0
 
processor       : 1
model name      : ARMv7 Processor rev 0 (v7l)
BogoMIPS        : 2.00
Features        : half thumb fastmult vfp edsp vfpv3 vfpv3d16 tls 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x1
CPU part        : 0xc09
CPU revision    : 0
 
Hardware        : NVIDIA Tegra SoC (Flattened Device Tree)
Revision        : 0000
Serial          : 0000000000000000
ファイル /etc/portage/make.conf
CHOST="armv7a-hardfloat-linux-gnueabi"
COMMON_FLAGS="-O2 -march=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard -pipe -fomit-frame-pointer"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
メモ
This ARM core (equipped with the optional vfpv3d16 FPU but missing the NEON extension) is used in the Toshiba AC100/Dynabook AZ/Compal Paz00 Board.
ARMv8-A/BCM2837
メモ
This is the Broadcom chip used in the Raspberry Pi 3 Model B.
AArch32 with neon FPU
processor	: 0-3
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 38.40
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4
 
Hardware	: BCM2709
Revision        : 0000
Serial          : 0000000000000000
ファイル /etc/portage/make.conf
CHOST="armv7a-hardfloat-linux-gnueabi"
COMMON_FLAGS="-O2 -pipe -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
AArch64
processor	: 0-3
BogoMIPS	: 38.40
Features	: fp asimd evtstrm crc32
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

ARM11

ARMv6/ARM1176JZF-S
processor	: 0
model name	: ARMv6-compatible processor rev 7 (v6l)
BogoMIPS	: 697.95
Features	: half thumb fastmult vfp edsp java tls 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xb76
CPU revision	: 7
 
Hardware	: BCM2835
Revision	: 0000
Serial		: 000000000XXXXXXX
ファイル /etc/portage/make.conf
CHOST="armv6j-hardfloat-linux-gnueabi"
COMMON_FLAGS="-O2 -pipe -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
メモ
This ARM core is used in the first generation of the Raspberry Pi.
ARMv6/ARM1136JF-S
Processor       : ARMv6-compatible processor rev 5 (v6l)
BogoMIPS        : 791.34
Features        : swp half thumb fastmult vfp edsp java 
CPU implementer : 0x41
CPU architecture: 6TEJ
CPU variant     : 0x1
CPU part        : 0xb36
CPU revision    : 5
 
Hardware        : IMAPX200
Revision        : 0000
Serial          : 0000000000000000
ファイル /etc/portage/make.conf
CHOST="armv6j-hardfloat-linux-gnueabi"
COMMON_FLAGS="-Os -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=hard -pipe -fomit-frame-pointer"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

PowerPC / PowerPC 64

重要
-march= is not supported on the PowerPC (and RS/6000) instruction set architecture (ISA). Use -mcpu= and -mtune= instead.
メモ
Using -mcpu=native (and/or -mtune=native) should work on PowerPC but is not recommended due to distcc.

POWER8

processor       : 0
cpu             : POWER8E (raw), altivec supported
clock           : 3026.000000MHz
revision        : 2.1 (pvr 004b 0201)
 
timebase        : 512000000
platform        : pSeries
model           : IBM pSeries (emulated by qemu)
machine         : CHRP IBM pSeries (emulated by qemu)
ファイル /etc/portage/make.conf
COMMON_FLAGS="-mcpu=power8 -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

Cell

processor	: 0
cpu		: Cell Broadband Engine, altivec supported
clock		: 3192.000000MHz
revision	: 5.1 (pvr 0070 0501)
 
processor	: 1
cpu		: Cell Broadband Engine, altivec supported
clock		: 3192.000000MHz
revision	: 5.1 (pvr 0070 0501)
 
timebase	: 79800000
platform	: PS3
model		: SonyPS3
ファイル /etc/portage/make.conf
COMMON_FLAGS="-mcpu=cell -O2 -pipe -mabi=altivec -maltivec -mno-string -mno-multiple"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
メモ
GCC's -mspe and -mabi=spe options are not targetting PS3 systems and IBM Cell. Instead, those options are dedicated to IBM e500. More info:

PPC 970 (G5)

Compatible processors are IBM PPC970, PPC970FX, PPC970MP and PPC970GX.

cpu             : PPC970, altivec supported
clock           : 1800MHz
revision        : 2.2 (pvr 0039 0202)
bogomips        : 1127.21
machine         : PowerMac7,2
motherboard     : PowerMac7,2 MacRISC4 Power Macintosh
board revision  : 00000001
detected as     : 336 (PowerMac G5)
pmac flags      : 00000000
L2 cache        : 512K unified
pmac-generation : NewWorld
ファイル /etc/portage/make.conf
COMMON_FLAGS="-mcpu=970 -O2 -maltivec -mabi=altivec -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

G4 (PPC 74xx)

PPC 7450 ファミリ

Compatible processors are Motorola/Freescale MPC7450, MPC7440, MPC7451, MPC7441, MPC7455, MPC7445, MPC7457, MPC7447, MPC7447/A, and MPC7448.

processor       : 0
cpu             : 7447A, altivec supported
clock           : 1666.666000MHz
revision        : 1.5 (pvr 8003 0105)
bogomips        : 33.28
timebase        : 8320000
platform        : PowerMac
model           : PowerBook5,9
machine         : PowerBook5,9
motherboard     : PowerBook5,9 MacRISC3 Power Macintosh 
detected as     : 287 (PowerBook G4 17")
pmac flags      : 00000018
L2 cache        : 512K unified
pmac-generation : NewWorld
ファイル /etc/portage/make.conf
COMMON_FLAGS="-mcpu=7450 -O2 -maltivec -mabi=altivec -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
PPC 7400 ファミリ

Compatible processors are Motorola MPC7400 and MPC7410. Note: IBM manufactured the MPC7400 as 06K5319 and 10K8298 when Motorola was not able to fulfill Apple's demands.

processor       : 0
cpu             : 7400, altivec supported
clock           : 400.000000MHz
revision        : 2.9 (pvr 000c 0209)
bogomips        : 49.66
timebase        : 24908583
platform        : PowerMac
machine         : PowerMac3,1
motherboard     : PowerMac3,1 MacRISC Power Macintosh
detected as     : 65 (PowerMac G4 AGP Graphics)
pmac flags      : 00000004
L2 cache        : 1024K unified
pmac-generation : NewWorld
ファイル /etc/portage/make.conf
COMMON_FLAGS="-mcpu=7400 -O2 -maltivec -mabi=altivec -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

G3 (PPC 7XX)

Compatible processors are Motorola/Freescale MPC750, MPC740, MPC755 and MPC745 as well as IBM PPC750, PPC740, PPC750L, PPC740L, PPC750CX, PPC750CXe, PPCDBK ("Gekko"), PPC750FX, PPC750GX, PPC750CXr, PPC750CL ("Broadway"), PPC750GL and PPC750FL. The BAE Systems RAD750 is a radiation hardened variant of the PPC750. The "Espresso" (following the "Gekko" and "Broadway") is also based on the PPC750.

For CPUs for embedded systems such as the Gekko (PPCDBK, used in the Nintendo GameCube) additional CFLAGS (like -meabi) will be required.

processor       : 0
cpu             : 740/750
clock           : 400.000000MHz
revision        : 131.0 (pvr 0008 8300)
bogomips        : 49.93
timebase        : 24966218
platform        : PowerMac
model           : PowerBook3,1
machine         : PowerBook3,1
motherboard     : PowerBook3,1 MacRISC2 MacRISC Power Macintosh
detected as     : 70 (PowerBook Pismo)
pmac flags      : 0000001f
L2 cache        : 1024K unified
pmac-generation : NewWorld
ファイル /etc/portage/make.conf
COMMON_FLAGS="-mcpu=750 -Os -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

RISC-V

processor       : 0
hart            : 1
isa             : rv64imafdc
mmu             : sv39
uarch           : sifive,u74-mc
ファイル /etc/portage/make.conf
COMMON_FLAGS="-march=rv64imafdc_zicsr_zba_zbb -mcpu=sifive-u74 -mtune=sifive-7-series -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"

関連項目

外部資料