summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.inc119
-rw-r--r--README-BRANCH24
-rw-r--r--bin/Makefile13
-rw-r--r--cddl/lib/libdtrace/Makefile4
-rw-r--r--cddl/lib/libzpool/Makefile6
-rwxr-xr-xcontrib/binutils/bfd/config.bfd4
-rw-r--r--contrib/smbfs/Makefile2
-rw-r--r--etc/Makefile2
-rw-r--r--gnu/lib/csu/Makefile6
-rw-r--r--gnu/lib/libgcc/Makefile16
-rw-r--r--gnu/lib/libgomp/Makefile5
-rw-r--r--gnu/lib/libstdc++/Makefile12
-rw-r--r--gnu/usr.bin/Makefile2
-rw-r--r--gnu/usr.bin/binutils/Makefile.inc026
-rw-r--r--gnu/usr.bin/binutils/as/Makefile6
-rw-r--r--gnu/usr.bin/binutils/gdb/Makefile16
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile.arm2
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile.mips6
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.arm4
-rw-r--r--gnu/usr.bin/binutils/libbfd/Makefile.mips5
-rw-r--r--gnu/usr.bin/cc/Makefile.inc7
-rw-r--r--gnu/usr.bin/cc/Makefile.tgt18
-rw-r--r--gnu/usr.bin/cc/cc_int/Makefile4
-rw-r--r--gnu/usr.bin/cc/cc_tools/Makefile22
-rw-r--r--gnu/usr.bin/gdb/Makefile2
-rw-r--r--gnu/usr.bin/gdb/Makefile.inc14
-rw-r--r--gnu/usr.bin/gdb/gdbserver/Makefile14
-rw-r--r--gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c (renamed from gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c)0
-rw-r--r--gnu/usr.bin/gdb/gdbserver/reg-powerpc.c (renamed from gnu/usr.bin/gdb/gdbserver/reg-ppc.c)0
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile2
-rw-r--r--gnu/usr.bin/gdb/libgdb/Makefile10
-rw-r--r--include/Makefile4
-rw-r--r--lib/Makefile18
-rw-r--r--lib/bind/config.mk7
-rw-r--r--lib/libc/Makefile20
-rw-r--r--lib/libc/compat-43/Makefile.inc2
-rw-r--r--lib/libc/gen/Makefile.inc6
-rw-r--r--lib/libc/locale/Makefile.inc2
-rw-r--r--lib/libc/quad/Makefile.inc4
-rw-r--r--lib/libc/softfloat/Makefile.inc4
-rw-r--r--lib/libc/stdlib/Makefile.inc4
-rw-r--r--lib/libc/string/Makefile.inc6
-rw-r--r--lib/libc/sys/Makefile.inc6
-rw-r--r--lib/libc_r/sys/Makefile.inc2
-rw-r--r--lib/libcompat/Makefile6
-rw-r--r--lib/libdisk/Makefile2
-rw-r--r--lib/libkse/Makefile6
-rw-r--r--lib/libkse/arch/amd64/Makefile.inc2
-rw-r--r--lib/libkse/arch/arm/Makefile.inc2
-rw-r--r--lib/libkse/arch/i386/Makefile.inc2
-rw-r--r--lib/libkse/arch/ia64/Makefile.inc2
-rw-r--r--lib/libkse/arch/powerpc/Makefile.inc2
-rw-r--r--lib/libkse/arch/sparc64/Makefile.inc2
-rw-r--r--lib/libkse/support/Makefile.inc4
-rw-r--r--lib/libkvm/Makefile7
-rw-r--r--lib/libpmc/Makefile4
-rw-r--r--lib/libstand/Makefile28
-rw-r--r--lib/libthr/Makefile6
-rw-r--r--lib/libthr/arch/amd64/Makefile.inc2
-rw-r--r--lib/libthr/arch/arm/Makefile.inc2
-rw-r--r--lib/libthr/arch/i386/Makefile.inc2
-rw-r--r--lib/libthr/arch/ia64/Makefile.inc2
-rw-r--r--lib/libthr/arch/mips/Makefile.inc2
-rw-r--r--lib/libthr/arch/powerpc/Makefile.inc2
-rw-r--r--lib/libthr/arch/sparc64/Makefile.inc2
-rw-r--r--lib/libthr/support/Makefile.inc4
-rw-r--r--lib/libthread_db/Makefile2
-rw-r--r--lib/msun/Makefile6
-rw-r--r--libexec/rtld-elf/Makefile16
-rw-r--r--libexec/rtld-elf/amd64/Makefile.inc2
-rw-r--r--libexec/rtld-elf/i386/Makefile.inc2
-rw-r--r--rescue/rescue/Makefile8
-rw-r--r--sbin/Makefile70
-rw-r--r--sbin/Makefile.amd644
-rw-r--r--sbin/Makefile.arm4
-rw-r--r--sbin/Makefile.i3865
-rw-r--r--sbin/Makefile.ia643
-rw-r--r--sbin/Makefile.mips4
-rw-r--r--sbin/Makefile.pc985
-rw-r--r--sbin/Makefile.sparc644
-rw-r--r--sbin/atm/atmconfig/Makefile3
-rw-r--r--sbin/bsdlabel/Makefile2
-rw-r--r--sbin/camcontrol/Makefile3
-rw-r--r--sbin/gbde/Makefile5
-rw-r--r--sbin/newfs_msdos/Makefile3
-rw-r--r--sbin/routed/Makefile3
-rw-r--r--sbin/sunlabel/Makefile2
-rw-r--r--secure/lib/libcrypto/Makefile30
-rw-r--r--share/man/man4/Makefile8
-rw-r--r--share/man/man5/Makefile2
-rw-r--r--share/mk/bsd.arch.inc.mk11
-rw-r--r--share/mk/bsd.cpu.mk67
-rw-r--r--share/mk/bsd.endian.mk8
-rw-r--r--share/mk/bsd.lib.mk2
-rw-r--r--share/mk/bsd.sys.mk4
-rw-r--r--share/mk/sys.mk14
-rw-r--r--sys/boot/Makefile8
-rw-r--r--sys/boot/arm/ixp425/boot2/Makefile2
-rw-r--r--sys/boot/arm/uboot/Makefile2
-rw-r--r--sys/boot/arm/uboot/ldscript.armbe134
-rw-r--r--sys/boot/arm/uboot/ldscript.armeb134
-rw-r--r--sys/boot/common/Makefile.inc6
-rw-r--r--sys/boot/efi/libefi/Makefile2
-rw-r--r--sys/boot/ficl/Makefile14
-rw-r--r--sys/boot/i386/Makefile.inc2
-rw-r--r--sys/boot/i386/boot2/Makefile2
-rw-r--r--sys/boot/i386/gptboot/Makefile2
-rw-r--r--sys/boot/i386/gptzfsboot/Makefile2
-rw-r--r--sys/boot/i386/libfirewire/Makefile4
-rw-r--r--sys/boot/i386/libi386/Makefile4
-rw-r--r--sys/boot/i386/loader/Makefile2
-rw-r--r--sys/boot/i386/zfsboot/Makefile2
-rw-r--r--sys/boot/ia64/common/Makefile4
-rw-r--r--sys/boot/ia64/efi/Makefile10
-rw-r--r--sys/boot/ia64/ski/Makefile4
-rw-r--r--sys/boot/ofw/libofw/Makefile4
-rw-r--r--sys/boot/uboot/lib/Makefile2
-rw-r--r--sys/boot/zfs/Makefile12
-rw-r--r--sys/conf/Makefile.mips25
-rw-r--r--sys/conf/Makefile.pc982
-rw-r--r--sys/conf/kern.mk20
-rw-r--r--sys/conf/kern.post.mk12
-rw-r--r--sys/conf/kern.pre.mk4
-rw-r--r--sys/conf/kmod.mk22
-rw-r--r--sys/conf/ldscript.mips.octeon1.322
-rw-r--r--sys/kern/Makefile4
-rw-r--r--sys/kern/kern_sysctl.c2
-rw-r--r--sys/modules/Makefile12
-rw-r--r--sys/modules/aac/Makefile2
-rw-r--r--sys/modules/acpi/acpi/Makefile10
-rw-r--r--sys/modules/agp/Makefile4
-rw-r--r--sys/modules/amr/Makefile2
-rw-r--r--sys/modules/asr/Makefile2
-rw-r--r--sys/modules/bge/Makefile2
-rw-r--r--sys/modules/cpufreq/Makefile2
-rw-r--r--sys/modules/cxgb/Makefile4
-rw-r--r--sys/modules/cyclic/Makefile4
-rw-r--r--sys/modules/dtrace/Makefile4
-rw-r--r--sys/modules/dtrace/Makefile.inc4
-rw-r--r--sys/modules/dtrace/dtrace/Makefile6
-rw-r--r--sys/modules/dtrace/fasttrap/Makefile2
-rw-r--r--sys/modules/hptmv/Makefile4
-rw-r--r--sys/modules/hptrr/Makefile2
-rw-r--r--sys/modules/hwpmc/Makefile12
-rw-r--r--sys/modules/i2c/controllers/pcf/Makefile4
-rw-r--r--sys/modules/io/Makefile2
-rw-r--r--sys/modules/le/Makefile2
-rw-r--r--sys/modules/linprocfs/Makefile2
-rw-r--r--sys/modules/linsysfs/Makefile2
-rw-r--r--sys/modules/linux/Makefile8
-rw-r--r--sys/modules/mem/Makefile8
-rw-r--r--sys/modules/mfi/Makefile2
-rw-r--r--sys/modules/ndis/Makefile4
-rw-r--r--sys/modules/opensolaris/Makefile4
-rw-r--r--sys/modules/ppc/Makefile6
-rw-r--r--sys/modules/procfs/Makefile2
-rw-r--r--sys/modules/scc/Makefile2
-rw-r--r--sys/modules/smbfs/Makefile4
-rw-r--r--sys/modules/sound/driver/Makefile6
-rw-r--r--sys/modules/sound/sound/Makefile2
-rw-r--r--sys/modules/svr4/Makefile2
-rw-r--r--sys/modules/syscons/Makefile4
-rw-r--r--sys/modules/uart/Makefile2
-rw-r--r--sys/modules/usb/Makefile6
-rw-r--r--sys/modules/vx/Makefile2
-rw-r--r--sys/modules/zfs/Makefile4
-rw-r--r--sys/vm/default_pager.c2
-rw-r--r--usr.bin/Makefile12
-rw-r--r--usr.bin/ldd/Makefile2
-rw-r--r--usr.bin/truss/Makefile6
-rw-r--r--usr.bin/xlint/Makefile.inc10
-rw-r--r--usr.sbin/Makefile20
-rw-r--r--usr.sbin/ac/Makefile2
-rw-r--r--usr.sbin/amd/Makefile.inc2
-rw-r--r--usr.sbin/apm/Makefile2
-rw-r--r--usr.sbin/crunch/crunchide/Makefile12
-rw-r--r--usr.sbin/kldxref/Makefile4
-rw-r--r--usr.sbin/sade/Makefile2
-rw-r--r--usr.sbin/sysinstall/Makefile2
-rw-r--r--usr.sbin/tcpdump/tcpdump/Makefile2
180 files changed, 882 insertions, 560 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index fe163ab..eb629f8 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -15,6 +15,7 @@
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
# TARGET="machine" to crossbuild world for a different machine type
+# TARGET_ARCH= may be required when a TARGET supports multiple endians.
#
# The intended user-driven targets are:
@@ -29,8 +30,8 @@
.include <bsd.own.mk>
-.if ${MACHINE_ARCH} == "mips"
-MK_RESCUE=no # not yet
+.if ${MACHINE_CPUARCH} == "mips"
+#MK_RESCUE=no # not yet
.endif
# We must do share/info early so that installation of info `dir'
@@ -120,16 +121,16 @@ VERSION+= ${OSRELDATE}
# Guess machine architecture from machine type, and vice versa.
.if !defined(TARGET_ARCH) && defined(TARGET)
-TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/}
+TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/}
.elif !defined(TARGET) && defined(TARGET_ARCH) && \
${TARGET_ARCH} != ${MACHINE_ARCH}
-TARGET= ${TARGET_ARCH}
+TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm}
.endif
# Otherwise, default to current machine type and architecture.
TARGET?= ${MACHINE}
TARGET_ARCH?= ${MACHINE_ARCH}
-KNOWN_ARCHES?= amd64 arm i386 i386/pc98 ia64 mips powerpc sparc64 sparc64/sun4v
+KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips powerpc sparc64 sparc64/sun4v
.if ${TARGET} == ${TARGET_ARCH}
_t= ${TARGET}
.else
@@ -166,7 +167,7 @@ BUILD_ARCH!= uname -p
.if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING)
OBJTREE= ${MAKEOBJDIRPREFIX}
.else
-OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}
+OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
.endif
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
# /usr/games added for fortune which depend on strfile
@@ -1095,10 +1096,10 @@ _prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc
# all shared libraries for ELF.
#
_startup_libs= gnu/lib/csu
-.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
-_startup_libs+= lib/csu/${MACHINE_ARCH}-elf
+.if exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf)
+_startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf
.else
-_startup_libs+= lib/csu/${MACHINE_ARCH}
+_startup_libs+= lib/csu/${MACHINE_CPUARCH}
.endif
_startup_libs+= gnu/lib/libgcc
_startup_libs+= lib/libc
diff --git a/README-BRANCH b/README-BRANCH
new file mode 100644
index 0000000..73578a4
--- /dev/null
+++ b/README-BRANCH
@@ -0,0 +1,24 @@
+TARGET_BIG_ENDIAN must die
+
+Changes in MACHINE_ARCH:
+
+mips (big endian) mipseb
+mips (little endian) mipsel
+arm (little endian) arm For historical reasons
+arm (big endian) armeb
+
+What we call today MACHINE_ARCH is really MACHINE_CPUARCH. This is
+called MACHINE_CPU on NetBSD, but FreeBSD already uses MACHINE_CPU for
+other purposes. In general $MACHINE_ARCH -> $MACHINE_CPUARCH in most
+places in the tree. MACHINE_CPUARCH is defined in bsd.own.mk, since
+it is dependent on the bsd tree, actually. All the translation from
+MACHINE_ARCH to MACHINE_CPUARCH assumes that all members of that
+family are supported by one set of files on FreeBSD. So mips files
+have support for both big and little endian. But MACHINE_ARCH
+determines the default binaries that are generated.
+
+We'll likely need to have a MACHINE_ABI at some point. Both MIPS and
+ARM have multiple ABIs, and we'll need something to be the default,
+and different CPUs within a family might have different defaults.
+Etc. Plus there's t he need for multilib. However, issues like this
+are beyond the scope of this branch.
diff --git a/bin/Makefile b/bin/Makefile
index 3114e67..95e033c 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -8,7 +8,6 @@ SUBDIR= cat \
chio \
chmod \
cp \
- ${_csh} \
date \
dd \
df \
@@ -29,10 +28,8 @@ SUBDIR= cat \
ps \
pwait \
pwd \
- ${_rcp} \
realpath \
rm \
- ${_rmail} \
rmdir \
setfacl \
sh \
@@ -43,15 +40,19 @@ SUBDIR= cat \
uuidgen
.if ${MK_RCMDS} != "no"
-_rcp= rcp
+SUBDIR += rcp
.endif
.if ${MK_SENDMAIL} != "no"
-_rmail= rmail
+SUBDIR += rmail
.endif
.if ${MK_TCSH} != "no"
-_csh= csh
+SUBDIR += csh
.endif
+.include <bsd.arch.inc.mk>
+
+SUBDIR := ${SUBDIR:O}
+
.include <bsd.subdir.mk>
diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile
index 071d950..e2537ff 100644
--- a/cddl/lib/libdtrace/Makefile
+++ b/cddl/lib/libdtrace/Makefile
@@ -64,9 +64,9 @@ CFLAGS+= -I${.OBJDIR} \
#CFLAGS+= -DYYDEBUG
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
-.elif ${MACHINE_ARCH} == "sparc64"
+.elif ${MACHINE_CPUARCH} == "sparc64"
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
.else
# temporary hack
diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
index fec99d9..808f583 100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@ -11,8 +11,8 @@
# LIST_SRCS
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os
# ATOMIC_SRCS
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64"
-.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "ia64"
+.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_CPUARCH}
ATOMIC_SRCS= opensolaris_atomic.S
.else
.PATH: ${.CURDIR}/../../../sys/cddl/compat/opensolaris/kern
@@ -50,7 +50,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libnvpair
CFLAGS+= -DWANTS_MUTEX_OWNED
CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/thread
CFLAGS+= -I${.CURDIR}/../../../lib/libpthread/sys
-CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_ARCH}/include
+CFLAGS+= -I${.CURDIR}/../../../lib/libthr/arch/${MACHINE_CPUARCH}/include
DPADD= ${LIBPTHREAD} ${LIBZ}
LDADD= -lpthread -lz
diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd
index 034da18..5f115f0 100755
--- a/contrib/binutils/bfd/config.bfd
+++ b/contrib/binutils/bfd/config.bfd
@@ -221,6 +221,10 @@ case "${targ}" in
targ_defvec=bfd_elf32_littlearm_vec
targ_selvecs=bfd_elf32_bigarm_vec
;;
+ armeb-*-freebsd*)
+ targ_defvec=bfd_elf32_bigarm_vec
+ targ_selvecs=bfd_elf32_littlearm_vec
+ ;;
arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
targ_defvec=bfd_elf32_littlearm_vec
diff --git a/contrib/smbfs/Makefile b/contrib/smbfs/Makefile
index 6729780..bb9b296 100644
--- a/contrib/smbfs/Makefile
+++ b/contrib/smbfs/Makefile
@@ -9,7 +9,7 @@
# deinstall-src undo corresponding install-* target
# clean cleanup source tree
-.if ${MACHINE_ARCH} != "i386"
+.if ${MACHINE_CPUARCH} != "i386"
. error "only IA32 machines supported"
.endif
diff --git a/etc/Makefile b/etc/Makefile
index 42221a8..fbed53c 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -23,7 +23,7 @@ BIN1= auth.conf \
.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
BIN1+= etc.${MACHINE}/ttys
.else
-BIN1+= etc.${MACHINE_ARCH}/ttys
+BIN1+= etc.${MACHINE_CPUARCH}/ttys
.endif
OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile
index 382a1ff..eb7ba6e 100644
--- a/gnu/lib/csu/Makefile
+++ b/gnu/lib/csu/Makefile
@@ -23,18 +23,18 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}/config -I${GCCDIR} -I. \
CRTS_CFLAGS= -DCRTSTUFFS_O -DSHARED ${PICFLAG}
MKDEP= -DCRT_BEGIN
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
BEGINSRC= crtbegin.asm
ENDSRC= crtend.asm
CFLAGS+= -x assembler-with-cpp # Ugly hack
CFLAGS+= -include osreldate.h
.undef SRCS # hack for 'make depend'
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
TGTOBJS= crtsavres.o
SRCS+= crtsavres.asm
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
TGTOBJS= crtfastmath.o
SRCS+= crtfastmath.c
.endif
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile
index 51e7630..ff1524b 100644
--- a/gnu/lib/libgcc/Makefile
+++ b/gnu/lib/libgcc/Makefile
@@ -26,7 +26,7 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
LDFLAGS+= -nodefaultlibs
LDADD+= -lc
-OBJS= # added to below in various ways depending on TARGET_ARCH
+OBJS= # added to below in various ways depending on TARGET_CPUARCH
#---------------------------------------------------------------------------
#
@@ -99,7 +99,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
# Platform specific bits.
# When upgrading GCC, get the following definitions from config/<cpu>/t-*
#
-.if ${TARGET_ARCH} == "arm"
+.if ${TARGET_CPUARCH} == "arm"
# from config/arm/t-strongarm-elf
CFLAGS+= -Dinhibit_libc -fno-inline
LIB1ASMSRC = lib1funcs.asm
@@ -115,11 +115,11 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
# _fixsfsi _fixunssfsi _floatdidf _floatdisf
.endif
-.if ${TARGET_ARCH} == "mips"
+.if ${TARGET_CPUARCH} == "mips"
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
.endif
-.if ${TARGET_ARCH} == "ia64"
+.if ${TARGET_CPUARCH} == "ia64"
# from config/ia64/t-ia64
LIB1ASMSRC = lib1funcs.asm
LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
@@ -130,13 +130,13 @@ LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \
LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c
.endif
-.if ${TARGET_ARCH} == "powerpc"
+.if ${TARGET_CPUARCH} == "powerpc"
# from config/rs6000/t-ppccomm
LIB2FUNCS_EXTRA = tramp.asm
LIB2FUNCS_STATIC_EXTRA = eabi.asm
.endif
-.if ${TARGET_ARCH} == "sparc64"
+.if ${TARGET_CPUARCH} == "sparc64"
# from config/sparc/t-elf
LIB1ASMSRC = lb1spc.asm
LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
@@ -183,8 +183,8 @@ OBJ_GRPS = STD DIV
#
# Floating point emulation functions
#
-.if ${TARGET_ARCH} == "armNOT_YET" || \
- ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64"
+.if ${TARGET_CPUARCH} == "armNOT_YET" || \
+ ${TARGET_CPUARCH} == "powerpc" || ${TARGET_CPUARCH} == "sparc64"
FPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES -DFLOAT
DPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES
diff --git a/gnu/lib/libgomp/Makefile b/gnu/lib/libgomp/Makefile
index c8052d5..06a49ae 100644
--- a/gnu/lib/libgomp/Makefile
+++ b/gnu/lib/libgomp/Makefile
@@ -23,8 +23,9 @@ CFLAGS+= -I${.CURDIR} -I. -I${SRCDIR} -I${SRCDIR}/config/posix
VERSION_MAP= ${SRCDIR}/libgomp.map
# Target-specific OpenMP configuration
-.if ${MACHINE_ARCH} == arm || ${MACHINE_ARCH} == i386 || \
- ${MACHINE_ARCH} == mips || ${MACHINE_ARCH} == powerpc
+.if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \
+ ${MACHINE_ARCH} == mipsel || ${MACHINE_ARCH} == mipseb || \
+ ${MACHINE_ARCH} == powerpc
OMP_LOCK_ALIGN = 4
OMP_LOCK_KIND= 4
OMP_LOCK_SIZE= 4
diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile
index 419d51c..bc09857 100644
--- a/gnu/lib/libstdc++/Makefile
+++ b/gnu/lib/libstdc++/Makefile
@@ -13,7 +13,7 @@ LIB= stdc++
SHLIB_MAJOR= 6
CFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1
.endif
CFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include
@@ -66,14 +66,14 @@ SRCS+= del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc eh_arm.cc \
SRCS+= cp-demangle.c
# MD headers location
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
MARCHDIR= sparc
-.elif ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU} != 'i386'
+.elif ${MACHINE_CPUARCH} == "i386" && ${MACHINE_CPU} != 'i386'
MARCHDIR= i486
-.elif ${MACHINE_ARCH} == "amd64"
+.elif ${MACHINE_CPUARCH} == "amd64"
MARCHDIR= i486
.else
-MARCHDIR= ${MACHINE_ARCH}
+MARCHDIR= ${MACHINE_CPUARCH}
.endif
.if exists(${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h)
@@ -82,7 +82,7 @@ ATOMICITY_H= ${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h
ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_mutex/atomicity.h
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
.if exists(${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h)
ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h
.endif
diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile
index cc50659..d177c49 100644
--- a/gnu/usr.bin/Makefile
+++ b/gnu/usr.bin/Makefile
@@ -21,7 +21,7 @@ SUBDIR= ${_binutils} \
sort \
${_texinfo}
-.if ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_CPUARCH} == "mips"
MK_GDB=no # not yet
.endif
diff --git a/gnu/usr.bin/binutils/Makefile.inc0 b/gnu/usr.bin/binutils/Makefile.inc0
index 945c933..2f7e1b3 100644
--- a/gnu/usr.bin/binutils/Makefile.inc0
+++ b/gnu/usr.bin/binutils/Makefile.inc0
@@ -6,13 +6,17 @@
VERSION= "2.15 [FreeBSD] 2004-05-23"
-TARGET_ARCH?= ${MACHINE_ARCH}
-.if ${TARGET_ARCH} == "amd64"
-BINUTILS_ARCH=x86_64
+.if defined(TARGET_ARCH)
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
.else
-BINUTILS_ARCH=${TARGET_ARCH}
+TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif
+TARGET_ARCH?= ${MACHINE_ARCH}
+BINUTILS_ARCH=${TARGET_ARCH:C/amd64/x86_64/}
TARGET_TUPLE?= ${BINUTILS_ARCH}-obrien-freebsd
+.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb"
+TARGET_BIG_ENDIAN=t
+.endif
# RELTOP is the relative path to this point in the source or object
# tree, from any subdirectory of same. It gets extra "../" prefixes
@@ -22,27 +26,27 @@ RELTOP:= ..
RELSRC= ${RELTOP}/../../../contrib/binutils
SRCDIR= ${.CURDIR}/${RELSRC}
-.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "i386" || \
- ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "mips"
+.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \
+ ${TARGET_CPUARCH} == "powerpc" || ${TARGET_CPUARCH} == "mips"
CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32
.else
CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64
.endif
CFLAGS+= -I.
-.if exists(${.CURDIR}/${TARGET_ARCH})
-CFLAGS+= -I${.CURDIR}/${TARGET_ARCH}
+.if exists(${.CURDIR}/${TARGET_CPUARCH})
+CFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH}
.endif
CFLAGS+= -I${.CURDIR}
CFLAGS+= -I${.CURDIR}/${RELTOP}/libbfd
CFLAGS+= -I${.OBJDIR}/${RELTOP}/libbfd
CFLAGS+= -I${SRCDIR}/include
-.if exists(${.CURDIR}/${TARGET_ARCH})
-.PATH: ${.CURDIR}/${TARGET_ARCH}
+.if exists(${.CURDIR}/${TARGET_CPUARCH})
+.PATH: ${.CURDIR}/${TARGET_CPUARCH}
.endif
-ARCHS= ${TARGET_ARCH}
+ARCHS= ${TARGET_CPUARCH}
.for _arch in ${CROSS_ARCH}
.if (${ARCHS:R:M${_arch:R}} == "")
diff --git a/gnu/usr.bin/binutils/as/Makefile b/gnu/usr.bin/binutils/as/Makefile
index cd37311..baac86c 100644
--- a/gnu/usr.bin/binutils/as/Makefile
+++ b/gnu/usr.bin/binutils/as/Makefile
@@ -20,7 +20,7 @@ SRCS+= app.c as.c atof-generic.c atof-ieee.c bignum-copy.c \
# DEO: why not used?
#SRCS+= itbl-ops.c
-.if ${TARGET_ARCH} == "mips"
+.if ${TARGET_CPUARCH} == "mips"
SRCS+= itbl-ops.c itbl-parse.y itbl-lex.l
.endif
@@ -32,7 +32,7 @@ SRCS+= tc-ppc.c
# change back to tc-sparc.c when new binutils is imported
SRCS+= tc-sparc-fixed.c
.else
-SRCS+= tc-${TARGET_ARCH}.c
+SRCS+= tc-${TARGET_CPUARCH}.c
.endif
.if ${TARGET_ARCH} == "sparc64"
@@ -49,7 +49,7 @@ CFLAGS+= -DTARGET_ALIAS=\"${TARGET_TUPLE}\"
CFLAGS+= -DVERSION=\"${VERSION}\"
CFLAGS+= -D_GNU_SOURCE
CFLAGS+= -I${SRCDIR}/gas -I${SRCDIR}/gas/config -I${SRCDIR}
-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_ARCH}-freebsd
+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd
NO_SHARED?= yes
diff --git a/gnu/usr.bin/binutils/gdb/Makefile b/gnu/usr.bin/binutils/gdb/Makefile
index ecf8cce..141b043 100644
--- a/gnu/usr.bin/binutils/gdb/Makefile
+++ b/gnu/usr.bin/binutils/gdb/Makefile
@@ -8,13 +8,7 @@ GDBDIR= ${.CURDIR}/../../../../contrib/gdb
.PATH: ${SRCDIR}/opcodes ${SRCDIR}/binutils
# For FSF GDB files, use their CPU (arch) name; for our files use ours.
-.if ${TARGET_ARCH} == "sparc64"
-GDB_CPU= sparc
-.elif ${TARGET_ARCH} == "amd64"
-GDB_CPU= i386
-.else
-GDB_CPU= ${TARGET_ARCH}
-.endif
+GDB_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc/rs6000/:C/sparc64/sparc/}
NO_SHARED?=yes
PROG= gdb
@@ -55,7 +49,7 @@ WARNS?= 0
CFLAGS+= -DCROSS_COMPILE=1
.endif
CFLAGS+= -DDEFAULT_BFD_ARCH=bfd_${GDB_CPU}_arch
-CFLAGS+= -I${.CURDIR}/${TARGET_ARCH}
+CFLAGS+= -I${.CURDIR}/${TARGET_CPUARCH}
CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd
CFLAGS+= -I${GDBDIR}/gdb -I${GDBDIR}/gdb/config
CFLAGS+= -I$(.CURDIR)
@@ -121,8 +115,8 @@ init.c: ${XSRCS}
tm.h:
echo '#include "${GDB_CPU}/tm-fbsd.h"' > ${.TARGET}
-.if exists(${.CURDIR}/fbsd-kgdb-${TARGET_ARCH}.h)
- echo '#include "fbsd-kgdb-${TARGET_ARCH}.h"' >> ${.TARGET}
+.if exists(${.CURDIR}/fbsd-kgdb-${TARGET_CPUARCH}.h)
+ echo '#include "fbsd-kgdb-${TARGET_CPUARCH}.h"' >> ${.TARGET}
.endif
.for H in nm-fbsd xm-${GDB_CPU}
@@ -131,7 +125,7 @@ ${H:C/-.*$//}.h:
.endfor
kvm-fbsd-machine.h:
- ln -sf ${.CURDIR}/kvm-fbsd-${TARGET_ARCH}.h ${.TARGET}
+ ln -sf ${.CURDIR}/kvm-fbsd-${TARGET_CPUARCH}.h ${.TARGET}
GDB_VERSION= "5.2.1 (FreeBSD)"
gdbversion.c: Makefile
diff --git a/gnu/usr.bin/binutils/ld/Makefile.arm b/gnu/usr.bin/binutils/ld/Makefile.arm
index b4d9d69..870fcec 100644
--- a/gnu/usr.bin/binutils/ld/Makefile.arm
+++ b/gnu/usr.bin/binutils/ld/Makefile.arm
@@ -1,6 +1,6 @@
# $FreeBSD$
-.if defined(TARGET_BIG_ENDIAN)
+.if ${TARGET_ARCH} == "armeb"
NATIVE_EMULATION= armelfb_fbsd
.else
NATIVE_EMULATION= armelf_fbsd
diff --git a/gnu/usr.bin/binutils/ld/Makefile.mips b/gnu/usr.bin/binutils/ld/Makefile.mips
index 785d733..f1c0493 100644
--- a/gnu/usr.bin/binutils/ld/Makefile.mips
+++ b/gnu/usr.bin/binutils/ld/Makefile.mips
@@ -1,10 +1,8 @@
# $FreeBSD$
-#xxxIMPxxx: size?
-#xxxIMPxxx: TARGET_BIG_ENDIAN is lame. We should use the netbsd convention
-# of mipsel and mips.
+# XXX still need to swizle in size
_sz?=32
-.if defined(TARGET_BIG_ENDIAN)
+.if ${TARGET_ARCH} == "mipseb"
NATIVE_EMULATION=elf${_sz}btsmip_fbsd
.else
NATIVE_EMULATION=elf${_sz}ltsmip_fbsd
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.arm b/gnu/usr.bin/binutils/libbfd/Makefile.arm
index 7349375..b14b7f1 100644
--- a/gnu/usr.bin/binutils/libbfd/Makefile.arm
+++ b/gnu/usr.bin/binutils/libbfd/Makefile.arm
@@ -1,6 +1,6 @@
# $FreeBSD$
-.if defined(TARGET_BIG_ENDIAN)
+.if ${TARGET_ARCH} == "armeb"
DEFAULT_VECTOR= bfd_elf32_bigarm_vec
.else
DEFAULT_VECTOR= bfd_elf32_littlearm_vec
@@ -14,7 +14,7 @@ SRCS+= cpu-arm.c \
elflink.c
VECS+= ${DEFAULT_VECTOR}
-.if defined(TARGET_BIG_ENDIAN)
+.if ${TARGET_ARCH} == "armeb"
VECS+= bfd_elf32_littlearm_vec
.else
VECS+= bfd_elf32_bigarm_vec
diff --git a/gnu/usr.bin/binutils/libbfd/Makefile.mips b/gnu/usr.bin/binutils/libbfd/Makefile.mips
index 6f03eb7..d40ef42 100644
--- a/gnu/usr.bin/binutils/libbfd/Makefile.mips
+++ b/gnu/usr.bin/binutils/libbfd/Makefile.mips
@@ -1,7 +1,10 @@
# $FreeBSD$
-#xxxIMPxxx: endian and size
+.if ${TARGET_ARCH} == "mipsel"
+DEFAULT_VECTOR= bfd_elf32_tradlittlemips_vec
+.else
DEFAULT_VECTOR= bfd_elf32_tradbigmips_vec
+.endif
SRCS+= coff-mips.c \
cpu-mips.c \
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index d7ed8a8..22b7507 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -30,6 +30,13 @@ CFLAGS+= -DLONG_TYPE_SIZE=${LONG_TYPE_SIZE}
CFLAGS+= -DCROSS_COMPILE
.endif
+.if ${TARGET_ARCH} == "armeb"
+CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
+.endif
+.if ${TARGET_ARCH} == "mipsel"
+CFLAGS += -DTARGET_ENDIAN_DEFAULT=0
+.endif
+
.if defined(WANT_FORCE_OPTIMIZATION_DOWNGRADE)
CFLAGS+= -DFORCE_OPTIMIZATION_DOWNGRADE=${WANT_FORCE_OPTIMIZATION_DOWNGRADE}
.endif
diff --git a/gnu/usr.bin/cc/Makefile.tgt b/gnu/usr.bin/cc/Makefile.tgt
index 3cb9678..b6c6abe 100644
--- a/gnu/usr.bin/cc/Makefile.tgt
+++ b/gnu/usr.bin/cc/Makefile.tgt
@@ -1,16 +1,15 @@
# $FreeBSD$
-TARGET_ARCH?= ${MACHINE_ARCH}
+# These assignments duplicate much of the functionality of
+# MACHINE_CPUARCH, but there's no easy way to export make functions...
-.if ${TARGET_ARCH} == "amd64"
-GCC_CPU= i386
-.elif ${TARGET_ARCH} == "powerpc"
-GCC_CPU= rs6000
-.elif ${TARGET_ARCH} == "sparc64"
-GCC_CPU= sparc
+.if defined(TARGET_ARCH)
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
.else
-GCC_CPU= ${TARGET_ARCH}
+TARGET_CPUARCH=${MACHINE_CPUARCH}
.endif
+TARGET_ARCH?= ${MACHINE_ARCH}
+GCC_CPU=${TARGET_CPUARCH:C/amd64/i386/:C/powerpc/rs6000/:C/sparc64/sparc/}
.if ${TARGET_ARCH} == "ia64"
TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD
@@ -18,3 +17,6 @@ TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD
.if ${TARGET_ARCH} == "sparc64"
TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc
.endif
+.if ${TARGET_ARCH} == "armeb" || ${TARGET_ARCH} == "mipseb"
+TARGET_BIG_ENDIAN=t
+.endif
diff --git a/gnu/usr.bin/cc/cc_int/Makefile b/gnu/usr.bin/cc/cc_int/Makefile
index a7ec17c..7082c3e 100644
--- a/gnu/usr.bin/cc/cc_int/Makefile
+++ b/gnu/usr.bin/cc/cc_int/Makefile
@@ -75,10 +75,6 @@ OBJS-md+= ${GCC_CPU}-c.o
# Target specific, C specific object file
C_TARGET_OBJS=
-.if ${TARGET_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
-CFLAGS += -DTARGET_ENDIAN_DEFAULT=MASK_BIG_END
-.endif
-
# Language-specific object files for C and Objective C.
C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o \
diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile
index f248313..ea128ef 100644
--- a/gnu/usr.bin/cc/cc_tools/Makefile
+++ b/gnu/usr.bin/cc/cc_tools/Makefile
@@ -22,13 +22,13 @@ LIBIBERTY= libiberty.a
# The list of headers to go into tm.h
#
TARGET_INC+= options.h
-.if ${TARGET_ARCH} == "amd64"
+.if ${TARGET_CPUARCH} == "amd64"
TARGET_INC+= i386/biarch64.h
.endif
-.if ${TARGET_ARCH} != "arm"
+.if ${TARGET_CPUARCH} != "arm"
TARGET_INC+= ${GCC_CPU}/${GCC_CPU}.h
.endif
-.if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64"
+.if ${TARGET_CPUARCH} == "i386" || ${TARGET_CPUARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/unix.h
TARGET_INC+= ${GCC_CPU}/att.h
.endif
@@ -38,25 +38,25 @@ TARGET_INC+= elfos.h
TARGET_INC+= freebsd-native.h
TARGET_INC+= freebsd-spec.h
TARGET_INC+= freebsd.h
-.if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64"
+.if ${TARGET_CPUARCH} != "i386" && ${TARGET_CPUARCH} != "amd64"
. if exists(${GCCDIR}/config/${GCC_CPU}/sysv4.h)
TARGET_INC+= ${GCC_CPU}/sysv4.h
. endif
.endif
-.if ${TARGET_ARCH} == "amd64"
+.if ${TARGET_CPUARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/x86-64.h
.endif
-.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "mips"
+.if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "mips"
TARGET_INC+= ${GCC_CPU}/elf.h
.endif
-.if ${TARGET_ARCH} == "arm"
+.if ${TARGET_CPUARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/aout.h
.endif
TARGET_INC+= ${GCC_CPU}/freebsd.h
-.if ${TARGET_ARCH} == "amd64"
+.if ${TARGET_CPUARCH} == "amd64"
TARGET_INC+= ${GCC_CPU}/freebsd64.h
.endif
-.if ${TARGET_ARCH} == "arm"
+.if ${TARGET_CPUARCH} == "arm"
TARGET_INC+= ${GCC_CPU}/arm.h
.endif
TARGET_INC+= defaults.h
@@ -171,11 +171,11 @@ OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/${GCC_CPU}.opt
OPT_FILES+= ${.CURDIR}/${GCC_CPU}-freebsd.opt
.endif
-.if ${TARGET_ARCH} == "powerpc"
+.if ${TARGET_CPUARCH} == "powerpc"
OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/sysv4.opt
.endif
-.if ${TARGET_ARCH} == "sparc64"
+.if ${TARGET_CPUARCH} == "sparc64"
OPT_FILES+= ${GCCDIR}/config/${GCC_CPU}/long-double-switch.opt
.endif
diff --git a/gnu/usr.bin/gdb/Makefile b/gnu/usr.bin/gdb/Makefile
index 4c10759..33f81cb 100644
--- a/gnu/usr.bin/gdb/Makefile
+++ b/gnu/usr.bin/gdb/Makefile
@@ -2,7 +2,7 @@
SUBDIR= doc libgdb gdb gdbtui kgdb
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc"
+.if exists(${.CURDIR}/gdbserver/reg-${MACHINE_CPUARCH}.c)
SUBDIR+=gdbserver
.endif
diff --git a/gnu/usr.bin/gdb/Makefile.inc b/gnu/usr.bin/gdb/Makefile.inc
index abb5296..c5dcfc7 100644
--- a/gnu/usr.bin/gdb/Makefile.inc
+++ b/gnu/usr.bin/gdb/Makefile.inc
@@ -16,8 +16,16 @@ OBJ_ROOT= ${.OBJDIR}/../..
OBJ_BU= ${OBJ_ROOT}/binutils
OBJ_GDB= ${OBJ_ROOT}/gdb
-TARGET_ARCH?= ${MACHINE_ARCH}
-TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_ARCH}
+# These assignments duplicate much of the functionality of
+# MACHINE_CPUARCH, but there's no easy way to export make functions...
+
+.if defined(TARGET_ARCH)
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+.else
+TARGET_CPUARCH=${MACHINE_CPUARCH}
+.endif
+TARGET_ARCH?= ${MACHINE_ARCH}
+TARGET_SUBDIR= ${BMAKE_GDB}/arch/${TARGET_CPUARCH}
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
GDB_CROSS_DEBUGGER=
@@ -31,7 +39,7 @@ GDB_CROSS_DEBUGGER=
CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1
CFLAGS+= -I.
CFLAGS+= -I${TARGET_SUBDIR}
-CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_ARCH}
+CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_CPUARCH}
CFLAGS+= -I${CNTRB_GDB}/gdb
CFLAGS+= -I${CNTRB_GDB}/gdb/config
CFLAGS+= -I${CNTRB_GDB}/include
diff --git a/gnu/usr.bin/gdb/gdbserver/Makefile b/gnu/usr.bin/gdb/gdbserver/Makefile
index 9f84f6f..5df2341 100644
--- a/gnu/usr.bin/gdb/gdbserver/Makefile
+++ b/gnu/usr.bin/gdb/gdbserver/Makefile
@@ -14,19 +14,13 @@ SRCS= inferiors.c mem-break.c regcache.c remote-utils.c \
server.c signals.c target.c utils.c
SRCS+= fbsd-low.c
-.if ${MACHINE_ARCH} == "i386"
-SRCS+= fbsd-i386-low.c i387-fp.c reg-i386.c
-.endif
-
-.if ${MACHINE_ARCH} == "arm"
-SRCS+= fbsd-arm-low.c reg-arm.c
-.endif
+SRCS+= fbsd-${MACHINE_CPUARCH}-low.c reg-${MACHINE_CPUARCH}.c
-.if ${MACHINE_ARCH} == "powerpc"
-SRCS+= fbsd-ppc-low.c reg-ppc.c
+.if ${MACHINE_CPUARCH} == "i386"
+SRCS+= i387-fp.c
.endif
-#CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_ARCH}
+#CFLAGS+= -I${.CURDIR}/../arch/${MACHINE_CPUARCH}
CFLAGS+= -I${GDBDIR}/gdb/gdbserver
CFLAGS+= -I${GDBDIR}/gdb/regformats
CFLAGS+= -DNO_MMALLOC -DGDBSERVER
diff --git a/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c b/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c
index 35f7ac6..35f7ac6 100644
--- a/gnu/usr.bin/gdb/gdbserver/fbsd-ppc-low.c
+++ b/gnu/usr.bin/gdb/gdbserver/fbsd-powerpc-low.c
diff --git a/gnu/usr.bin/gdb/gdbserver/reg-ppc.c b/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c
index 4704663..4704663 100644
--- a/gnu/usr.bin/gdb/gdbserver/reg-ppc.c
+++ b/gnu/usr.bin/gdb/gdbserver/reg-powerpc.c
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile
index 955394a..1372f17 100644
--- a/gnu/usr.bin/gdb/kgdb/Makefile
+++ b/gnu/usr.bin/gdb/kgdb/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PROG= kgdb${GDB_SUFFIX}
-SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_ARCH}.c
+SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c
WARNS?= 2
BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
diff --git a/gnu/usr.bin/gdb/libgdb/Makefile b/gnu/usr.bin/gdb/libgdb/Makefile
index 8c22a1a..bb18a8e 100644
--- a/gnu/usr.bin/gdb/libgdb/Makefile
+++ b/gnu/usr.bin/gdb/libgdb/Makefile
@@ -1,6 +1,14 @@
# $FreeBSD$
-TARGET_ARCH?= ${MACHINE_ARCH}
+# These assignments duplicate much of the functionality of
+# MACHINE_CPUARCH, but there's no easy way to export make functions...
+
+.if defined(TARGET_ARCH)
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+.else
+TARGET_CPUARCH=${MACHINE_CPUARCH}
+.endif
+TARGET_ARCH?= ${MACHINE_ARCH}
LIB= gdb
INTERNALLIB=
diff --git a/include/Makefile b/include/Makefile
index c964827..64c029d 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -115,8 +115,8 @@ INCSLINKS+= machine/$i ${INCLUDEDIR}/$i
INCSLINKS+= sys/$i ${INCLUDEDIR}/$i
.endfor
-.if ${MACHINE} != ${MACHINE_ARCH}
-_MARCH=${MACHINE_ARCH}
+.if ${MACHINE} != ${MACHINE_CPUARCH}
+_MARCH=${MACHINE_CPUARCH}
.endif
.include <bsd.prog.mk>
diff --git a/lib/Makefile b/lib/Makefile
index c661a4b..9134917 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -43,10 +43,10 @@ SUBDIR= ${_csu} libc libbsm libauditd libcom_err libcrypt libelf libkvm msun \
${_libusbhid} ${_libusb} ${_libvgl} libwrap liby libz \
${_bind}
-.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
-_csu=csu/${MACHINE_ARCH}-elf
-.elif exists(${.CURDIR}/csu/${MACHINE_ARCH}/Makefile)
-_csu=csu/${MACHINE_ARCH}
+.if exists(${.CURDIR}/csu/${MACHINE_CPUARCH}-elf)
+_csu=csu/${MACHINE_CPUARCH}-elf
+.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
+_csu=csu/${MACHINE_CPUARCH}
.else
_csu=csu
.endif
@@ -95,7 +95,7 @@ _libnetgraph= libnetgraph
_libypclnt= libypclnt
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
.if ${MK_NCP} != "no"
_libncp= libncp
.endif
@@ -103,12 +103,12 @@ _libsmb= libsmb
_libvgl= libvgl
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
_libefi= libefi
_libsmb= libsmb
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
.if ${MK_NCP} != "no"
_libncp= libncp
.endif
@@ -116,11 +116,11 @@ _libsmb= libsmb
_libvgl= libvgl
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
_libsmb= libsmb
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
_libsmb= libsmb
.endif
diff --git a/lib/bind/config.mk b/lib/bind/config.mk
index a50d348..20a2fef 100644
--- a/lib/bind/config.mk
+++ b/lib/bind/config.mk
@@ -1,6 +1,7 @@
# $FreeBSD$
.include <bsd.own.mk>
+.include <bsd.endian.mk>
# BIND version number
.if defined(BIND_DIR) && exists(${BIND_DIR}/version)
@@ -45,7 +46,7 @@ CFLAGS+= -DOPENSSL
CFLAGS+= -DUSE_MD5
# Endianness
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
+.if ${TARGET_ENDIANNESS} == 4321
CFLAGS+= -DWORDS_BIGENDIAN
.endif
@@ -64,10 +65,10 @@ CFLAGS+= -I${LIB_BIND_DIR}
.endif
# Use the right version of the atomic.h file from lib/isc
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
ISC_ATOMIC_ARCH= x86_32
.else
-ISC_ATOMIC_ARCH= ${MACHINE_ARCH}
+ISC_ATOMIC_ARCH= ${MACHINE_CPUARCH}
.endif
# Optional features
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index b58b6cb..0747368 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -15,7 +15,7 @@ LIB=c
SHLIB_MAJOR= 7
WARNS?= 2
CFLAGS+=-I${.CURDIR}/include -I${.CURDIR}/../../include
-CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH}
+CFLAGS+=-I${.CURDIR}/${MACHINE_CPUARCH}
CFLAGS+=-DNLS
CLEANFILES+=tags
INSTALL_PIC_ARCHIVE=
@@ -36,7 +36,7 @@ MDASM=
MIASM=
NOASM=
-.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
+.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc"
.include "${.CURDIR}/db/Makefile.inc"
.include "${.CURDIR}/compat-43/Makefile.inc"
.include "${.CURDIR}/gdtoa/Makefile.inc"
@@ -49,9 +49,9 @@ NOASM=
.include "${.CURDIR}/net/Makefile.inc"
.include "${.CURDIR}/nls/Makefile.inc"
.include "${.CURDIR}/posix1e/Makefile.inc"
-.if ${MACHINE_ARCH} != "amd64" && \
- ${MACHINE_ARCH} != "ia64" && \
- ${MACHINE_ARCH} != "sparc64"
+.if ${MACHINE_CPUARCH} != "amd64" && \
+ ${MACHINE_CPUARCH} != "ia64" && \
+ ${MACHINE_CPUARCH} != "sparc64"
.include "${.CURDIR}/quad/Makefile.inc"
.endif
.include "${.CURDIR}/regex/Makefile.inc"
@@ -64,7 +64,7 @@ NOASM=
.include "${.CURDIR}/rpc/Makefile.inc"
.include "${.CURDIR}/uuid/Makefile.inc"
.include "${.CURDIR}/xdr/Makefile.inc"
-.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
.include "${.CURDIR}/softfloat/Makefile.inc"
.endif
.if ${MK_NIS} != "no"
@@ -109,16 +109,16 @@ KQSRCS= adddi3.c anddi3.c ashldi3.c ashrdi3.c cmpdi2.c divdi3.c iordi3.c \
KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c index.c mcount.c rindex.c \
strcat.c strcmp.c strcpy.c strlen.c strncpy.c
-libkern: libkern.gen libkern.${MACHINE_ARCH}
+libkern: libkern.gen libkern.${MACHINE_CPUARCH}
libkern.gen: ${KQSRCS} ${KSRCS}
cp -p ${.CURDIR}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
-libkern.${MACHINE_ARCH}:: ${KMSRCS}
+libkern.${MACHINE_CPUARCH}:: ${KMSRCS}
.if defined(KMSRCS) && !empty(KMSRCS)
- cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH}
+ cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_CPUARCH}
.endif
-
+
.include <bsd.lib.mk>
# Disable warnings in contributed sources.
diff --git a/lib/libc/compat-43/Makefile.inc b/lib/libc/compat-43/Makefile.inc
index 8505ff2..e8ec364 100644
--- a/lib/libc/compat-43/Makefile.inc
+++ b/lib/libc/compat-43/Makefile.inc
@@ -2,7 +2,7 @@
# $FreeBSD$
# compat-43 sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/compat-43 ${.CURDIR}/compat-43
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/compat-43 ${.CURDIR}/compat-43
SRCS+= creat.c gethostid.c getwd.c killpg.c sethostid.c setpgrp.c \
setrgid.c setruid.c sigcompat.c
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 2f562da..e849891 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -2,7 +2,7 @@
# $FreeBSD$
# machine-independent gen sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/gen ${.CURDIR}/gen
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/gen ${.CURDIR}/gen
SRCS+= __getosreldate.c __xuname.c \
_once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \
@@ -38,8 +38,8 @@ SRCS+= __getosreldate.c __xuname.c \
SYM_MAPS+=${.CURDIR}/gen/Symbol.map
# machine-dependent gen sources
-.if exists(${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/gen/Makefile.inc"
+.if exists(${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc)
+.include "${.CURDIR}/${MACHINE_CPUARCH}/gen/Makefile.inc"
.endif
MAN+= alarm.3 arc4random.3 \
diff --git a/lib/libc/locale/Makefile.inc b/lib/libc/locale/Makefile.inc
index 074c4d9..8cf5beb 100644
--- a/lib/libc/locale/Makefile.inc
+++ b/lib/libc/locale/Makefile.inc
@@ -2,7 +2,7 @@
# $FreeBSD$
# locale sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/locale ${.CURDIR}/locale
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/locale ${.CURDIR}/locale
SRCS+= ascii.c big5.c btowc.c collate.c collcmp.c euc.c fix_grouping.c \
gb18030.c gb2312.c gbk.c isctype.c iswctype.c \
diff --git a/lib/libc/quad/Makefile.inc b/lib/libc/quad/Makefile.inc
index 14a5b1f..84723a7 100644
--- a/lib/libc/quad/Makefile.inc
+++ b/lib/libc/quad/Makefile.inc
@@ -2,9 +2,9 @@
# $FreeBSD$
# Quad support, if needed
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/quad ${.CURDIR}/quad
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/quad ${.CURDIR}/quad
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= cmpdi2.c divdi3.c moddi3.c qdivrem.c ucmpdi2.c udivdi3.c umoddi3.c
diff --git a/lib/libc/softfloat/Makefile.inc b/lib/libc/softfloat/Makefile.inc
index c786761..c3df0ae 100644
--- a/lib/libc/softfloat/Makefile.inc
+++ b/lib/libc/softfloat/Makefile.inc
@@ -2,10 +2,10 @@
# $FreeBSD$
SOFTFLOAT_BITS?=64
-.PATH: ${MACHINE_ARCH}/softfloat \
+.PATH: ${MACHINE_CPUARCH}/softfloat \
${.CURDIR}/softfloat/bits${SOFTFLOAT_BITS} ${.CURDIR}/softfloat
-CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH}/softfloat -I${.CURDIR}/softfloat
+CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH}/softfloat -I${.CURDIR}/softfloat
CFLAGS+= -DSOFTFLOAT_FOR_GCC
SRCS+= softfloat.c
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 1d06dd3..d26f66a 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -2,7 +2,7 @@
# $FreeBSD$
# machine-independent stdlib sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/stdlib ${.CURDIR}/stdlib
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/stdlib ${.CURDIR}/stdlib
MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \
@@ -16,7 +16,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \
SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map
# machine-dependent stdlib sources
-.sinclude "${.CURDIR}/${MACHINE_ARCH}/stdlib/Makefile.inc"
+.sinclude "${.CURDIR}/${MACHINE_CPUARCH}/stdlib/Makefile.inc"
MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index b0a1899..96759d5 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -1,7 +1,7 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/string ${.CURDIR}/string
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/string ${.CURDIR}/string
CFLAGS+= -I${.CURDIR}/locale
@@ -26,8 +26,8 @@ SYM_MAPS+= ${.CURDIR}/string/Symbol.map
# machine-dependent string sources
-.if exists(${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/string/Makefile.inc"
+.if exists(${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc)
+.include "${.CURDIR}/${MACHINE_CPUARCH}/string/Makefile.inc"
.endif
MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 ffs.3 index.3 memccpy.3 memchr.3 \
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 1915c55..05c3e17 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -2,7 +2,7 @@
# $FreeBSD$
# sys sources
-.PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}/sys ${.CURDIR}/sys
# Include the generated makefile containing the *complete* list
# of syscall names in MIASM.
@@ -13,8 +13,8 @@
# MDASM names override the default syscall names in MIASM.
# NOASM will prevent the default syscall code from being generated.
#
-.if exists(${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc"
+.if exists(${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc)
+.include "${.CURDIR}/${MACHINE_CPUARCH}/sys/Makefile.inc"
.endif
# Sources common to both syscall interfaces:
diff --git a/lib/libc_r/sys/Makefile.inc b/lib/libc_r/sys/Makefile.inc
index e608afa..ab6db1f 100644
--- a/lib/libc_r/sys/Makefile.inc
+++ b/lib/libc_r/sys/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/sys ${.CURDIR}/arch/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/sys ${.CURDIR}/arch/${MACHINE_CPUARCH}
SRCS+= uthread_error.c _atomic_lock.S
diff --git a/lib/libcompat/Makefile b/lib/libcompat/Makefile
index 2ca46f0..fe50165 100644
--- a/lib/libcompat/Makefile
+++ b/lib/libcompat/Makefile
@@ -7,9 +7,9 @@ NO_PIC=
WARNS?= 1
-.PATH: ${.CURDIR}/4.1/${MACHINE_ARCH} ${.CURDIR}/4.1 \
- ${.CURDIR}/4.3/${MACHINE_ARCH} ${.CURDIR}/4.3 \
- ${.CURDIR}/4.4/${MACHINE_ARCH} ${.CURDIR}/4.4 \
+.PATH: ${.CURDIR}/4.1/${MACHINE_CPUARCH} ${.CURDIR}/4.1 \
+ ${.CURDIR}/4.3/${MACHINE_CPUARCH} ${.CURDIR}/4.3 \
+ ${.CURDIR}/4.4/${MACHINE_CPUARCH} ${.CURDIR}/4.4 \
${.CURDIR}/regexp
# compat 4.1 sources
diff --git a/lib/libdisk/Makefile b/lib/libdisk/Makefile
index 763170d..47cf372 100644
--- a/lib/libdisk/Makefile
+++ b/lib/libdisk/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
_open_disk= open_ia64_disk.c
.else
_change = change.c
diff --git a/lib/libkse/Makefile b/lib/libkse/Makefile
index c4e2b5a..305cf17 100644
--- a/lib/libkse/Makefile
+++ b/lib/libkse/Makefile
@@ -15,10 +15,10 @@ SHLIB_MAJOR= 4
CFLAGS+=-DPTHREAD_KERNEL
CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \
-I${.CURDIR}/../../include
-CFLAGS+=-I${.CURDIR}/arch/${MACHINE_ARCH}/include
+CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include
CFLAGS+=-I${.CURDIR}/sys
CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf
-CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH}
+CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH}
CFLAGS+=-fno-builtin
# Uncomment this if you want libkse to contain debug information for
@@ -38,7 +38,7 @@ SYMBOL_MAPS=${.CURDIR}/kse.map
PRECIOUSLIB=
-.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
+.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
.include "${.CURDIR}/support/Makefile.inc"
.include "${.CURDIR}/sys/Makefile.inc"
.include "${.CURDIR}/thread/Makefile.inc"
diff --git a/lib/libkse/arch/amd64/Makefile.inc b/lib/libkse/arch/amd64/Makefile.inc
index c8b0362..fdd4ef3 100644
--- a/lib/libkse/arch/amd64/Makefile.inc
+++ b/lib/libkse/arch/amd64/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= context.S enter_uts.S pthread_md.c
diff --git a/lib/libkse/arch/arm/Makefile.inc b/lib/libkse/arch/arm/Makefile.inc
index ced7063..b6bef82 100644
--- a/lib/libkse/arch/arm/Makefile.inc
+++ b/lib/libkse/arch/arm/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
CFLAGS+=-DSYSTEM_SCOPE_ONLY
diff --git a/lib/libkse/arch/i386/Makefile.inc b/lib/libkse/arch/i386/Makefile.inc
index 73a9a8a..886ff43 100644
--- a/lib/libkse/arch/i386/Makefile.inc
+++ b/lib/libkse/arch/i386/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= thr_enter_uts.S thr_getcontext.S pthread_md.c
diff --git a/lib/libkse/arch/ia64/Makefile.inc b/lib/libkse/arch/ia64/Makefile.inc
index c8b0362..fdd4ef3 100644
--- a/lib/libkse/arch/ia64/Makefile.inc
+++ b/lib/libkse/arch/ia64/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= context.S enter_uts.S pthread_md.c
diff --git a/lib/libkse/arch/powerpc/Makefile.inc b/lib/libkse/arch/powerpc/Makefile.inc
index f4417a6..99c6ddd 100644
--- a/lib/libkse/arch/powerpc/Makefile.inc
+++ b/lib/libkse/arch/powerpc/Makefile.inc
@@ -3,6 +3,6 @@
# XXX temporary
CFLAGS+=-DSYSTEM_SCOPE_ONLY
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= enter_uts.S context.S pthread_md.c
diff --git a/lib/libkse/arch/sparc64/Makefile.inc b/lib/libkse/arch/sparc64/Makefile.inc
index 07107b4..6371709 100644
--- a/lib/libkse/arch/sparc64/Makefile.inc
+++ b/lib/libkse/arch/sparc64/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= pthread_md.c thr_getcontext.S
diff --git a/lib/libkse/support/Makefile.inc b/lib/libkse/support/Makefile.inc
index 956667f..6542f7a 100644
--- a/lib/libkse/support/Makefile.inc
+++ b/lib/libkse/support/Makefile.inc
@@ -1,9 +1,9 @@
# $FreeBSD$
.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string
-.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys
+.PATH: ${.CURDIR}/../libc/${MACHINE_CPUARCH}/sys
-CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH}
+CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH}
SYSCALLS= clock_gettime \
kse_create \
diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile
index 0cb3ad7..bca05b0 100644
--- a/lib/libkvm/Makefile
+++ b/lib/libkvm/Makefile
@@ -11,10 +11,11 @@ CFLAGS+=-DSUN4V
WARNS?= 0
-SRCS= kvm.c kvm_${MACHINE_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \
+SRCS= kvm.c kvm_${MACHINE_CPUARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \
kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "arm"
-SRCS+= kvm_minidump_${MACHINE_ARCH}.c
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
+ ${MACHINE_CPUARCH} == "arm"
+SRCS+= kvm_minidump_${MACHINE_CPUARCH}.c
.endif
INCS= kvm.h
diff --git a/lib/libpmc/Makefile b/lib/libpmc/Makefile
index 09a23e3..3f49eb4 100644
--- a/lib/libpmc/Makefile
+++ b/lib/libpmc/Makefile
@@ -22,7 +22,7 @@ MAN+= pmc_start.3
MAN+= pmclog.3
# PMC-dependent manual pages
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
MAN+= pmc.atom.3
MAN+= pmc.core.3
MAN+= pmc.core2.3
@@ -33,7 +33,7 @@ MAN+= pmc.p4.3
MAN+= pmc.p5.3
MAN+= pmc.p6.3
MAN+= pmc.tsc.3
-.elif ${MACHINE_ARCH} == "arm" && ${CPUTYPE} == "xscale"
+.elif ${MACHINE_CPUARCH} == "arm" && ${CPUTYPE} == "xscale"
MAN+= pmc.xscale.3
.endif
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 1e4f977..44a0885 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -20,23 +20,23 @@ WARNS?= 0
CFLAGS+= -ffreestanding -Wformat
CFLAGS+= -I${.CURDIR}
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -mno-sse3
.endif
.if ${MACHINE} == "pc98"
CFLAGS+= -Os
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
CFLAGS+= -msoft-float -D_STANDALONE
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32 -I.
.endif
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -msoft-float -D_STANDALONE
.endif
@@ -54,19 +54,19 @@ SRCS+= ntoh.c
# string functions from libc
.PATH: ${.CURDIR}/../libc/string
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
- ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "amd64" || \
- ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \
+ ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \
+ ${MACHINE_CPUARCH} == "arm"
SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \
memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \
strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \
strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
.endif
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm"
.PATH: ${.CURDIR}/../libc/arm/gen
SRCS+= divsi3.S
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
.PATH: ${.CURDIR}/../libc/ia64/string
SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
@@ -78,7 +78,7 @@ SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
.PATH: ${.CURDIR}/../libc/quad
SRCS+= ashldi3.c ashrdi3.c
.PATH: ${.CURDIR}/../libc/powerpc/gen
@@ -90,10 +90,10 @@ SRCS+= syncicache.c
SRCS+= uuid_equal.c uuid_is_nil.c
# _setjmp/_longjmp
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
.PATH: ${.CURDIR}/i386
.else
-.PATH: ${.CURDIR}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}
.endif
SRCS+= _setjmp.S
@@ -155,7 +155,7 @@ SRCS+= splitfs.c
.include <bsd.lib.mk>
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend ${OBJS}: machine
cleandepend: cleanmachine
cleanmachine:
diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile
index ee981d8..d286234 100644
--- a/lib/libthr/Makefile
+++ b/lib/libthr/Makefile
@@ -19,10 +19,10 @@ WARNS?= 3
CFLAGS+=-DPTHREAD_KERNEL
CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \
-I${.CURDIR}/../../include
-CFLAGS+=-I${.CURDIR}/arch/${MACHINE_ARCH}/include
+CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include
CFLAGS+=-I${.CURDIR}/sys
CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf
-CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH}
+CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH}
CFLAGS+=-I${.CURDIR}/../libthread_db
CFLAGS+=-Winline
LDFLAGS+=-Wl,-znodelete
@@ -38,7 +38,7 @@ CFLAGS+=-D_PTHREADS_INVARIANTS
PRECIOUSLIB=
-.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
+.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
.include "${.CURDIR}/sys/Makefile.inc"
.include "${.CURDIR}/thread/Makefile.inc"
diff --git a/lib/libthr/arch/amd64/Makefile.inc b/lib/libthr/arch/amd64/Makefile.inc
index f62999f..f751573 100644
--- a/lib/libthr/arch/amd64/Makefile.inc
+++ b/lib/libthr/arch/amd64/Makefile.inc
@@ -1,5 +1,5 @@
#$FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= pthread_md.c _umtx_op_err.S
diff --git a/lib/libthr/arch/arm/Makefile.inc b/lib/libthr/arch/arm/Makefile.inc
index b6a4acd..e4dffef 100644
--- a/lib/libthr/arch/arm/Makefile.inc
+++ b/lib/libthr/arch/arm/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= pthread_md.c
diff --git a/lib/libthr/arch/i386/Makefile.inc b/lib/libthr/arch/i386/Makefile.inc
index 35e93a2..4e3dbb6 100644
--- a/lib/libthr/arch/i386/Makefile.inc
+++ b/lib/libthr/arch/i386/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= pthread_md.c _umtx_op_err.S
diff --git a/lib/libthr/arch/ia64/Makefile.inc b/lib/libthr/arch/ia64/Makefile.inc
index 160cdf6..f9675b7 100644
--- a/lib/libthr/arch/ia64/Makefile.inc
+++ b/lib/libthr/arch/ia64/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= _umtx_op_err.S pthread_md.c
diff --git a/lib/libthr/arch/mips/Makefile.inc b/lib/libthr/arch/mips/Makefile.inc
index b6a4acd..e4dffef 100644
--- a/lib/libthr/arch/mips/Makefile.inc
+++ b/lib/libthr/arch/mips/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= pthread_md.c
diff --git a/lib/libthr/arch/powerpc/Makefile.inc b/lib/libthr/arch/powerpc/Makefile.inc
index b6a4acd..e4dffef 100644
--- a/lib/libthr/arch/powerpc/Makefile.inc
+++ b/lib/libthr/arch/powerpc/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= pthread_md.c
diff --git a/lib/libthr/arch/sparc64/Makefile.inc b/lib/libthr/arch/sparc64/Makefile.inc
index b6a4acd..e4dffef 100644
--- a/lib/libthr/arch/sparc64/Makefile.inc
+++ b/lib/libthr/arch/sparc64/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
SRCS+= pthread_md.c
diff --git a/lib/libthr/support/Makefile.inc b/lib/libthr/support/Makefile.inc
index bcf4393..2b243ad 100644
--- a/lib/libthr/support/Makefile.inc
+++ b/lib/libthr/support/Makefile.inc
@@ -1,9 +1,9 @@
# $FreeBSD$
.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string
-.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys
+.PATH: ${.CURDIR}/../libc/${MACHINE_CPUARCH}/sys
-CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH}
+CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH}
SYSCALLS= thr_new
diff --git a/lib/libthread_db/Makefile b/lib/libthread_db/Makefile
index 7aaefd7..047bbe6 100644
--- a/lib/libthread_db/Makefile
+++ b/lib/libthread_db/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}
LIB= thread_db
SHLIB_MAJOR= 3
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 4a1b73a..465a6ab 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -12,10 +12,10 @@
#
#
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
ARCH_SUBDIR= i387
.else
-ARCH_SUBDIR= ${MACHINE_ARCH}
+ARCH_SUBDIR= ${MACHINE_CPUARCH}
.endif
.include "${ARCH_SUBDIR}/Makefile.inc"
@@ -74,7 +74,7 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
# Location of fpmath.h and _fpmath.h
LIBCDIR= ${.CURDIR}/../libc
CFLAGS+= -I${.CURDIR}/src -I${LIBCDIR}/include \
- -I${LIBCDIR}/${MACHINE_ARCH}
+ -I${LIBCDIR}/${MACHINE_CPUARCH}
SYM_MAPS+= ${.CURDIR}/Symbol.map
VERSION_DEF= ${LIBCDIR}/Versions.def
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index d6df617..9f36ef1 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -1,4 +1,4 @@
-# $FreeBSD$
+user: # $FreeBSD/imp/tbemd/libexec/rtld-elf/Makefile 201380 2010-01-02 09:50:19Z ed $
.include <bsd.own.mk>
MK_SSP= no
@@ -10,7 +10,7 @@ SRCS= rtld_start.S \
MAN= rtld.1
CSTD?= gnu99
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD
-CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
+CFLAGS+= -I${.CURDIR}/${MACHINE_CPUARCH} -I${.CURDIR}
LDFLAGS+= -nostdlib -e .rtld_start
WARNS?= 2
INSTALLFLAGS= -C -b
@@ -25,7 +25,7 @@ LDFLAGS+= -shared -Wl,-Bsymbolic
DPADD= ${LIBC_PIC}
LDADD= -lc_pic -lssp_nonshared
-.if ${MACHINE_ARCH} != "ia64"
+.if ${MACHINE_CPUARCH} != "ia64"
.if ${MK_SYMVER} == "yes"
LIBCDIR= ${.CURDIR}/../../lib/libc
VERSION_DEF= ${LIBCDIR}/Versions.def
@@ -35,14 +35,14 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
${PROG}: ${VERSION_MAP}
-.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map)
-SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map
+.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map)
+SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map
.endif
.endif
.endif
-.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
+.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc)
+.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc"
.endif
# Since moving rtld-elf to /libexec, we need to create a symlink.
@@ -52,7 +52,7 @@ beforeinstall:
-chflags noschg ${DESTDIR}/usr/libexec/${PROG}
.endif
-.PATH: ${.CURDIR}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH}
.include <bsd.symver.mk>
.include <bsd.prog.mk>
diff --git a/libexec/rtld-elf/amd64/Makefile.inc b/libexec/rtld-elf/amd64/Makefile.inc
index ba39193..e315a04 100644
--- a/libexec/rtld-elf/amd64/Makefile.inc
+++ b/libexec/rtld-elf/amd64/Makefile.inc
@@ -2,4 +2,4 @@ CFLAGS+= -elf
LDFLAGS+= -elf
# Uncomment this to build the dynamic linker as an executable instead
# of a shared library:
-#LDSCRIPT= ${.CURDIR}/${MACHINE_ARCH}/elf_rtld.x
+#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
diff --git a/libexec/rtld-elf/i386/Makefile.inc b/libexec/rtld-elf/i386/Makefile.inc
index ba39193..e315a04 100644
--- a/libexec/rtld-elf/i386/Makefile.inc
+++ b/libexec/rtld-elf/i386/Makefile.inc
@@ -2,4 +2,4 @@ CFLAGS+= -elf
LDFLAGS+= -elf
# Uncomment this to build the dynamic linker as an executable instead
# of a shared library:
-#LDSCRIPT= ${.CURDIR}/${MACHINE_ARCH}/elf_rtld.x
+#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index afb15b0..583f9d1 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -145,7 +145,7 @@ CRUNCH_LIBS+= -lzfs -lnvpair -luutil -lavl
.endif
CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lreadline -lsbuf -lufs -lz
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
CRUNCH_ALIAS_bsdlabel= disklabel
#.if ${MK_NCP} != "no"
@@ -161,15 +161,15 @@ CRUNCH_PROGS_sbin+= bsdlabel
CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
CRUNCH_PROGS_sbin+= mca
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
CRUNCH_PROGS_sbin+= bsdlabel sunlabel
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CRUNCH_PROGS_sbin+= bsdlabel fdisk
CRUNCH_ALIAS_bsdlabel= disklabel
.endif
diff --git a/sbin/Makefile b/sbin/Makefile
index 8ece390..a4b36cb 100644
--- a/sbin/Makefile
+++ b/sbin/Makefile
@@ -5,26 +5,21 @@
# XXX MISSING: icheck ncheck
-SUBDIR= adjkerntz \
+SUBDIR=adjkerntz \
atacontrol \
- ${_atm} \
badsect \
- ${_bsdlabel} \
camcontrol \
ccdconfig \
clri \
comcontrol \
conscontrol \
ddb \
- ${_devd} \
devfs \
dhclient \
dmesg \
dump \
dumpfs \
dumpon \
- ${_fdisk} \
- ${_fdisk_pc98} \
ffsinfo \
fsck \
fsck_ffs \
@@ -38,15 +33,12 @@ SUBDIR= adjkerntz \
gvinum \
ifconfig \
init \
- ${_ipf} \
- ${_ipfw} \
iscontrol \
kldconfig \
kldload \
kldstat \
kldunload \
ldconfig \
- ${_mca} \
md5 \
mdconfig \
mdmfs \
@@ -60,96 +52,62 @@ SUBDIR= adjkerntz \
mount_nullfs \
mount_udf \
mount_unionfs \
- ${_natd} \
newfs \
newfs_msdos \
nfsiod \
nos-tun \
- ${_pfctl} \
- ${_pflogd} \
ping \
- ${_ping6} \
- ${_quotacheck} \
rcorder \
reboot \
recoverdisk \
restore \
route \
- ${_routed} \
- ${_rtsol} \
savecore \
- ${_sconfig} \
setkey \
shutdown \
spppcontrol \
- ${_sunlabel} \
swapon \
sysctl \
tunefs \
umount \
.if ${MK_ATM} != "no"
-_atm= atm
+SUBDIR += atm
.endif
.if ${MK_CXX} != "no"
-_devd= devd
+SUBDIR += devd
.endif
.if ${MK_IPFILTER} != "no"
-_ipf= ipf
+SUBDIR += ipf
.endif
.if ${MK_IPFW} != "no"
-_ipfw= ipfw
-_natd= natd
+SUBDIR += ipfw
+SUBDIR += natd
.endif
.if ${MK_PF} != "no"
-_pfctl= pfctl
-_pflogd= pflogd
+SUBDIR += pfctl
+SUBDIR += pflogd
.endif
.if ${MK_INET6} != "no"
-_ping6= ping6
-_rtsol= rtsol
-.endif
-
-.if ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "powerpc"
-_bsdlabel= bsdlabel
+SUBDIR += ping6
+SUBDIR += rtsol
.endif
.if ${MK_QUOTAS} != "no"
-_quotacheck= quotacheck
+SUBDIR += quotacheck
.endif
.if ${MK_ROUTED} != "no"
-_routed= routed
-.endif
-
-.if ${MACHINE_ARCH} == "i386"
-.if ${MACHINE} == "i386"
-_fdisk= fdisk
-.elif ${MACHINE} == "pc98"
-_fdisk_pc98= fdisk_pc98
-.endif
-_sconfig= sconfig
+SUBDIR += routed
.endif
-.if ${MACHINE_ARCH} == "amd64"
-_fdisk= fdisk
-.endif
+.include <bsd.arch.inc.mk>
-.if ${MACHINE_ARCH} == "arm"
-_fdisk= fdisk
-.endif
-
-.if ${MACHINE_ARCH} == "ia64"
-_mca= mca
-.endif
-
-.if ${MACHINE_ARCH} == "sparc64"
-_sunlabel= sunlabel
-.endif
+SUBDIR := ${SUBDIR:O}
.include <bsd.subdir.mk>
diff --git a/sbin/Makefile.amd64 b/sbin/Makefile.amd64
new file mode 100644
index 0000000..2d231b0
--- /dev/null
+++ b/sbin/Makefile.amd64
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+SUBDIR += bsdlabel
+SUBDIR += fdisk
diff --git a/sbin/Makefile.arm b/sbin/Makefile.arm
new file mode 100644
index 0000000..2d231b0
--- /dev/null
+++ b/sbin/Makefile.arm
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+SUBDIR += bsdlabel
+SUBDIR += fdisk
diff --git a/sbin/Makefile.i386 b/sbin/Makefile.i386
new file mode 100644
index 0000000..4135c44
--- /dev/null
+++ b/sbin/Makefile.i386
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR += bsdlabel
+SUBDIR += fdisk
+SUBDIR += sconfig
diff --git a/sbin/Makefile.ia64 b/sbin/Makefile.ia64
new file mode 100644
index 0000000..c1e6a41
--- /dev/null
+++ b/sbin/Makefile.ia64
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+SUBDIR += mca
diff --git a/sbin/Makefile.mips b/sbin/Makefile.mips
new file mode 100644
index 0000000..2d231b0
--- /dev/null
+++ b/sbin/Makefile.mips
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+SUBDIR += bsdlabel
+SUBDIR += fdisk
diff --git a/sbin/Makefile.pc98 b/sbin/Makefile.pc98
new file mode 100644
index 0000000..4aab559
--- /dev/null
+++ b/sbin/Makefile.pc98
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR += bsdlabel
+SUBDIR += fdisk_pc98
+SUBDIR += sconfig
diff --git a/sbin/Makefile.sparc64 b/sbin/Makefile.sparc64
new file mode 100644
index 0000000..9a5bbe6
--- /dev/null
+++ b/sbin/Makefile.sparc64
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+SUBDIR += bsdlabel
+SUBDIR += sunlabel
diff --git a/sbin/atm/atmconfig/Makefile b/sbin/atm/atmconfig/Makefile
index 8564d35..cbf5a9a 100644
--- a/sbin/atm/atmconfig/Makefile
+++ b/sbin/atm/atmconfig/Makefile
@@ -27,7 +27,8 @@ LDADD= -lbsnmp
CLEANFILES+= oid.h
.endif
-.if ${MACHINE_ARCH} == "arm"
+# XXX - this is verboten
+.if ${MACHINE_CPUARCH} == "arm"
WARNS?= 3
.endif
diff --git a/sbin/bsdlabel/Makefile b/sbin/bsdlabel/Makefile
index b60bbd0..f91f160 100644
--- a/sbin/bsdlabel/Makefile
+++ b/sbin/bsdlabel/Makefile
@@ -8,7 +8,7 @@ SRCS= bsdlabel.c geom_bsd_enc.c
#MAN= bsdlabel.5
MAN+= bsdlabel.8
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
LINKS= ${BINDIR}/bsdlabel ${BINDIR}/disklabel
MLINKS= bsdlabel.8 disklabel.8
.endif
diff --git a/sbin/camcontrol/Makefile b/sbin/camcontrol/Makefile
index 31bbd46..877e332 100644
--- a/sbin/camcontrol/Makefile
+++ b/sbin/camcontrol/Makefile
@@ -7,7 +7,8 @@ SRCS+= modeedit.c
.else
CFLAGS+= -DMINIMALISTIC
.endif
-.if ${MACHINE_ARCH} == "arm"
+# This is verboten
+.if ${MACHINE_CPUARCH} == "arm"
WARNS?= 3
.endif
DPADD= ${LIBCAM} ${LIBSBUF} ${LIBUTIL}
diff --git a/sbin/gbde/Makefile b/sbin/gbde/Makefile
index 0faa6ba..373ce0a 100644
--- a/sbin/gbde/Makefile
+++ b/sbin/gbde/Makefile
@@ -9,7 +9,10 @@ SRCS+= g_bde_lock.c
# rijndael-fst.c does evil casting things which results in warnings on
# 64 bit machines, the test-vectors check out however, so it works right.
-.if ${MACHINE_ARCH} != "i386"
+#XXX All the world isn't amd64 or i386
+.if ${MACHINE_CPUARCH} == "i386"
+WARNS?= 5
+.else
WARNS?= 3
.endif
diff --git a/sbin/newfs_msdos/Makefile b/sbin/newfs_msdos/Makefile
index 558f673..0a9ffb4 100644
--- a/sbin/newfs_msdos/Makefile
+++ b/sbin/newfs_msdos/Makefile
@@ -3,7 +3,8 @@
PROG= newfs_msdos
MAN= newfs_msdos.8
-.if ${MACHINE_ARCH} == "arm"
+# XXX - this is verboten
+.if ${MACHINE_CPUARCH} == "arm"
WARNS?= 3
.endif
diff --git a/sbin/routed/Makefile b/sbin/routed/Makefile
index 8c7559f..89d04c8 100644
--- a/sbin/routed/Makefile
+++ b/sbin/routed/Makefile
@@ -7,7 +7,8 @@ MAN= routed.8
SUBDIR= rtquery
LDADD= -lmd
DPADD= ${LIBMD}
-.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "amd64"
+# XXX this is verboten
+.if ${MACHINE_CPUARCH} != "i386" && ${MACHINE_CPUARCH} != "amd64"
WARNS?= 0
.endif
diff --git a/sbin/sunlabel/Makefile b/sbin/sunlabel/Makefile
index 9eb1a32..ed64bee 100644
--- a/sbin/sunlabel/Makefile
+++ b/sbin/sunlabel/Makefile
@@ -6,7 +6,7 @@ PROG= sunlabel
SRCS= sunlabel.c geom_sunlabel_enc.c
MAN= sunlabel.8
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
LINKS= ${BINDIR}/sunlabel ${BINDIR}/disklabel
MLINKS= sunlabel.8 disklabel.8
.endif
diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile
index 8a08589..3d97f94 100644
--- a/secure/lib/libcrypto/Makefile
+++ b/secure/lib/libcrypto/Makefile
@@ -49,7 +49,7 @@ INCS+= asn1.h asn1_mac.h asn1t.h
# bf
SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
.if ${MACHINE_CPU:Mi686}
SRCS+= bf-686.s
.else
@@ -73,9 +73,9 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c bn_div.c \
bn_lib.c bn_mod.c bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_opt.c \
bn_prime.c bn_print.c bn_rand.c bn_recp.c bn_shift.c bn_sqr.c \
bn_sqrt.c bn_word.c bn_x931p.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= bn-586.s co-586.s
-.elif ${MACHINE_ARCH} == "amd64"
+.elif ${MACHINE_CPUARCH} == "amd64"
SRCS+= x86_64-gcc.c
.else
SRCS+= bn_asm.c
@@ -89,7 +89,7 @@ INCS+= buffer.h
# cast
SRCS+= c_cfb64.c c_ecb.c c_ofb64.c c_skey.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= cast-586.s
.else
SRCS+= c_enc.c
@@ -97,7 +97,7 @@ SRCS+= c_enc.c
INCS+= cast.h
# camellia
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SRCS+= camellia.c cmll_cbc.c cmll_cfb.c cmll_ctr.c cmll_ecb.c \
cmll_misc.c cmll_ofb.c
INCS+= camellia.h
@@ -117,7 +117,7 @@ SRCS+= cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \
enc_read.c enc_writ.c fcrypt.c ofb64ede.c ofb64enc.c \
ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \
rpc_enc.c set_key.c str2key.c xcbc_enc.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= des-586.s crypt586.s
.else
SRCS+= des_enc.c fcrypt_b.c
@@ -172,7 +172,7 @@ SRCS+= bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \
m_mdc2.c m_null.c m_ripemd.c m_sha.c m_sha1.c names.c \
openbsd_hw.c p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c \
p_open.c p_seal.c p_sign.c p_verify.c
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SRCS+= e_camellia.c
.endif
INCS+= evp.h
@@ -208,7 +208,7 @@ INCS+= md4.h
# md5
SRCS+= md5_dgst.c md5_one.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= md5-586.s
.endif
INCS+= md5.h
@@ -255,7 +255,7 @@ INCS+= rc2.h
# rc4
SRCS+= rc4_skey.c rc4_fblk.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= rc4-586.s
.else
SRCS+= rc4_enc.c
@@ -264,7 +264,7 @@ INCS+= rc4.h
# rc5
SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= rc5-586.s
.else
SRCS+= rc5_enc.c
@@ -284,7 +284,7 @@ INCS+= rsa.h
# sha
SRCS+= sha1_one.c sha1dgst.c sha_dgst.c sha_one.c sha256.c sha512.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= sha1-586.s
.endif
INCS+= sha.h
@@ -351,10 +351,10 @@ buildinf.h: ${.CURDIR}/Makefile
( echo "#ifndef MK1MF_BUILD"; \
echo " /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
echo " #define CFLAGS \"$(CC)\""; \
- echo " #define PLATFORM \"FreeBSD-${MACHINE_ARCH}\""; \
+ echo " #define PLATFORM \"FreeBSD-${MACHINE_CPUARCH}\""; \
echo "#endif" ) > ${.TARGET}
-opensslconf.h: opensslconf-${MACHINE_ARCH}.h
+opensslconf.h: opensslconf-${MACHINE_CPUARCH}.h
cp ${.ALLSRC} ${.TARGET}
evp.h: ${LCRYPTO_SRC}/crypto/evp/evp.h
@@ -383,11 +383,11 @@ afterinstall:
.include <bsd.lib.mk>
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
.PATH: ${.CURDIR}/i386
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
_bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm
.endif
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 0ae0af2..ceb3859 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -617,7 +617,7 @@ MLINKS+=xe.4 if_xe.4
MLINKS+=xl.4 if_xl.4
MLINKS+=zyd.4 if_zyd.4
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
_acpi_aiboost.4=acpi_aiboost.4
_acpi_asus.4= acpi_asus.4
_acpi_dock.4= acpi_dock.4
@@ -666,12 +666,12 @@ _wpi.4= wpi.4
MLINKS+=lindev.4 full.4
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
_atp.4= atp.4
.endif
-.if exists(${.CURDIR}/man4.${MACHINE_ARCH})
-SUBDIR= man4.${MACHINE_ARCH}
+.if exists(${.CURDIR}/man4.${MACHINE_CPUARCH})
+SUBDIR= man4.${MACHINE_CPUARCH}
.endif
.include <bsd.prog.mk>
diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile
index 1216fc4..7aad66b9 100644
--- a/share/man/man5/Makefile
+++ b/share/man/man5/Makefile
@@ -83,7 +83,7 @@ MLINKS+=resolver.5 resolv.conf.5
MAN+= hesiod.conf.5
.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
_boot.config.5= boot.config.5
.endif
diff --git a/share/mk/bsd.arch.inc.mk b/share/mk/bsd.arch.inc.mk
new file mode 100644
index 0000000..98e429e
--- /dev/null
+++ b/share/mk/bsd.arch.inc.mk
@@ -0,0 +1,11 @@
+#
+# Include the arch-specific Makefile.inc.$ARCH. We go from most specific
+# to least specific, stopping after we get a hit.
+#
+.if exists(${.CURDIR}/Makefile.${MACHINE})
+.include "Makefile.${MACHINE}"
+.elif exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
+.include "Makefile.${MACHINE_ARCH}"
+.elif exists(${.CURDIR}/Makefile.${MACHINE_CPUARCH})
+.include "Makefile.${MACHINE_CPUARCH}"
+.endif
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index 8278d47..06b7af1 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -6,18 +6,18 @@
.if !defined(CPUTYPE) || empty(CPUTYPE)
_CPUCFLAGS =
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
MACHINE_CPU = i486
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
MACHINE_CPU = amd64 sse2 sse
-. elif ${MACHINE_ARCH} == "ia64"
+. elif ${MACHINE_CPUARCH} == "ia64"
MACHINE_CPU = itanium
-. elif ${MACHINE_ARCH} == "powerpc"
+. elif ${MACHINE_CPUARCH} == "powerpc"
MACHINE_CPU = aim
-. elif ${MACHINE_ARCH} == "sparc64"
-. elif ${MACHINE_ARCH} == "arm"
+. elif ${MACHINE_CPUARCH} == "sparc64"
+. elif ${MACHINE_CPUARCH} == "arm"
MACHINE_CPU = arm
-. elif ${MACHINE_ARCH} == "mips"
+. elif ${MACHINE_CPUARCH} == "mips"
MACHINE_CPU = mips
. endif
.else
@@ -25,7 +25,7 @@ MACHINE_CPU = mips
# Handle aliases (not documented in make.conf to avoid user confusion
# between e.g. i586 and pentium)
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "nocona"
CPUTYPE = prescott
. elif ${CPUTYPE} == "core" || ${CPUTYPE} == "core2"
@@ -54,7 +54,7 @@ CPUTYPE = athlon-mp
. elif ${CPUTYPE} == "k7"
CPUTYPE = athlon
. endif
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2"
CPUTYPE = nocona
. endif
@@ -71,7 +71,7 @@ CPUTYPE = nocona
# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "crusoe"
_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
. elif ${CPUTYPE} == "k5"
@@ -104,9 +104,9 @@ _ICC_CPUCFLAGS = -tpp5
. else
_ICC_CPUCFLAGS =
. endif # ICC on 'i386'
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
_CPUCFLAGS = -march=${CPUTYPE}
-. elif ${MACHINE_ARCH} == "arm"
+. elif ${MACHINE_CPUARCH} == "arm"
. if ${CPUTYPE} == "xscale"
#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself
#_CPUCFLAGS = -mcpu=xscale
@@ -114,14 +114,14 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__
. else
_CPUCFLAGS = -mcpu=${CPUTYPE}
. endif
-. elif ${MACHINE_ARCH} == "powerpc"
+. elif ${MACHINE_CPUARCH} == "powerpc"
. if ${CPUTYPE} == "e500"
MACHINE_CPU = booke
_CPUCFLAGS = -Wa,-me500 -msoft-float
. else
_CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64
. endif
-. elif ${MACHINE_ARCH} == "mips"
+. elif ${MACHINE_CPUARCH} == "mips"
. if ${CPUTYPE} == "mips32"
_CPUCFLAGS = -march=mips32
. elif ${CPUTYPE} == "mips32r2"
@@ -141,7 +141,7 @@ _CPUCFLAGS = -march=24kc
# unordered list to make it easy for client makefiles to test for the
# presence of a CPU feature.
-. if ${MACHINE_ARCH} == "i386"
+. if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64"
MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
@@ -180,37 +180,38 @@ MACHINE_CPU = i486 i386
. elif ${CPUTYPE} == "i386"
MACHINE_CPU = i386
. endif
-. elif ${MACHINE_ARCH} == "amd64"
+. elif ${MACHINE_CPUARCH} == "amd64"
. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
MACHINE_CPU = k8 3dnow
. elif ${CPUTYPE} == "nocona"
MACHINE_CPU = sse3
. endif
MACHINE_CPU += amd64 sse2 sse mmx
-. elif ${MACHINE_ARCH} == "ia64"
+. elif ${MACHINE_CPUARCH} == "ia64"
. if ${CPUTYPE} == "itanium"
MACHINE_CPU = itanium
. endif
. endif
.endif
-.if ${MACHINE_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
-CFLAGS += -mbig-endian
-LDFLAGS += -mbig-endian
-LD += -EB
-.endif
+##XXXimp: These are bogus
+#.if ${MACHINE_CPUARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
+#CFLAGS += -mbig-endian
+#LDFLAGS += -mbig-endian
+#LD += -EB
+#.endif
-.if ${MACHINE_ARCH} == "mips"
-. if defined(TARGET_BIG_ENDIAN)
-CFLAGS += -EB
-LDFLAGS += -Wl,-EB
-LD += -EB
-. else
-CFLAGS += -EL
-LDFLAGS += -Wl,-EL
-LD += -EL
-. endif
-CFLAGS += -msoft-float -G0 -mno-dsp -mabicalls
+.if ${MACHINE_CPUARCH} == "mips"
+#. if defined(TARGET_BIG_ENDIAN)
+#CFLAGS += -EB
+#LDFLAGS += -Wl,-EB
+#LD += -EB
+#. else
+#CFLAGS += -EL
+#LDFLAGS += -Wl,-EL
+#LD += -EL
+#. endif
+CFLAGS += -msoft-float -G0 -mabicalls
.endif
# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk
diff --git a/share/mk/bsd.endian.mk b/share/mk/bsd.endian.mk
index c2b141f..158554b 100644
--- a/share/mk/bsd.endian.mk
+++ b/share/mk/bsd.endian.mk
@@ -3,12 +3,12 @@
.if ${MACHINE_ARCH} == "amd64" || \
${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "ia64" || \
- (${MACHINE_ARCH} == "arm" && !defined(TARGET_BIG_ENDIAN)) || \
- (${MACHINE_ARCH} == "mips" && !defined(TARGET_BIG_ENDIAN))
+ ${MACHINE_ARCH} == "arm" || \
+ ${MACHINE_ARCH} == "mipsel"
TARGET_ENDIANNESS= 1234
.elif ${MACHINE_ARCH} == "powerpc" || \
${MACHINE_ARCH} == "sparc64" || \
- ${MACHINE_ARCH} == "arm" || \
- ${MACHINE_ARCH} == "mips"
+ ${MACHINE_ARCH} == "armeb" || \
+ ${MACHINE_ARCH} == "mipseb"
TARGET_ENDIANNESS= 4321
.endif
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 470d9d4..54de4e9 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -53,7 +53,7 @@ STRIP?= -s
.SUFFIXES: .out .o .po .So .S .asm .s .c .cc .cpp .cxx .m .C .f .y .l .ln
.if !defined(PICFLAG)
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
PICFLAG=-fPIC
.else
PICFLAG=-fpic
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 97860f2..8d0e24a 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -79,8 +79,8 @@ CWARNFLAGS += -Werror
CWARNFLAGS += -Wno-unknown-pragmas
.endif
-.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
- ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
+.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_CPUARCH} != "ia64" && \
+ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
# Don't use -Wstack-protector as it breaks world with -Werror.
SSP_CFLAGS ?= -fstack-protector
CFLAGS += ${SSP_CFLAGS}
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 51ec039..3d517a3 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -4,6 +4,18 @@
unix ?= We run FreeBSD, not UNIX.
.FreeBSD ?= true
+.if !defined(%POSIX)
+#
+# MACHINE_CPUARCH defines a collection of MACHINE_ARCH. Machines with
+# the same MACHINE_ARCH can run reach-other's binaries, so it
+# necessarily has word size and endian swizzled in. However, support
+# files for these machines often are shared amongst all combinations
+# of size and/or endian. This is called MACHINE_CPU in NetBSD, but
+# that's used for something different in FreeBSD.
+#
+MACHINE_CPUARCH=${MACHINE_ARCH:C/mipse[lb]/mips/:C/armeb/arm/}
+.endif
+
# If the special target .POSIX appears (without prerequisites or
# commands) before the first noncomment line in the makefile, make shall
# process the makefile as specified by the Posix 1003.2 specification.
@@ -35,7 +47,7 @@ CC ?= c89
CFLAGS ?= -O
.else
CC ?= cc
-.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips"
CFLAGS ?= -O -pipe
.else
CFLAGS ?= -O2 -pipe
diff --git a/sys/boot/Makefile b/sys/boot/Makefile
index 056dc68..e945f46 100644
--- a/sys/boot/Makefile
+++ b/sys/boot/Makefile
@@ -8,21 +8,21 @@ SUBDIR+= ficl
.endif
# Build EFI library.
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "ia64"
SUBDIR+= efi
.endif
# Build Open Firmware library.
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "sparc64"
SUBDIR+= ofw
.endif
# Build U-Boot library.
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
SUBDIR+= uboot
.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE} == "i386"
SUBDIR+= zfs
.endif
diff --git a/sys/boot/arm/ixp425/boot2/Makefile b/sys/boot/arm/ixp425/boot2/Makefile
index 138446b..2d62f8c 100644
--- a/sys/boot/arm/ixp425/boot2/Makefile
+++ b/sys/boot/arm/ixp425/boot2/Makefile
@@ -20,7 +20,7 @@ NO_MAN=
KERNPHYSADDR=0x180000
KERNVIRTADDR=${KERNPHYSADDR}
BOOT_STACK=0x200000-4
-M=${MACHINE_ARCH}
+M=${MACHINE_CPUARCH}
LDFLAGS=-e ${KERNPHYSADDR} -EB -T ldscript.${M}
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
S=${.CURDIR}/../../../..
diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile
index ea207a1..d17903a 100644
--- a/sys/boot/arm/uboot/Makefile
+++ b/sys/boot/arm/uboot/Makefile
@@ -64,7 +64,7 @@ CLEANFILES+= vers.c loader.help
CFLAGS+= -ffreestanding
-LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.arm
+LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_ARCH}
# Pull in common loader code
.PATH: ${.CURDIR}/../../uboot/common
diff --git a/sys/boot/arm/uboot/ldscript.armbe b/sys/boot/arm/uboot/ldscript.armbe
new file mode 100644
index 0000000..7327ca6
--- /dev/null
+++ b/sys/boot/arm/uboot/ldscript.armbe
@@ -0,0 +1,134 @@
+/* $FreeBSD: user/imp/tbemd/sys/boot/arm/uboot/ldscript.armbe -1 $ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0x1000000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rela.text :
+ { *(.rela.text) *(.rela.gnu.linkonce.t*) }
+ .rela.data :
+ { *(.rela.data) *(.rela.gnu.linkonce.d*) }
+ .rela.rodata :
+ { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ .rela.got : { *(.rela.got) }
+ .rela.got1 : { *(.rela.got1) }
+ .rela.got2 : { *(.rela.got2) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rela.init : { *(.rela.init) }
+ .rela.fini : { *(.rela.fini) }
+ .rela.bss : { *(.rela.bss) }
+ .rela.plt : { *(.rela.plt) }
+ .rela.sdata : { *(.rela.sdata) }
+ .rela.sbss : { *(.rela.sbss) }
+ .rela.sdata2 : { *(.rela.sdata2) }
+ .rela.sbss2 : { *(.rela.sbss2) }
+ .text :
+ {
+ *(.text)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+ } =0
+ _etext = .;
+ PROVIDE (etext = .);
+ .init : { *(.init) } =0
+ .fini : { *(.fini) } =0
+ .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 : { *(.sdata2) }
+ .sbss2 : { *(.sbss2) }
+ /* Adjust the address for the data segment to the next page up. */
+ . = ((. + 0x1000) & ~(0x1000 - 1));
+ .data :
+ {
+ *(.data)
+ *(.gnu.linkonce.d*)
+ CONSTRUCTORS
+ }
+ .data1 : { *(.data1) }
+ .got1 : { *(.got1) }
+ .dynamic : { *(.dynamic) }
+ /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+ get relocated with -mrelocatable. Also put in the .fixup pointers.
+ The current compiler no longer needs this, but keep it around for 2.7.2 */
+ PROVIDE (_GOT2_START_ = .);
+ .got2 : { *(.got2) }
+ PROVIDE (__CTOR_LIST__ = .);
+ .ctors : { *(.ctors) }
+ PROVIDE (__CTOR_END__ = .);
+ PROVIDE (__DTOR_LIST__ = .);
+ .dtors : { *(.dtors) }
+ PROVIDE (__DTOR_END__ = .);
+ PROVIDE (_FIXUP_START_ = .);
+ .fixup : { *(.fixup) }
+ PROVIDE (_FIXUP_END_ = .);
+ PROVIDE (_GOT2_END_ = .);
+ PROVIDE (_GOT_START_ = .);
+ .got : { *(.got) }
+ .got.plt : { *(.got.plt) }
+ PROVIDE (_GOT_END_ = .);
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata : { *(.sdata) }
+ _edata = .;
+ PROVIDE (edata = .);
+ .sbss :
+ {
+ PROVIDE (__sbss_start = .);
+ *(.sbss)
+ *(.scommon)
+ *(.dynsbss)
+ PROVIDE (__sbss_end = .);
+ }
+ .plt : { *(.plt) }
+ .bss :
+ {
+ PROVIDE (__bss_start = .);
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ _end = . ;
+ PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* These must appear regardless of . */
+}
diff --git a/sys/boot/arm/uboot/ldscript.armeb b/sys/boot/arm/uboot/ldscript.armeb
new file mode 100644
index 0000000..17a02ca
--- /dev/null
+++ b/sys/boot/arm/uboot/ldscript.armeb
@@ -0,0 +1,134 @@
+/* $FreeBSD$ */
+
+OUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+ /* Read-only sections, merged into text segment: */
+ . = 0x1000000 + SIZEOF_HEADERS;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .gnu.version : { *(.gnu.version) }
+ .gnu.version_d : { *(.gnu.version_d) }
+ .gnu.version_r : { *(.gnu.version_r) }
+ .rela.text :
+ { *(.rela.text) *(.rela.gnu.linkonce.t*) }
+ .rela.data :
+ { *(.rela.data) *(.rela.gnu.linkonce.d*) }
+ .rela.rodata :
+ { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ .rela.got : { *(.rela.got) }
+ .rela.got1 : { *(.rela.got1) }
+ .rela.got2 : { *(.rela.got2) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rela.init : { *(.rela.init) }
+ .rela.fini : { *(.rela.fini) }
+ .rela.bss : { *(.rela.bss) }
+ .rela.plt : { *(.rela.plt) }
+ .rela.sdata : { *(.rela.sdata) }
+ .rela.sbss : { *(.rela.sbss) }
+ .rela.sdata2 : { *(.rela.sdata2) }
+ .rela.sbss2 : { *(.rela.sbss2) }
+ .text :
+ {
+ *(.text)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+ } =0
+ _etext = .;
+ PROVIDE (etext = .);
+ .init : { *(.init) } =0
+ .fini : { *(.fini) } =0
+ .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
+ .rodata1 : { *(.rodata1) }
+ .sdata2 : { *(.sdata2) }
+ .sbss2 : { *(.sbss2) }
+ /* Adjust the address for the data segment to the next page up. */
+ . = ((. + 0x1000) & ~(0x1000 - 1));
+ .data :
+ {
+ *(.data)
+ *(.gnu.linkonce.d*)
+ CONSTRUCTORS
+ }
+ .data1 : { *(.data1) }
+ .got1 : { *(.got1) }
+ .dynamic : { *(.dynamic) }
+ /* Put .ctors and .dtors next to the .got2 section, so that the pointers
+ get relocated with -mrelocatable. Also put in the .fixup pointers.
+ The current compiler no longer needs this, but keep it around for 2.7.2 */
+ PROVIDE (_GOT2_START_ = .);
+ .got2 : { *(.got2) }
+ PROVIDE (__CTOR_LIST__ = .);
+ .ctors : { *(.ctors) }
+ PROVIDE (__CTOR_END__ = .);
+ PROVIDE (__DTOR_LIST__ = .);
+ .dtors : { *(.dtors) }
+ PROVIDE (__DTOR_END__ = .);
+ PROVIDE (_FIXUP_START_ = .);
+ .fixup : { *(.fixup) }
+ PROVIDE (_FIXUP_END_ = .);
+ PROVIDE (_GOT2_END_ = .);
+ PROVIDE (_GOT_START_ = .);
+ .got : { *(.got) }
+ .got.plt : { *(.got.plt) }
+ PROVIDE (_GOT_END_ = .);
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata : { *(.sdata) }
+ _edata = .;
+ PROVIDE (edata = .);
+ .sbss :
+ {
+ PROVIDE (__sbss_start = .);
+ *(.sbss)
+ *(.scommon)
+ *(.dynsbss)
+ PROVIDE (__sbss_end = .);
+ }
+ .plt : { *(.plt) }
+ .bss :
+ {
+ PROVIDE (__bss_start = .);
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ _end = . ;
+ PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+ /* These must appear regardless of . */
+}
diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc
index bb0d120..0dfb2a2 100644
--- a/sys/boot/common/Makefile.inc
+++ b/sys/boot/common/Makefile.inc
@@ -4,14 +4,14 @@ SRCS+= boot.c commands.c console.c devopen.c interp.c
SRCS+= interp_backslash.c interp_parse.c ls.c misc.c
SRCS+= module.c panic.c
-.if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
.elif ${MACHINE} == "pc98"
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
-.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm"
+.elif ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
SRCS+= load_elf32.c reloc_elf32.c
-.elif ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "ia64"
+.elif ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "ia64"
SRCS+= load_elf64.c reloc_elf64.c
.endif
diff --git a/sys/boot/efi/libefi/Makefile b/sys/boot/efi/libefi/Makefile
index 55053e1..beb9269 100644
--- a/sys/boot/efi/libefi/Makefile
+++ b/sys/boot/efi/libefi/Makefile
@@ -7,7 +7,7 @@ SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \
libefi.c time.c
CFLAGS+= -I${.CURDIR}/../include
-CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH:S/amd64/i386/}
+CFLAGS+= -I${.CURDIR}/../include/${MACHINE_CPUARCH:S/amd64/i386/}
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
# Pick up the bootstrap header for some interface items
diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
index a967613..58c1465 100644
--- a/sys/boot/ficl/Makefile
+++ b/sys/boot/ficl/Makefile
@@ -1,20 +1,20 @@
# $FreeBSD$
#
-.PATH: ${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/}
+.PATH: ${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/}
BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
prefix.c search.c stack.c tools.c vm.c words.c
SRCS= ${BASE_SRCS} sysdep.c softcore.c
CLEANFILES= softcore.c testmain testmain.o
CFLAGS+= -ffreestanding
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -mno-sse3
.endif
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -msoft-float
.endif
.if ${MACHINE} == "pc98"
@@ -41,18 +41,18 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
# Optional OO extension softwords
#SOFTWORDS+= oo.fr classes.fr
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32 -march=i386 -I.
.endif
-CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/} \
+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_CPUARCH:S/amd64/i386/} \
-I${.CURDIR}/../common
softcore.c: ${SOFTWORDS} softcore.awk
(cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \
| awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
${SRCS:M*.c:R:S/$/.o/g}: machine
beforedepend ${OBJS}: machine
diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc
index 72c6395..a256840 100644
--- a/sys/boot/i386/Makefile.inc
+++ b/sys/boot/i386/Makefile.inc
@@ -9,7 +9,7 @@ CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
LDFLAGS+= -nostdlib
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32 -march=i386
LDFLAGS+= -m elf_i386_fbsd
AFLAGS+= --32
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index ab5a69a..8961e82 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -94,7 +94,7 @@ boot2.h: boot1.out
ORG1=`printf "%d" ${ORG1}` \
REL1=`printf "%d" ${REL1}` > ${.TARGET}
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend boot2.s: machine
CLEANFILES+= machine
machine:
diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile
index cc71b35..f76fb4e 100644
--- a/sys/boot/i386/gptboot/Makefile
+++ b/sys/boot/i386/gptboot/Makefile
@@ -67,7 +67,7 @@ gptboot.out: ${BTXCRT} gptboot.o sio.o
gptboot.o: ${.CURDIR}/../../common/ufsread.c
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend gptboot.o: machine
CLEANFILES+= machine
machine:
diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile
index 467d312..cf7ff35 100644
--- a/sys/boot/i386/gptzfsboot/Makefile
+++ b/sys/boot/i386/gptzfsboot/Makefile
@@ -64,7 +64,7 @@ gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o
zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend zfsboot.o: machine
CLEANFILES+= machine
machine:
diff --git a/sys/boot/i386/libfirewire/Makefile b/sys/boot/i386/libfirewire/Makefile
index 28f7630..191b954 100644
--- a/sys/boot/i386/libfirewire/Makefile
+++ b/sys/boot/i386/libfirewire/Makefile
@@ -16,7 +16,7 @@ CFLAGS+= -I${.CURDIR}/../libi386
CFLAGS+= -Wformat -Wall
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CLEANFILES+= machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
@@ -24,7 +24,7 @@ machine:
.include <bsd.lib.mk>
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend ${OBJS}: machine
.endif
diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile
index f1a461a..3b89784 100644
--- a/sys/boot/i386/libi386/Makefile
+++ b/sys/boot/i386/libi386/Makefile
@@ -53,7 +53,7 @@ CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \
# the location of libstand
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CLEANFILES+= machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
@@ -61,6 +61,6 @@ machine:
.include <bsd.lib.mk>
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend ${OBJS}: machine
.endif
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 719e28d..7f9617e 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -119,7 +119,7 @@ LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFS} ${LIBI386} -lstand
.include <bsd.prog.mk>
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend ${OBJS}: machine
CLEANFILES+= machine
machine:
diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile
index 1653534..7e5cb56 100644
--- a/sys/boot/i386/zfsboot/Makefile
+++ b/sys/boot/i386/zfsboot/Makefile
@@ -98,7 +98,7 @@ zfsboot.h: zfsldr.out
ORG1=`printf "%d" ${ORG1}` \
REL1=`printf "%d" ${REL1}` > ${.TARGET}
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend zfsboot.s: machine
CLEANFILES+= machine
machine:
diff --git a/sys/boot/ia64/common/Makefile b/sys/boot/ia64/common/Makefile
index 8261c25..3204edc 100644
--- a/sys/boot/ia64/common/Makefile
+++ b/sys/boot/ia64/common/Makefile
@@ -9,7 +9,7 @@ INTERNALLIB=
SRCS= autoload.c bootinfo.c copy.c devicename.c exec.c
CFLAGS+= -I${.CURDIR}/../../efi/include
-CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH}
+CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH}
CFLAGS+= -I${.CURDIR}/../../..
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
@@ -17,7 +17,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH
CFLAGS+= -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_ARCH}
+CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH}
.endif
.PATH: ${.CURDIR}/../../common
diff --git a/sys/boot/ia64/efi/Makefile b/sys/boot/ia64/efi/Makefile
index 5682ac8..27e81b9 100644
--- a/sys/boot/ia64/efi/Makefile
+++ b/sys/boot/ia64/efi/Makefile
@@ -9,21 +9,21 @@ PROG= loader.sym
INTERNALPROG=
SRCS= conf.c efimd.c main.c pal.S start.S vers.c
-.PATH: ${.CURDIR}/../../../${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/../../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
CFLAGS+= -I${.CURDIR}/../common
CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../../efi/include
-CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_ARCH}
+CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH}
CFLAGS+= -I${.CURDIR}/../../..
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
-LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_ARCH}
+LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
LDFLAGS= -Wl,-T${LDSCRIPT} -shared -symbolic
${PROG}: ${LDSCRIPT}
-NEWVERSWHAT= "EFI boot" ${MACHINE_ARCH}
+NEWVERSWHAT= "EFI boot" ${MACHINE_CPUARCH}
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
@@ -42,7 +42,7 @@ loader.efi: loader.sym
fi
${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \
-j .rela.dyn -j .reloc -j .sdata -j .text \
- --target=efi-app-${MACHINE_ARCH} ${.ALLSRC} ${.TARGET}
+ --target=efi-app-${MACHINE_CPUARCH} ${.ALLSRC} ${.TARGET}
CLEANFILES= vers.c loader.efi
diff --git a/sys/boot/ia64/ski/Makefile b/sys/boot/ia64/ski/Makefile
index 081fd72..5151435 100644
--- a/sys/boot/ia64/ski/Makefile
+++ b/sys/boot/ia64/ski/Makefile
@@ -17,10 +17,10 @@ CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../../..
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
-LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_ARCH}
+LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
LDFLAGS= -Wl,-T${LDSCRIPT}
-NEWVERSWHAT= "SKI boot" ${MACHINE_ARCH}
+NEWVERSWHAT= "SKI boot" ${MACHINE_CPUARCH}
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
diff --git a/sys/boot/ofw/libofw/Makefile b/sys/boot/ofw/libofw/Makefile
index 8a56a77..b91101b 100644
--- a/sys/boot/ofw/libofw/Makefile
+++ b/sys/boot/ofw/libofw/Makefile
@@ -13,7 +13,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
CFLAGS+= -ffreestanding
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
CFLAGS+= -msoft-float
.endif
@@ -23,7 +23,7 @@ CFLAGS+= -DDISK_DEBUG
.endif
machine:
- ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
+ ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine
CLEANFILES+= machine
diff --git a/sys/boot/uboot/lib/Makefile b/sys/boot/uboot/lib/Makefile
index 894784f..83bd03b 100644
--- a/sys/boot/uboot/lib/Makefile
+++ b/sys/boot/uboot/lib/Makefile
@@ -19,7 +19,7 @@ CFLAGS+= -DDISK_DEBUG
.endif
machine:
- ln -sf ${.CURDIR}/../../../${MACHINE_ARCH}/include machine
+ ln -sf ${.CURDIR}/../../../${MACHINE_CPUARCH}/include machine
CLEANFILES+= machine
diff --git a/sys/boot/zfs/Makefile b/sys/boot/zfs/Makefile
index b48804b..beba733 100644
--- a/sys/boot/zfs/Makefile
+++ b/sys/boot/zfs/Makefile
@@ -10,23 +10,23 @@ CFLAGS+= -I${.CURDIR}/../../../lib/libstand
CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs
CFLAGS+= -ffreestanding
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -mno-sse3
.endif
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -msoft-float
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -m32 -march=i386
.endif
CFLAGS+= -Wformat -Wall
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CLEANFILES+= machine
machine:
ln -sf ${.CURDIR}/../../i386/include machine
@@ -34,6 +34,6 @@ machine:
.include <bsd.lib.mk>
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
beforedepend ${OBJS}: machine
.endif
diff --git a/sys/conf/Makefile.mips b/sys/conf/Makefile.mips
index 0b56bb7..57e1dfe 100644
--- a/sys/conf/Makefile.mips
+++ b/sys/conf/Makefile.mips
@@ -32,9 +32,6 @@ LDSCRIPT_NAME?=ldscript.$M
SYSTEM_LD:= ${SYSTEM_LD:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
SYSTEM_DEP:= ${SYSTEM_DEP:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}}
-# XXX: Such sweeping assumptions...
-MACHINE=mips
-MACHINE_ARCH=mips
KERNLOADADDR?=0x80001000
# This obscure value is defined by CFE for WR160N
# To be changed later
@@ -48,28 +45,6 @@ ARCH_FLAGS?=-march=mips32
EXTRA_FLAGS=-fno-pic -mno-abicalls -G0
HACK_EXTRA_FLAGS=-shared
-.if defined(TARGET_BIG_ENDIAN)
-CFLAGS+=-EB
-SYSTEM_LD+=-EB
-EXTRA_FLAGS+=-EB
-TRAMP_LDFLAGS+=-Wl,-EB
-HACK_EXTRA_FLAGS+=-EB -Wl,-EB
-.if defined(TARGET_64BIT)
-SYSTEM_LD+=-m elf64btsmip_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf64btsmip_fbsd
-.endif
-.else
-CFLAGS+=-EL
-SYSTEM_LD+=-EL
-EXTRA_FLAGS+=-EL
-TRAMP_LDFLAGS+=-Wl,-EL
-HACK_EXTRA_FLAGS+=-EL -Wl,-EL
-.if defined(TARGET_64BIT)
-SYSTEM_LD+=-m elf64ltsmip_fbsd
-HACK_EXTRA_FLAGS+=-Wl,-m,elf64ltsmip_fbsd
-.endif
-.endif
-
# We add the -fno-pic flag to kernels because otherwise performance
# is extremely poor, as well as -mno-abicalls to force no ABI usage.
diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98
index 18ee498..ef040e7 100644
--- a/sys/conf/Makefile.pc98
+++ b/sys/conf/Makefile.pc98
@@ -30,8 +30,6 @@ S= ../../..
.endif
.include "$S/conf/kern.pre.mk"
-MACHINE=pc98
-
MKMODULESENV+= MACHINE=${MACHINE}
%BEFORE_DEPEND
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index 0f5cd66..f8375f0 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -11,7 +11,7 @@
CWARNFLAGS=
.else
CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
- -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
+ -Wmissing-prototypes -Wpointer-arith -Wcast-qual \
-Wundef -Wno-pointer-sign -fformat-extensions
.endif
#
@@ -29,20 +29,20 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
# operations inside the kernel itself. These operations are exclusively
# reserved for user applications.
#
-.if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
+.if ${MACHINE_CPUARCH} == "i386" && ${CC} != "icc"
CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 \
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
INLINE_LIMIT?= 8000
.endif
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm"
INLINE_LIMIT?= 8000
.endif
#
# For IA-64, we use r13 for the kernel globals pointer and we only use
# a very small subset of float registers for integer divides.
#
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
CFLAGS+= -ffixed-r13 -mfixed-range=f32-f127 -fpic #-mno-sdata
INLINE_LIMIT?= 15000
.endif
@@ -52,7 +52,7 @@ INLINE_LIMIT?= 15000
# point emulation. This avoids using floating point registers for integer
# operations which it has a tendency to do.
#
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
CFLAGS+= -mcmodel=medany -msoft-float
INLINE_LIMIT?= 15000
.endif
@@ -62,7 +62,7 @@ INLINE_LIMIT?= 15000
# operations inside the kernel itself. These operations are exclusively
# reserved for user applications.
#
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+= -mcmodel=kernel -mno-red-zone \
-mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow \
-msoft-float -fno-asynchronous-unwind-tables
@@ -74,7 +74,7 @@ INLINE_LIMIT?= 8000
# floating point registers for integer operations which it has a tendency to do.
# Also explicitly disable Altivec instructions inside the kernel.
#
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
CFLAGS+= -msoft-float -mno-altivec
INLINE_LIMIT?= 15000
.endif
@@ -82,7 +82,7 @@ INLINE_LIMIT?= 15000
#
# For MIPS we also tell gcc to use floating point emulation
#
-.if ${MACHINE_ARCH} == "mips"
+.if ${MACHINE_CPUARCH} == "mips"
CFLAGS+= -msoft-float
INLINE_LIMIT?= 8000
.endif
@@ -104,7 +104,7 @@ CFLAGS+= -restrict
#
# GCC SSP support.
#
-.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
- ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
+.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_CPUARCH} != "ia64" && \
+ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
CFLAGS+= -fstack-protector
.endif
diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk
index ed56568..7ec3219 100644
--- a/sys/conf/kern.post.mk
+++ b/sys/conf/kern.post.mk
@@ -76,8 +76,8 @@ gdbinit:
grep -v '# XXX' ${S}/../tools/debugscripts/dot.gdbinit | \
sed "s:MODPATH:${.OBJDIR}/modules:" > .gdbinit
cp ${S}/../tools/debugscripts/gdbinit.kernel ${.CURDIR}
-.if exists(${S}/../tools/debugscripts/gdbinit.${MACHINE_ARCH})
- cp ${S}/../tools/debugscripts/gdbinit.${MACHINE_ARCH} \
+.if exists(${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH})
+ cp ${S}/../tools/debugscripts/gdbinit.${MACHINE_CPUARCH} \
${.CURDIR}/gdbinit.machine
.endif
.endif
@@ -160,8 +160,8 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND} ${CFILES} \
mv .newdep .depend
_ILINKS= machine
-.if ${MACHINE} != ${MACHINE_ARCH}
-_ILINKS+= ${MACHINE_ARCH}
+.if ${MACHINE} != ${MACHINE_CPUARCH}
+_ILINKS+= ${MACHINE_CPUARCH}
.endif
# Ensure that the link exists without depending on it when it exists.
@@ -175,8 +175,8 @@ ${_ILINKS}:
@case ${.TARGET} in \
machine) \
path=${S}/${MACHINE}/include ;; \
- ${MACHINE_ARCH}) \
- path=${S}/${MACHINE_ARCH}/include ;; \
+ ${MACHINE_CPUARCH}) \
+ path=${S}/${MACHINE_CPUARCH}/include ;; \
esac ; \
${ECHO} ${.TARGET} "->" $$path ; \
ln -s $$path ${.TARGET}
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index ee74a9e..2747d32 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -12,7 +12,7 @@ KODIR?= /boot/${KERNEL}
LDSCRIPT_NAME?= ldscript.$M
LDSCRIPT?= $S/conf/${LDSCRIPT_NAME}
-M= ${MACHINE_ARCH}
+M= ${MACHINE_CPUARCH}
AWK?= awk
LINT?= lint
@@ -29,7 +29,7 @@ CTFFLAGS+= -g
. else
_MINUS_O= -O2
. endif
-. if ${MACHINE_ARCH} == "amd64"
+. if ${MACHINE_CPUARCH} == "amd64"
COPTFLAGS?=-O2 -frename-registers -pipe
. else
COPTFLAGS?=${_MINUS_O} -pipe
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 1c788a3..70b09f2 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -120,11 +120,11 @@ CFLAGS+= -fno-common
LDFLAGS+= -d -warn-common
CFLAGS+= ${DEBUG_FLAGS}
-.if ${MACHINE_ARCH} == amd64
+.if ${MACHINE_CPUARCH} == amd64
CFLAGS+= -fno-omit-frame-pointer
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
CFLAGS+= -mlongcall -fno-omit-frame-pointer
.endif
@@ -174,7 +174,7 @@ ${PROG}.symbols: ${FULLPROG}
${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET}
.endif
-.if ${MACHINE_ARCH} != amd64
+.if ${MACHINE_CPUARCH} != amd64
${FULLPROG}: ${KMOD}.kld
${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld
.if !defined(DEBUG_FLAGS)
@@ -187,7 +187,7 @@ EXPORT_SYMS?= NO
CLEANFILES+= export_syms
.endif
-.if ${MACHINE_ARCH} != amd64
+.if ${MACHINE_CPUARCH} != amd64
${KMOD}.kld: ${OBJS}
.else
${FULLPROG}: ${OBJS}
@@ -206,13 +206,13 @@ ${FULLPROG}: ${OBJS}
export_syms | xargs -J% ${OBJCOPY} % ${.TARGET}
.endif
.endif
-.if !defined(DEBUG_FLAGS) && ${MACHINE_ARCH} == amd64
+.if !defined(DEBUG_FLAGS) && ${MACHINE_CPUARCH} == amd64
${OBJCOPY} --strip-debug ${.TARGET}
.endif
_ILINKS=@ machine
-.if ${MACHINE} != ${MACHINE_ARCH}
-_ILINKS+=${MACHINE_ARCH}
+.if ${MACHINE} != ${MACHINE_CPUARCH}
+_ILINKS+=${MACHINE_CPUARCH}
.endif
all: objwarn ${PROG}
@@ -239,8 +239,8 @@ SYSDIR= ${_dir}
${_ILINKS}:
@case ${.TARGET} in \
- ${MACHINE_ARCH}) \
- path=${SYSDIR}/${MACHINE_ARCH}/include ;; \
+ ${MACHINE_CPUARCH}) \
+ path=${SYSDIR}/${MACHINE_CPUARCH}/include ;; \
machine) \
path=${SYSDIR}/${MACHINE}/include ;; \
@) \
@@ -433,11 +433,11 @@ assym.s: @/kern/genassym.sh
.endif
sh @/kern/genassym.sh genassym.o > ${.TARGET}
.if exists(@)
-genassym.o: @/${MACHINE_ARCH}/${MACHINE_ARCH}/genassym.c
+genassym.o: @/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c
.endif
genassym.o: @ machine ${SRCS:Mopt_*.h}
${CC} -c ${CFLAGS:N-fno-common} \
- @/${MACHINE_ARCH}/${MACHINE_ARCH}/genassym.c
+ @/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}/genassym.c
.endif
lint: ${SRCS}
diff --git a/sys/conf/ldscript.mips.octeon1.32 b/sys/conf/ldscript.mips.octeon1.32
index d3b3c41..ccedb83 100644
--- a/sys/conf/ldscript.mips.octeon1.32
+++ b/sys/conf/ldscript.mips.octeon1.32
@@ -7,7 +7,7 @@ OUTPUT_ARCH(mips)
ENTRY(_start)
SECTIONS {
- . = KERNLOADADDR + SIZEOF_HEADERS;
+ . = KERNLOADADDR;
.text . : {
*(.text)
*(.dynamic)
diff --git a/sys/kern/Makefile b/sys/kern/Makefile
index 07c2d57..1680ea0 100644
--- a/sys/kern/Makefile
+++ b/sys/kern/Makefile
@@ -28,7 +28,7 @@ init_sysent.c syscalls.c systrace_args.c ../sys/syscall.h \
# are placed in each source directory. We need to have links to tags files
# from the generic directories that are relative to the machine type, even
# via remote mounts; therefore we use symlinks to $SYSTAGS, which points at
-# ${SYSDIR}/${MACHINE_ARCH}/tags.
+# ${SYSDIR}/${MACHINE_CPUARCH}/tags.
SYSTAGS=/var/db/sys_tags
SYSDIR=/sys
@@ -51,7 +51,7 @@ tags::
links::
rm -f ${SYSTAGS}
- ln -s ${SYSDIR}/${MACHINE_ARCH}/tags ${SYSTAGS}
+ ln -s ${SYSDIR}/${MACHINE_CPUARCH}/tags ${SYSTAGS}
-for i in ${DGEN}; do \
(cd ../$$i && { rm -f tags; ln -s ${SYSTAGS} tags; }) done
-for i in ${ARCH}; do \
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index b83502c..cac1669 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -827,7 +827,7 @@ static int
sysctl_sysctl_name2oid(SYSCTL_HANDLER_ARGS)
{
char *p;
- int error, oid[CTL_MAXNAME], len;
+ int error, oid[CTL_MAXNAME], len = 0;
struct sysctl_oid *op = 0;
SYSCTL_ASSERT_LOCKED();
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 06a4a5d..5b9a891 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -310,7 +310,7 @@ SUBDIR= ${_3dfx} \
${_zfs} \
zlib \
-.if ${MACHINE_ARCH} != "powerpc"
+.if ${MACHINE_CPUARCH} != "powerpc"
_syscons= syscons
_vpo= vpo
.endif
@@ -338,7 +338,7 @@ _pf= pf
_pflog= pflog
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
# XXX some of these can move to the general case when de-i386'ed
# XXX some of these can move now, but are untested on other architectures.
_3dfx= 3dfx
@@ -476,7 +476,7 @@ _snc= snc
.endif
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
_aac= aac
_acpi= acpi
_agp= agp
@@ -564,7 +564,7 @@ _zfs= zfs
.endif
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
# Modules not enabled on ia64 (as compared to i386) include:
# aac acpi aout apm atspeaker drm ibcs2 linprocfs linux ncv
# nsp s3 sbni stg vesa
@@ -599,7 +599,7 @@ _wi= wi
_xe= xe
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
_an= an
_bm= bm
_cpufreq= cpufreq
@@ -608,7 +608,7 @@ _smbfs= smbfs
_sound= sound
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
_auxio= auxio
_em= em
_epic= epic
diff --git a/sys/modules/aac/Makefile b/sys/modules/aac/Makefile
index 6964def..5b6525f 100644
--- a/sys/modules/aac/Makefile
+++ b/sys/modules/aac/Makefile
@@ -2,7 +2,7 @@
.PATH: ${.CURDIR}/../../dev/aac
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SUBDIR= aac_linux
.endif
diff --git a/sys/modules/acpi/acpi/Makefile b/sys/modules/acpi/acpi/Makefile
index 992c59c..032a6dd 100644
--- a/sys/modules/acpi/acpi/Makefile
+++ b/sys/modules/acpi/acpi/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "ia64"
.error "ACPI can only be compiled into the kernel on the amd64 and ia64 platforms"
.endif
@@ -22,7 +22,7 @@
${.CURDIR}/../../../pci \
${.CURDIR}/../../../dev/acpica \
${.CURDIR}/../../../dev/acpica/Osd \
- ${.CURDIR}/../../../${MACHINE_ARCH}/acpica
+ ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica
KMOD= acpi
@@ -97,13 +97,13 @@ opt_ddb.h: Makefile
SRCS+= acpi_machdep.c acpi_wakecode.h acpi_wakeup.c
SRCS+= assym.s madt.c
CLEANFILES+= acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= opt_global.h
CLEANFILES+= acpi_wakedata.h
.endif
acpi_wakecode.h: acpi_wakecode.S assym.s
- ${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \
- MAKESRCPATH=${.CURDIR}/../../../${MACHINE_ARCH}/acpica
+ ${MAKE} -f ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica/Makefile \
+ MAKESRCPATH=${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica
.include <bsd.kmod.mk>
diff --git a/sys/modules/agp/Makefile b/sys/modules/agp/Makefile
index 4026325..f77e38c 100644
--- a/sys/modules/agp/Makefile
+++ b/sys/modules/agp/Makefile
@@ -4,14 +4,14 @@
KMOD= agp
SRCS= agp.c agp_if.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= agp_i810.c agp_intel.c agp_via.c agp_sis.c agp_ali.c agp_amd.c \
agp_nvidia.c agp_ati.c
.endif
.if ${MACHINE} == "i386"
SRCS+= agp_amd64.c
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= agp_amd64.c agp_i810.c agp_via.c
.endif
SRCS+= device_if.h bus_if.h agp_if.h pci_if.h
diff --git a/sys/modules/amr/Makefile b/sys/modules/amr/Makefile
index 4c31997..02de047 100644
--- a/sys/modules/amr/Makefile
+++ b/sys/modules/amr/Makefile
@@ -3,7 +3,7 @@
.PATH: ${.CURDIR}/../../dev/amr
SUBDIR= amr_cam
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= amr_linux
.endif
diff --git a/sys/modules/asr/Makefile b/sys/modules/asr/Makefile
index 7addf52..5873415 100644
--- a/sys/modules/asr/Makefile
+++ b/sys/modules/asr/Makefile
@@ -7,7 +7,7 @@ SRCS= asr.c
SRCS+= opt_scsi.h opt_cam.h
SRCS+= device_if.h bus_if.h pci_if.h
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= opt_asr.h
.endif
diff --git a/sys/modules/bge/Makefile b/sys/modules/bge/Makefile
index f8ebf42..9742e6b 100644
--- a/sys/modules/bge/Makefile
+++ b/sys/modules/bge/Makefile
@@ -5,7 +5,7 @@
KMOD= if_bge
SRCS= if_bge.c miibus_if.h miidevs.h device_if.h bus_if.h pci_if.h
-.if ${MACHINE_ARCH} == sparc64
+.if ${MACHINE_CPUARCH} == sparc64
SRCS+= ofw_bus_if.h
.endif
diff --git a/sys/modules/cpufreq/Makefile b/sys/modules/cpufreq/Makefile
index 75b5c86..69854f4 100644
--- a/sys/modules/cpufreq/Makefile
+++ b/sys/modules/cpufreq/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../dev/cpufreq \
- ${.CURDIR}/../../${MACHINE_ARCH}/cpufreq
+ ${.CURDIR}/../../${MACHINE_CPUARCH}/cpufreq
KMOD= cpufreq
SRCS= ichss.c
diff --git a/sys/modules/cxgb/Makefile b/sys/modules/cxgb/Makefile
index 71cbb7a..a6af817 100644
--- a/sys/modules/cxgb/Makefile
+++ b/sys/modules/cxgb/Makefile
@@ -28,11 +28,11 @@ _toecore = toecore
#_tom = tom
.endif
-.if ${MACHINE_ARCH} == "i386" && exists(${_toe_header})
+.if ${MACHINE_CPUARCH} == "i386" && exists(${_toe_header})
_iw_cxgb = iw_cxgb
.endif
-.if ${MACHINE_ARCH} == "amd64" && exists(${_toe_header})
+.if ${MACHINE_CPUARCH} == "amd64" && exists(${_toe_header})
_iw_cxgb = iw_cxgb
.endif
diff --git a/sys/modules/cyclic/Makefile b/sys/modules/cyclic/Makefile
index db99488..213b3ac 100644
--- a/sys/modules/cyclic/Makefile
+++ b/sys/modules/cyclic/Makefile
@@ -4,13 +4,13 @@
KMOD= cyclic
SRCS= cyclic.c
-
+
SRCS+= vnode_if.h
CFLAGS+= -I${.CURDIR}/../../cddl/compat/opensolaris \
-I${.CURDIR}/../../cddl/contrib/opensolaris/uts/common \
-I${.CURDIR}/../.. \
- -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_ARCH}
+ -I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_CPUARCH}
CFLAGS+= -DDEBUG=1
diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile
index ba46878..93495c3 100644
--- a/sys/modules/dtrace/Makefile
+++ b/sys/modules/dtrace/Makefile
@@ -14,9 +14,9 @@ SUBDIR= dtmalloc \
sdt \
systrace
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= fbt
-.elif ${MACHINE_ARCH} == "i386"
+.elif ${MACHINE_CPUARCH} == "i386"
SUBDIR+= fbt
.endif
diff --git a/sys/modules/dtrace/Makefile.inc b/sys/modules/dtrace/Makefile.inc
index c35764b..db32960 100644
--- a/sys/modules/dtrace/Makefile.inc
+++ b/sys/modules/dtrace/Makefile.inc
@@ -5,7 +5,7 @@ IGNORE_PRAGMA= 1
load :
-kldload cyclic
-kldload dtrace
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
-kldload sdt
-kldload lockstat
-kldload fbt
@@ -18,7 +18,7 @@ load :
unload :
-kldunload systrace
-kldunload profile
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
-kldunload prototype
-kldunload fbt
-kldunload lockstat
diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile
index 08e61a9..5f10e92 100644
--- a/sys/modules/dtrace/dtrace/Makefile
+++ b/sys/modules/dtrace/dtrace/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-ARCHDIR= ${MACHINE_ARCH}
+ARCHDIR= ${MACHINE_CPUARCH}
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common/dtrace
.PATH: ${.CURDIR}/../../../cddl/kern
@@ -12,7 +12,7 @@ SRCS= dtrace.c \
dtrace_asm.S \
dtrace_subr.c
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
SRCS+= dis_tables.c \
instr_size.c
.endif
@@ -25,7 +25,7 @@ SRCS+= assym.s
# These are needed for assym.s
SRCS+= opt_compat.h opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= opt_apic.h
.endif
diff --git a/sys/modules/dtrace/fasttrap/Makefile b/sys/modules/dtrace/fasttrap/Makefile
index 104fd9a..0af63c4 100644
--- a/sys/modules/dtrace/fasttrap/Makefile
+++ b/sys/modules/dtrace/fasttrap/Makefile
@@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris \
-I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
-I${.CURDIR}/../../..
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel
.endif
diff --git a/sys/modules/hptmv/Makefile b/sys/modules/hptmv/Makefile
index 05ceac7..134c207 100644
--- a/sys/modules/hptmv/Makefile
+++ b/sys/modules/hptmv/Makefile
@@ -13,7 +13,7 @@ SRCS+= bus_if.h device_if.h pci_if.h
SRCS+= mv.c entry.c ioctl.c hptproc.c gui_lib.c
OBJS+= hptmvraid.o
-.if $(MACHINE_ARCH) == "amd64"
+.if $(MACHINE_CPUARCH) == "amd64"
HPTMV_RAID_O = amd64-elf.raid.o.uu
.else
HPTMV_RAID_O = i386-elf.raid.o.uu
@@ -48,5 +48,5 @@ DEBUGOPT += -DFOR_DEMO
.endif
CFLAGS = ${DEBUGOPT}
-
+
.include <bsd.kmod.mk>
diff --git a/sys/modules/hptrr/Makefile b/sys/modules/hptrr/Makefile
index 038c5a4..7cbd7e8 100644
--- a/sys/modules/hptrr/Makefile
+++ b/sys/modules/hptrr/Makefile
@@ -9,6 +9,6 @@ SRCS+= hptrr_os_bsd.c hptrr_osm_bsd.c hptrr_config.c
OBJS = hptrr_lib.o
hptrr_lib.o:
- uudecode -p < ${HPTRR}/$(MACHINE_ARCH)-elf.hptrr_lib.o.uu > hptrr_lib.o
+ uudecode -p < ${HPTRR}/$(MACHINE_CPUARCH)-elf.hptrr_lib.o.uu > hptrr_lib.o
.include <bsd.kmod.mk>
diff --git a/sys/modules/hwpmc/Makefile b/sys/modules/hwpmc/Makefile
index 0a696a1..fe7ac4c 100644
--- a/sys/modules/hwpmc/Makefile
+++ b/sys/modules/hwpmc/Makefile
@@ -8,31 +8,31 @@ KMOD= hwpmc
SRCS= hwpmc_mod.c hwpmc_logging.c vnode_if.h
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_piv.c hwpmc_tsc.c
SRCS+= hwpmc_x86.c
SRCS+= device_if.h bus_if.h
.endif
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm"
SRCS+= hwpmc_arm.c
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= hwpmc_amd.c hwpmc_core.c hwpmc_intel.c hwpmc_piv.c hwpmc_ppro.c
SRCS+= hwpmc_pentium.c hwpmc_tsc.c hwpmc_x86.c
SRCS+= device_if.h bus_if.h
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
SRCS+= hwpmc_ia64.c
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
SRCS+= hwpmc_powerpc.c
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
SRCS+= hwpmc_sparc64.c
.endif
diff --git a/sys/modules/i2c/controllers/pcf/Makefile b/sys/modules/i2c/controllers/pcf/Makefile
index 4714cfd..27d9339 100644
--- a/sys/modules/i2c/controllers/pcf/Makefile
+++ b/sys/modules/i2c/controllers/pcf/Makefile
@@ -6,12 +6,12 @@ KMOD= pcf
SRCS= ${envctrl} pcf.c ${pcf_ebus} ${pcf_isa}
SRCS+= bus_if.h device_if.h iicbus_if.h ${isa_if} ${ofw_bus_if}
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
isa_if= isa_if.h
pcf_isa= pcf_isa.c
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
envctrl= envctrl.c
ofw_bus_if= ofw_bus_if.h
pcf_ebus= pcf_ebus.c
diff --git a/sys/modules/io/Makefile b/sys/modules/io/Makefile
index d90a8e4..1612fa0e 100644
--- a/sys/modules/io/Makefile
+++ b/sys/modules/io/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../dev/io
-.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
KMOD= io
SRCS= iodev.c io.c
diff --git a/sys/modules/le/Makefile b/sys/modules/le/Makefile
index dd202fb..d267cbe 100644
--- a/sys/modules/le/Makefile
+++ b/sys/modules/le/Makefile
@@ -7,7 +7,7 @@ SRCS= am7990.c am79900.c ${if_le_cbus} ${if_le_isa} ${if_le_lebuffer}
SRCS+= ${if_le_ledma} if_le_pci.c lance.c ${lebuffer_sbus}
SRCS+= bus_if.h device_if.h ${isa_if} ${ofw_bus_if} pci_if.h
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
.if ${MACHINE} == "pc98"
if_le_cbus= if_le_cbus.c
.else
diff --git a/sys/modules/linprocfs/Makefile b/sys/modules/linprocfs/Makefile
index f0f00cb..4b1b375 100644
--- a/sys/modules/linprocfs/Makefile
+++ b/sys/modules/linprocfs/Makefile
@@ -8,7 +8,7 @@ SRCS= vnode_if.h \
linprocfs.c \
opt_compat.h
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+=-DCOMPAT_LINUX32
.endif
diff --git a/sys/modules/linsysfs/Makefile b/sys/modules/linsysfs/Makefile
index 1320212..4017967 100644
--- a/sys/modules/linsysfs/Makefile
+++ b/sys/modules/linsysfs/Makefile
@@ -8,7 +8,7 @@ SRCS= vnode_if.h \
linsysfs.c \
opt_compat.h
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
CFLAGS+=-DCOMPAT_LINUX32
.endif
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile
index a24b6b2..87732ac 100644
--- a/sys/modules/linux/Makefile
+++ b/sys/modules/linux/Makefile
@@ -1,11 +1,11 @@
# $FreeBSD$
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SFX= 32
CFLAGS+=-DCOMPAT_IA32 -DCOMPAT_LINUX32
.endif
-.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX}
+.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX}
KMOD= linux
SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c \
@@ -18,13 +18,13 @@ SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c \
# XXX: for assym.s
SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= opt_apic.h
.endif
OBJS= linux${SFX}_locore.o linux${SFX}_support.o
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= linux_ptrace.c imgact_linux.c opt_cpu.h
.endif
diff --git a/sys/modules/mem/Makefile b/sys/modules/mem/Makefile
index 812da14..b4fdb9c 100644
--- a/sys/modules/mem/Makefile
+++ b/sys/modules/mem/Makefile
@@ -2,17 +2,17 @@
.PATH: ${.CURDIR}/../../dev/mem
.PATH: ${.CURDIR}/../../${MACHINE}/${MACHINE}
-.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
KMOD= mem
SRCS= memdev.c mem.c
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
SRCS+= memutil.c
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= i686_mem.c k6_mem.c
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= amd64_mem.c
.endif
SRCS+= bus_if.h device_if.h
diff --git a/sys/modules/mfi/Makefile b/sys/modules/mfi/Makefile
index a58e968..00caa57 100644
--- a/sys/modules/mfi/Makefile
+++ b/sys/modules/mfi/Makefile
@@ -4,7 +4,7 @@
SUBDIR= mfip
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= mfi_linux
.endif
diff --git a/sys/modules/ndis/Makefile b/sys/modules/ndis/Makefile
index 8ef7089..b4dc428 100644
--- a/sys/modules/ndis/Makefile
+++ b/sys/modules/ndis/Makefile
@@ -8,11 +8,11 @@ SRCS+= kern_windrv.c subr_usbd.c
SRCS+= device_if.h bus_if.h pci_if.h vnode_if.h
SRCS+= opt_bus.h opt_usb.h usb_if.h usbdevs.h
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= winx64_wrap.S
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= winx32_wrap.S
.endif
diff --git a/sys/modules/opensolaris/Makefile b/sys/modules/opensolaris/Makefile
index a0f08fb..22ac8f9 100644
--- a/sys/modules/opensolaris/Makefile
+++ b/sys/modules/opensolaris/Makefile
@@ -8,8 +8,8 @@ SRCS= opensolaris.c \
opensolaris_kmem.c \
opensolaris_misc.c
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64"
-.PATH: ${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "ia64" || ${MACHINE_CPUARCH} == "sparc64"
+.PATH: ${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic/${MACHINE_CPUARCH}
SRCS+= opensolaris_atomic.S
.else
SRCS+= opensolaris_atomic.c
diff --git a/sys/modules/ppc/Makefile b/sys/modules/ppc/Makefile
index db36e73..c097002 100644
--- a/sys/modules/ppc/Makefile
+++ b/sys/modules/ppc/Makefile
@@ -6,18 +6,18 @@ SRCS= bus_if.h device_if.h ppbus_if.h isa_if.h pci_if.h serdev_if.h \
opt_ppc.h opt_isa.h \
ppc.c ppc_pci.c ppc_puc.c
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= ppc_acpi.c ppc_isa.c
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
.if ${MACHINE} != "pc98"
SRCS+= ppc_acpi.c
.endif
SRCS+= ppc_isa.c
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
SRCS+= ppc_acpi.c
.endif
diff --git a/sys/modules/procfs/Makefile b/sys/modules/procfs/Makefile
index c3b3633..221d633 100644
--- a/sys/modules/procfs/Makefile
+++ b/sys/modules/procfs/Makefile
@@ -34,7 +34,7 @@ opt_compat.h:
echo "#define COMPAT_FREEBSD4 1" >> ${.TARGET}
echo "#define COMPAT_FREEBSD5 1" >> ${.TARGET}
echo "#define COMPAT_FREEBSD6 1" >> ${.TARGET}
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
echo "#define COMPAT_IA32 1" >> ${.TARGET}
echo "#define COMPAT_LINUX32 1" >> ${.TARGET}
.endif
diff --git a/sys/modules/scc/Makefile b/sys/modules/scc/Makefile
index c1678b7..8a40e0b 100644
--- a/sys/modules/scc/Makefile
+++ b/sys/modules/scc/Makefile
@@ -5,7 +5,7 @@
.if ${MACHINE} == "sparc64"
scc_bfe= scc_bfe_ebus.c scc_bfe_sbus.c
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c
.endif
diff --git a/sys/modules/smbfs/Makefile b/sys/modules/smbfs/Makefile
index e8432e3..476e598 100644
--- a/sys/modules/smbfs/Makefile
+++ b/sys/modules/smbfs/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
.PATH: ${.CURDIR}/../../crypto/des \
- ${.CURDIR}/../../crypto/des/arch/${MACHINE_ARCH} \
+ ${.CURDIR}/../../crypto/des/arch/${MACHINE_CPUARCH} \
${.CURDIR}/../../kern \
${.CURDIR}/../../libkern \
${.CURDIR}/../../netsmb \
@@ -21,7 +21,7 @@ SRCS= vnode_if.h \
# NETSMBCRYPTO
SRCS+= des_ecb.c des_setkey.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= des_enc.S
.else
SRCS+= des_enc.c
diff --git a/sys/modules/sound/driver/Makefile b/sys/modules/sound/driver/Makefile
index f070119..ef018b2 100644
--- a/sys/modules/sound/driver/Makefile
+++ b/sys/modules/sound/driver/Makefile
@@ -5,17 +5,17 @@ SUBDIR+= envy24 envy24ht es137x ess fm801 hda ich maestro maestro3
SUBDIR+= neomagic sb16 sb8 sbc solo spicds t4dwave via8233
SUBDIR+= via82c686 vibes driver uaudio
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SUBDIR+= cmi mss
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
.if ${MACHINE} == "sparc64"
SUBDIR+= audiocs
.endif
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
SUBDIR+= ai2s davbus
.endif
diff --git a/sys/modules/sound/sound/Makefile b/sys/modules/sound/sound/Makefile
index 78f91d4..42cfc24 100644
--- a/sys/modules/sound/sound/Makefile
+++ b/sys/modules/sound/sound/Makefile
@@ -44,7 +44,7 @@ CLEANFILES+= feeder_eq_gen.h feeder_rate_gen.h snd_fxdiv_gen.h
EXPORT_SYMS= YES # XXX evaluate
-.if ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "powerpc"
# Create an empty opt_isa.h in order to keep kmod.mk from linking in an
# existing one from KERNBUILDDIR which possibly has DEV_ISA defined so
# sound.ko is always built without isadma support.
diff --git a/sys/modules/svr4/Makefile b/sys/modules/svr4/Makefile
index 5055098..9fc0901 100644
--- a/sys/modules/svr4/Makefile
+++ b/sys/modules/svr4/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/svr4 ${.CURDIR}/../../compat/svr4
+.PATH: ${.CURDIR}/../../${MACHINE_CPUARCH}/svr4 ${.CURDIR}/../../compat/svr4
KMOD= svr4
SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_svr4.h \
vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c \
diff --git a/sys/modules/syscons/Makefile b/sys/modules/syscons/Makefile
index 71e84d0..db92a25 100644
--- a/sys/modules/syscons/Makefile
+++ b/sys/modules/syscons/Makefile
@@ -13,11 +13,11 @@ SUBDIR= ${_apm} \
${_star} \
${_warp}
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
_apm= apm
.endif
-.if ${MACHINE_ARCH} != "sparc64"
+.if ${MACHINE_CPUARCH} != "sparc64"
_daemon= daemon
_dragon= dragon
_fire= fire
diff --git a/sys/modules/uart/Makefile b/sys/modules/uart/Makefile
index d47e2ab..84ea8d9 100644
--- a/sys/modules/uart/Makefile
+++ b/sys/modules/uart/Makefile
@@ -2,7 +2,7 @@
.PATH: ${.CURDIR}/../../dev/uart
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
uart_bus_ebus= uart_bus_ebus.c
ofw_bus_if= ofw_bus_if.h
.endif
diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile
index 7f43e2b..dc4c178 100644
--- a/sys/modules/usb/Makefile
+++ b/sys/modules/usb/Makefile
@@ -35,16 +35,16 @@ SUBDIR += uether aue axe cdce cue kue rue udav uhso
SUBDIR += usfs umass urio
SUBDIR += quirk template
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
_urtw= urtw
.endif
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm"
_at91dci= at91dci
_atmegadci= atmegadci
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
_urtw= urtw
.endif
diff --git a/sys/modules/vx/Makefile b/sys/modules/vx/Makefile
index 6293b1a..e1822ea 100644
--- a/sys/modules/vx/Makefile
+++ b/sys/modules/vx/Makefile
@@ -4,7 +4,7 @@
KMOD= if_vx
SRCS= if_vx.c if_vx_pci.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= if_vx_eisa.c
.endif
SRCS+= device_if.h bus_if.h pci_if.h eisa_if.h
diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile
index c95a840..e85f6ec 100644
--- a/sys/modules/zfs/Makefile
+++ b/sys/modules/zfs/Makefile
@@ -27,8 +27,8 @@ SRCS+= opensolaris_taskq.c
SRCS+= opensolaris_vfs.c
SRCS+= opensolaris_zone.c
-.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64"
-.PATH: ${SUNW}/common/atomic/${MACHINE_ARCH}
+.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "ia64" || ${MACHINE_CPUARCH} == "sparc64"
+.PATH: ${SUNW}/common/atomic/${MACHINE_CPUARCH}
SRCS+= opensolaris_atomic.S
.else
.PATH: ${.CURDIR}/../../cddl/compat/opensolaris/kern
diff --git a/sys/vm/default_pager.c b/sys/vm/default_pager.c
index ceb2c77..941ff03 100644
--- a/sys/vm/default_pager.c
+++ b/sys/vm/default_pager.c
@@ -80,7 +80,7 @@ default_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
vm_ooffset_t offset, struct ucred *cred)
{
vm_object_t object;
- struct uidinfo *uip;
+ struct uidinfo *uip = NULL;
if (handle != NULL)
panic("default_pager_alloc: handle specified");
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 3bb82de..03b17c0 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -238,7 +238,7 @@ SUBDIR= alias \
${_ypmatch} \
${_ypwhich}
-.if ${MACHINE_ARCH} != "arm"
+.if ${MACHINE_CPUARCH} != "arm"
_truss= truss
.endif
@@ -365,7 +365,7 @@ _usbhidaction= usbhidaction
_usbhidctl= usbhidctl
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
.if ${MK_NCP} != "no"
_ncplist= ncplist
_ncplogin= ncplogin
@@ -373,11 +373,11 @@ _ncplogin= ncplogin
_smbutil= smbutil
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
_smbutil= smbutil
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
.if ${MK_NCP} != "no"
_ncplist= ncplist
_ncplogin= ncplogin
@@ -385,11 +385,11 @@ _ncplogin= ncplogin
_smbutil= smbutil
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
_smbutil= smbutil
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
_smbutil= smbutil
.endif
diff --git a/usr.bin/ldd/Makefile b/usr.bin/ldd/Makefile
index cd17228..fd2b7b4 100644
--- a/usr.bin/ldd/Makefile
+++ b/usr.bin/ldd/Makefile
@@ -2,7 +2,7 @@
PROG?= ldd
SRCS= ldd.c
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= sods.c
.endif
diff --git a/usr.bin/truss/Makefile b/usr.bin/truss/Makefile
index d907ad5..ca0ce92 100644
--- a/usr.bin/truss/Makefile
+++ b/usr.bin/truss/Makefile
@@ -2,7 +2,7 @@
NO_WERROR=
PROG= truss
-SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c ${MACHINE_ARCH}-fbsd.c
+SRCS= main.c setup.c syscalls.c syscalls.h ioctl.c ${MACHINE_CPUARCH}-fbsd.c
CFLAGS+= -I${.CURDIR} -I.
CLEANFILES= syscalls.master syscalls.h ioctl.c
@@ -19,7 +19,7 @@ syscalls.h: syscalls.master
ioctl.c: ${.CURDIR}/../kdump/mkioctls
sh ${.CURDIR}/../kdump/mkioctls ${DESTDIR}/usr/include > ${.TARGET}
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
SRCS+= i386-linux.c linux_syscalls.h
CLEANFILES+=i386l-syscalls.master linux_syscalls.h
@@ -31,7 +31,7 @@ linux_syscalls.h: i386l-syscalls.master
${.CURDIR}/i386linux.conf
.endif
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
SRCS+= amd64-linux32.c linux32_syscalls.h
CLEANFILES+=amd64l32-syscalls.master linux32_syscalls.h
diff --git a/usr.bin/xlint/Makefile.inc b/usr.bin/xlint/Makefile.inc
index 0c1b97a..f4956ab 100644
--- a/usr.bin/xlint/Makefile.inc
+++ b/usr.bin/xlint/Makefile.inc
@@ -5,8 +5,16 @@ WARNS?= 0
.PATH: ${.CURDIR}/../common
+# These assignments duplicate much of the functionality of
+# MACHINE_CPUARCH, but there's no easy way to export make functions...
+
+.if defined(TARGET_ARCH)
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+.else
+TARGET_CPUARCH=${MACHINE_CPUARCH}
+.endif
TARGET_ARCH?= ${MACHINE_ARCH}
-CFLAGS+= -I${.CURDIR}/../arch/${TARGET_ARCH}
+CFLAGS+= -I${.CURDIR}/../arch/${TARGET_CPUARCH}
CFLAGS+= -I${.CURDIR}/../common
OBJECT_FMT= ELF
diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile
index cdcaaf3..e1b51c3 100644
--- a/usr.sbin/Makefile
+++ b/usr.sbin/Makefile
@@ -393,11 +393,11 @@ _sendmail= sendmail
.endif
.if ${MK_SYSINSTALL} != "no"
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
- ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
+ ${MACHINE_CPUARCH} == "sparc64"
_sade= sade
.endif
-.if ${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
+.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
_sysinstall= sysinstall
.endif
.endif
@@ -408,7 +408,7 @@ _crunch= crunch
.endif
.if ${MK_USB} != "no"
-.if ${MACHINE_ARCH} != "ia64"
+.if ${MACHINE_CPUARCH} != "ia64"
_uathload= uathload
.endif
_uhsoctl= uhsoctl
@@ -422,11 +422,11 @@ _wlandebug= wlandebug
_wpa= wpa
.endif
-.if ${MACHINE_ARCH} == "arm"
+.if ${MACHINE_CPUARCH} == "arm"
_kgmon= kgmon
.endif
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "i386"
.if ${MK_APM} != "no"
_apm= apm
_apmd= apmd
@@ -467,7 +467,7 @@ _boot98cfg= boot98cfg
# kgzip: builds, but missing support files
# mptable: broken (not 64 bit clean)
# pnpinfo: crashes (not really useful anyway)
-.if ${MACHINE_ARCH} == "amd64"
+.if ${MACHINE_CPUARCH} == "amd64"
.if ${MK_ACPI} != "no"
_acpi= acpi
.endif
@@ -495,7 +495,7 @@ _spkrtest= spkrtest
_zzz= zzz
.endif
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_CPUARCH} == "ia64"
.if ${MK_ACPI} != "no"
_acpi= acpi
.endif
@@ -504,13 +504,13 @@ _mount_smbfs= mount_smbfs
_zzz= zzz
.endif
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_CPUARCH} == "powerpc"
_mount_smbfs= mount_smbfs
_nvram= nvram
_ofwdump= ofwdump
.endif
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
_eeprom= eeprom
_mount_smbfs= mount_smbfs
_ofwdump= ofwdump
diff --git a/usr.sbin/ac/Makefile b/usr.sbin/ac/Makefile
index 46064fc..576dbb3 100644
--- a/usr.sbin/ac/Makefile
+++ b/usr.sbin/ac/Makefile
@@ -4,7 +4,7 @@ PROG= ac
MAN= ac.8
# Temporary, while tracking down problem wrt 64-bit time_t's on sparc64
-.if ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_CPUARCH} == "sparc64"
CFLAGS+=-DDEBUG
.endif
diff --git a/usr.sbin/amd/Makefile.inc b/usr.sbin/amd/Makefile.inc
index 673edc1..1965ff9 100644
--- a/usr.sbin/amd/Makefile.inc
+++ b/usr.sbin/amd/Makefile.inc
@@ -27,7 +27,7 @@ CFLAGS+= -DHAVE_LOCALCONFIG_H
CFLAGS+= -DYES_HESIOD
.endif
-CFLAGS+= -DHOST_CPU=\"${MACHINE_ARCH}\" -DHOST_ARCH=\"${MACHINE_ARCH}\"
+CFLAGS+= -DHOST_CPU=\"${MACHINE_CPUARCH}\" -DHOST_ARCH=\"${MACHINE_ARCH}\"
.if exists(${.OBJDIR}/../libamu)
LIBAMUDIR= ${.OBJDIR}/../libamu
diff --git a/usr.sbin/apm/Makefile b/usr.sbin/apm/Makefile
index 08ed25f..3cc6f50 100644
--- a/usr.sbin/apm/Makefile
+++ b/usr.sbin/apm/Makefile
@@ -3,6 +3,6 @@
PROG= apm
MAN= apm.8
MLINKS= apm.8 apmconf.8
-MANSUBDIR= /${MACHINE_ARCH}
+MANSUBDIR= /${MACHINE_CPUARCH}
.include <bsd.prog.mk>
diff --git a/usr.sbin/crunch/crunchide/Makefile b/usr.sbin/crunch/crunchide/Makefile
index 0f85254..64dc9d4 100644
--- a/usr.sbin/crunch/crunchide/Makefile
+++ b/usr.sbin/crunch/crunchide/Makefile
@@ -3,6 +3,14 @@
PROG= crunchide
SRCS= crunchide.c
+# These assignments duplicate much of the functionality of
+# MACHINE_CPUARCH, but there's no easy way to export make functions...
+
+.if defined(TARGET_ARCH)
+TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/}
+.else
+TARGET_CPUARCH=${MACHINE_CPUARCH}
+.endif
TARGET_ARCH?= ${MACHINE_ARCH}
.if ${TARGET_ARCH} == i386 && ${MACHINE_ARCH} == i386
@@ -10,8 +18,8 @@ CFLAGS+=-DNLIST_AOUT
SRCS+= exec_aout.c
.endif
-.if ${TARGET_ARCH} == ia64 || \
- ${TARGET_ARCH} == sparc64 || ${TARGET_ARCH} == amd64
+.if ${TARGET_CPUARCH} == ia64 || \
+ ${TARGET_CPUARCH} == sparc64 || ${TARGET_CPUARCH} == amd64
CFLAGS+=-DNLIST_ELF64
SRCS+= exec_elf64.c
exec_elf64.o: exec_elf32.c
diff --git a/usr.sbin/kldxref/Makefile b/usr.sbin/kldxref/Makefile
index 2f15505..c877a8a 100644
--- a/usr.sbin/kldxref/Makefile
+++ b/usr.sbin/kldxref/Makefile
@@ -7,8 +7,8 @@ SRCS= kldxref.c ef.c ef_obj.c
WARNS?= 2
CFLAGS+=-fno-strict-aliasing
-.if exists(ef_${MACHINE_ARCH}.c)
-SRCS+= ef_${MACHINE_ARCH}.c
+.if exists(ef_${MACHINE_CPUARCH}.c)
+SRCS+= ef_${MACHINE_CPUARCH}.c
.else
SRCS+= ef_nop.c
.endif
diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile
index bd94155..ad28489 100644
--- a/usr.sbin/sade/Makefile
+++ b/usr.sbin/sade/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.if ${MACHINE_ARCH} != "ia64"
+.if ${MACHINE_CPUARCH} != "ia64"
_wizard= wizard.c
.endif
diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile
index bd08ac1..7a781b9 100644
--- a/usr.sbin/sysinstall/Makefile
+++ b/usr.sbin/sysinstall/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.if ${MACHINE_ARCH} != "ia64"
+.if ${MACHINE_CPUARCH} != "ia64"
_wizard= wizard.c
.endif
diff --git a/usr.sbin/tcpdump/tcpdump/Makefile b/usr.sbin/tcpdump/tcpdump/Makefile
index 6f072b7..c296943 100644
--- a/usr.sbin/tcpdump/tcpdump/Makefile
+++ b/usr.sbin/tcpdump/tcpdump/Makefile
@@ -46,7 +46,7 @@ SRCS+= print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c \
print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c
CFLAGS+= -DINET6
.endif
-.if ${MACHINE_ARCH} != "i386"
+.if ${MACHINE_CPUARCH} != "i386"
CFLAGS+= -DLBL_ALIGN
.endif
OpenPOWER on IntegriCloud