svn commit: r204946 - user/jmallett/octeon/gnu/usr.bin/cc

Juli Mallett jmallett at FreeBSD.org
Wed Mar 10 07:49:18 UTC 2010


Author: jmallett
Date: Wed Mar 10 07:49:17 2010
New Revision: 204946
URL: http://svn.freebsd.org/changeset/base/204946

Log:
  If TARGET_CPUTYPE is set while building world, we have to set GCC's default ISA,
  or binutils will refuse to link things built as part of world with things compiled
  without specifying the right -march.

Modified:
  user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc

Modified: user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Wed Mar 10 07:25:16 2010	(r204945)
+++ user/jmallett/octeon/gnu/usr.bin/cc/Makefile.inc	Wed Mar 10 07:49:17 2010	(r204946)
@@ -44,6 +44,30 @@ MIPS_ABI_DEFAULT=ABI_64
 .endif
 .endif
 
+# GCC by default takes the ISA from the ABI's requirements.  If world is built
+# with a superior ISA, since we lack multilib, we have to set the right
+# default ISA to be able to link against what's in /usr/lib.  Terrible stuff.
+.if defined(TARGET_CPUTYPE)
+.if ${TARGET_CPUTYPE} == "mips1"
+MIPS_ISA_DEFAULT=1
+.elif ${TARGET_CPUTYPE} == "mips2"
+MIPS_ISA_DEFAULT=2
+.elif ${TARGET_CPUTYPE} == "mips3"
+MIPS_ISA_DEFAULT=3
+.elif ${TARGET_CPUTYPE} == "mips4"
+MIPS_ISA_DEFAULT=4
+.elif ${TARGET_CPUTYPE} == "mips32"
+MIPS_ISA_DEFAULT=32
+.elif ${TARGET_CPUTYPE} == "mips32r2"
+MIPS_ISA_DEFAULT=32r2
+.elif ${TARGET_CPUTYPE} == "mips64"
+MIPS_ISA_DEFAULT=64
+.else
+# Let's hope from-abi is good enough.
+.endif
+CFLAGS += -DMIPS_ISA_DEFAULT=${MIPS_ISA_DEFAULT}
+.endif
+
 MIPS_ABI_DEFAULT?=ABI_32
 CFLAGS += -DMIPS_ABI_DEFAULT=${MIPS_ABI_DEFAULT}
 .endif


More information about the svn-src-user mailing list