aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2019-11-21 06:44:19 +0000
committerWarner Losh <imp@FreeBSD.org>2019-11-21 06:44:19 +0000
commit7b692b8e0fb086b2733cebc3ff57308071ebefd0 (patch)
treeb3e3dfa4742eb02b41ff1036e585217e603758e9
parentfb1c294d47c5bae33ae01e6a395b3181e0c09c43 (diff)
downloadsrc-7b692b8e0fb086b2733cebc3ff57308071ebefd0.tar.gz
src-7b692b8e0fb086b2733cebc3ff57308071ebefd0.zip
Add table for MACHINE_CPUARCH
Add table and also some additional verbage of which one to use.
Notes
Notes: svn path=/head/; revision=354936
-rw-r--r--share/man/man7/arch.722
1 files changed, 21 insertions, 1 deletions
diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7
index 98d83a3dcaff..6971035c8285 100644
--- a/share/man/man7/arch.7
+++ b/share/man/man7/arch.7
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 7, 2019
+.Dd November 20, 2019
.Dt ARCH 7
.Os
.Sh NAME
@@ -347,6 +347,24 @@ Unless the make variable
is defined, make universe will not build mips, powerpc, nor sparc64
architectures unless the xtoolchain binaries have been installed for
the architecture.
+.Ss MACHINE_ARCH vs MACHINE_CPUARCH
+.Dv MACHINE_CPUARCH
+should be preferred in Makefiles when the generic
+architecture is being tested.
+.Dv MACHINE_ARCH
+should be preferred when there is something specific to a particular type of
+architecture where there is a choice of many, or could be a choice of many.
+.Bl -column -offset indent "Dv MACHINE" "Dv MACHINE_CPUARCH" "Dv MACHINE_ARCH"
+.It Dv MACHINE Ta Dv MACHINE_CPUARCH Ta Dv MACHINE_ARCH
+.It arm64 Ta aarch64 Ta aarch64
+.It amd64 Ta amd64 Ta amd64
+.It arm Ta arm Ta arm, armv6, armv7
+.It i386 Ta i386 Ta i386
+.It mips Ta mips Ta mips, mipsel, mips64, mips64el, mipshf, mipselhf, mips64elhf, mipsn32
+.It powerpc Ta powerpc Ta powerpc, powerpcspe, powerpc64
+.It riscv Ta riscv Ta riscv64, riscv64sf
+.It sparc64 Ta sparc64 Ta sparc64
+.El
.Ss Predefined Macros
The compiler provides a number of predefined macros.
Some of these provide architecture-specific details and are explained below.
@@ -473,6 +491,8 @@ There is no standard name for the processor: each OS selects its own
conventions.
.It Dv MACHINE_CPUARCH Represents the source location for a given
.Dv MACHINE_ARCH .
+It is generally the common prefix for all the MACHINE_ARCH that
+share the same implementation, though 'riscv' breaks this rule.
For example,
.Dv MACHINE_CPUARCH
is defined to be mips for all the flavors of mips that we support