PERFORCE change 101540 for review
Bruce M Simpson
bms at FreeBSD.org
Fri Jul 14 12:04:15 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=101540
Change 101540 by bms at bms_montagne on 2006/07/14 12:03:42
Add first cut userland compiler flags.
Add the use of the cpu keyword to kernel configuration files.
Add cpu compile-time flags CPU_MIPS32 and CPU_MIPS64.
Add explicit ARCH_FLAGS for the compiler to kernel configuration
files. There is currently no cleaner way of doing this.
Add explicit makeoptions for MIPS_LITTLE_ENDIAN which causes
Makefile.mips to use the -EL flag for generating little endian code.
Update the config(5) man page.
Remove -mno-abicalls from kern.mk as it belongs in Makefile.mips,
where it exists as -fno-pic.
Affected files ...
.. //depot/projects/mips2/src/share/mk/bsd.cpu.mk#2 edit
.. //depot/projects/mips2/src/sys/conf/Makefile.mips#7 edit
.. //depot/projects/mips2/src/sys/conf/kern.mk#6 edit
.. //depot/projects/mips2/src/sys/conf/options.mips#2 edit
.. //depot/projects/mips2/src/sys/mips/conf/MALTA#2 edit
.. //depot/projects/mips2/src/sys/mips/conf/QEMU#5 edit
.. //depot/projects/mips2/src/usr.sbin/config/config.5#2 edit
Differences ...
==== //depot/projects/mips2/src/share/mk/bsd.cpu.mk#2 (text+ko) ====
@@ -18,6 +18,8 @@
. elif ${MACHINE_ARCH} == "sparc64"
. elif ${MACHINE_ARCH} == "arm"
MACHINE_CPU = arm
+. elif ${MACHINE_ARCH} == "mips"
+MACHINE_CPU = mips
. endif
.else
@@ -112,6 +114,14 @@
. else
_CPUCFLAGS = -mcpu=${CPUTYPE}
. endif
+. elif ${MACHINE_ARCH} == "mips"
+. if ${CPUTYPE} == "mips32"
+_CPUCFLAGS = -march=mips32
+. elif ${CPUTYPE} == "mips64"
+_CPUCFLAGS = -march=mips64
+. elif ${CPUTYPE} == "mipsr4kc"
+_CPUCFLAGS = -march=r4kc
+. endif
. endif
# Set up the list of CPU features based on the CPU type. This is an
==== //depot/projects/mips2/src/sys/conf/Makefile.mips#7 (text+ko) ====
@@ -28,19 +28,15 @@
.endif
.include "$S/conf/kern.pre.mk"
+# XXX: Such sweeping assumptions...
MACHINE=mips
MACHINE_ARCH=mips
MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
-#
-# XXXMIPS: Without it, you'll be bombed by warnings.
-#
-ARCH_FLAGS=-march=mips32
-CFLAGS+=-fno-pic $(ARCH_FLAGS)
-SYSTEM_LD+= -Ttext 0x80100000
-HACK_EXTRA_FLAGS+=-fno-pic $(ARCH_FLAGS)
-ASM_FLAGS+=${CFLAGS} -D_LOCORE -DLOCORE
+# We default to the MIPS32 ISA, if none specified in the
+# kernel configuration file.
+ARCH_FLAGS?=-march=mips32
.if defined(MIPS_LITTLE_ENDIAN)
CFLAGS+=-EL
@@ -48,6 +44,15 @@
HACK_EXTRA_FLAGS+=-EL -Wl,-EL
.endif
+# We add the -fno-pic flag to kernels because otherwise performance
+# is extremely poor. (XXX: Can replace with -mno-abicalls).
+CFLAGS+=-fno-pic $(ARCH_FLAGS)
+HACK_EXTRA_FLAGS+=-fno-pic $(ARCH_FLAGS)
+
+# XXX hardcoded kernel entry point
+SYSTEM_LD+= -Ttext 0x80100000
+ASM_FLAGS+=${CFLAGS} -D_LOCORE -DLOCORE
+
%BEFORE_DEPEND
%OBJS
==== //depot/projects/mips2/src/sys/conf/kern.mk#6 (text+ko) ====
@@ -83,12 +83,9 @@
#
# For MIPS we also tell gcc to use floating point emulation.
-# We also force a non-PIC kernel to be built (-mno-abicalls).
#
.if ${MACHINE_ARCH} == "mips"
-CFLAGS+= -msoft-float -mno-abicalls
-# XXX for debugging the build
-#CFLAGS+= -save-temps
+CFLAGS+= -msoft-float
INLINE_LIMIT?= 15000
.endif
==== //depot/projects/mips2/src/sys/conf/options.mips#2 (text+ko) ====
@@ -1,6 +1,8 @@
# $FreeBSD$
CPU_MIPS4KC opt_global.h
+CPU_MIPS32 opt_global.h
+CPU_MIPS64 opt_global.h
KERNPHYSADDR opt_global.h
KERNVIRTADDR opt_global.h
PHYSADDR opt_global.h
==== //depot/projects/mips2/src/sys/mips/conf/MALTA#2 (text+ko) ====
@@ -18,8 +18,11 @@
# $FreeBSD$
machine mips
+cpu CPU_R4KC
ident MALTA
+makeoptions ARCH_FLAGS=-march=r4kc
+
# Don't build any modules yet.
makeoptions MODULES_OVERRIDE=""
==== //depot/projects/mips2/src/sys/mips/conf/QEMU#5 (text+ko) ====
@@ -18,8 +18,13 @@
# $FreeBSD$
machine mips
+cpu CPU_MIPS32
ident QEMU
+# XXX: These two options must be defined in MIPS kernel configs.
+makeoptions MIPS_LITTLE_ENDIAN=defined
+makeoptions ARCH_FLAGS=-march=mips32
+
# Don't build any modules yet.
makeoptions MODULES_OVERRIDE=""
==== //depot/projects/mips2/src/usr.sbin/config/config.5#2 (text+ko) ====
@@ -23,7 +23,7 @@
.\"
.\" $FreeBSD: src/usr.sbin/config/config.5,v 1.9 2006/02/12 07:56:11 jkoshy Exp $
.\"
-.Dd December 3, 2005
+.Dd July 14, 2006
.Dt CONFIG 5
.Os
.Sh NAME
@@ -180,6 +180,8 @@
The Intel x86 based PC architecture.
.It Cm ia64
The Intel IA64 architecture.
+.It Cm mips
+The MIPS architecture.
.It Cm pc98
The PC98 architecture.
.It Cm powerpc
More information about the p4-projects
mailing list