Subject: MIPS kernel Makefile changes
To: None <port-mips@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: port-mips
Date: 09/28/2001 16:51:55
Folks,

With the following changes we can get rid of separate ld scripts
for BE and LE kernels.  I'll copy one of the existing scripts to
"kern.ldscript" and remove the OUTPUT_FORMAT entry from the script.
This also allows us to use a common kernel script for linking LKMs
as well.  I'll look at a similar change for stand.ldscript.{be,le}
too.

I've also simplified some of the ${ENDIAN} goop.

I'll commit this in a couple of days...

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD CDs, Support and Service:    http://www.wasabisystems.com/


? kern.ldscript
Index: Makefile.mips
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/mips/conf/Makefile.mips,v
retrieving revision 1.16
diff -d -p -u -r1.16 Makefile.mips
--- Makefile.mips	2001/07/19 01:46:15	1.16
+++ Makefile.mips	2001/09/28 06:45:28
@@ -46,7 +46,8 @@ MIPS=		$S/arch/mips
 
 HAVE_EGCS!=	${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
 INCLUDES=	-I. -I$S/arch -I$S -nostdinc
-CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT -D${TARGET_MACHINE}
+CPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT \
+		-D${TARGET_MACHINE}
 CWARNFLAGS?=	-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes \
 		-Wpointer-arith
 # XXX Delete -Wuninitialized for now, since the compiler doesn't
@@ -56,20 +57,15 @@ CWARNFLAGS+=	-Wno-uninitialized
 CWARNFLAGS+=	-Wno-main
 .endif
 GP?=		${DEFGP}
-CFLAGS=		${DEBUG} ${COPTS} ${CWARNFLAGS} ${GP} \
+CFLAGS=		${ENDIAN} ${DEBUG} ${COPTS} ${CWARNFLAGS} ${GP} \
 		-mno-abicalls -mno-half-pic
-AFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
-LINKFLAGS+=	-Ttext ${TEXTADDR} -e start ${GP}
+AFLAGS=		${ENDIAN} -x assembler-with-cpp -traditional-cpp -D_LOCORE
+LINKFLAGS+=	${ENDIAN} -Ttext ${TEXTADDR} -e start ${GP} \
+		-T ${MIPS}/conf/kern.ldscript
 .if (${ENDIAN} == "-EB")
-LINKFLAGS+=	-T ${MIPS}/conf/kern.ldscript.be
-CFLAGS+=	-EB
-AFLAGS+=	-EB
-LD+=		-EB
+LINKFLAGS+=	--oformat elf32-bigmips
 .else
-LINKFLAGS+=	-T ${MIPS}/conf/kern.ldscript.le
-CFLAGS+=	-EL
-AFLAGS+=	-EL
-LD+=		-EL
+LINKFLAGS+=	--oformat elf32-littlemips
 .endif
 STRIPFLAGS=	-g -X -x