Date: Wed, 10 Mar 2010 07:49:17 +0000 (UTC) From: Juli Mallett <jmallett@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r204946 - user/jmallett/octeon/gnu/usr.bin/cc Message-ID: <201003100749.o2A7nHxV072508@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003100749.o2A7nHxV072508>