From owner-svn-ports-all@freebsd.org Fri Jun 8 16:05:08 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFCF101EAFA; Fri, 8 Jun 2018 16:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48F5168F6E; Fri, 8 Jun 2018 16:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28EB31144F; Fri, 8 Jun 2018 16:05:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w58G57j0049605; Fri, 8 Jun 2018 16:05:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w58G57pT049604; Fri, 8 Jun 2018 16:05:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201806081605.w58G57pT049604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 8 Jun 2018 16:05:07 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r472011 - head/devel/powerpc64-gcc/files X-SVN-Group: ports-head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/devel/powerpc64-gcc/files X-SVN-Commit-Revision: 472011 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:05:09 -0000 Author: jhb (src,doc committer) Date: Fri Jun 8 16:05:07 2018 New Revision: 472011 URL: https://svnweb.freebsd.org/changeset/ports/472011 Log: Use mips3 as the default MIPS ISA for 32-bit FreeBSD/mips. The in-tree GCC 4.2.1 defaults to a MIPS ISA of MIPS3 (which includes ll and sc instructions needed for SMP-aware atomics). However, out of the box GCC defaults to MIPS1 for 32-bit MIPS (N32 and N64 both require a minimum of MIPS3). Change both devel/mips-gcc and base/gcc to default to MIPS3 for 32-bit MIPS on FreeBSD. - Fix the default target cpu to include MASK_ABICALLS in configure.tgt. The gcc/config/mips/freebsd.h header already overrides this anway, but it is more correct to fix this here. We could perhaps remove the hack from freebsd.h now but I haven't done that. - Fix the case that checks for 32-bit mips tuples to match on 'mips*' instead of 'mips32*' in configure.tgt. We don't use mips32* in our tuples for O32 MIPS. - Set MIPS_ISA_DEFAULT to 3 (MIPS3) rather than 33 (MIPS32R6 or some such) for O32. - Remove MIPS_ISA_DEFAULT for N32 to use the default of MIPS3. - Remove hackish driver specs and instead replace with more standard driver specs. Add MIPS_DEFAULT_ISA_LEVEL_SPEC to the default driver specs. This macro forces a suitable MIPS ISA parameter (such as -mips3) to always be added to the flags passed to subcommands. In particular, without this change the compiler would assume MIPS3 by default via MIPS_ISA_DEFAULT but would not pass any flags on to as(1) and as would still use MIPS1. The added macro ensures -mips3 is passed to as(1) if no explicit -march is specified. The upshot of all this is that one no longer has to explicitly specify TARGET_CPUTYPE=mips3 to build O32 MIPS. It should also make /usr/bin/cc from base/gcc more compatible with GCC 4.2.1. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D15543 Modified: head/devel/powerpc64-gcc/files/patch-gcc-freebsd-mips Modified: head/devel/powerpc64-gcc/files/patch-gcc-freebsd-mips ============================================================================== --- head/devel/powerpc64-gcc/files/patch-gcc-freebsd-mips Fri Jun 8 15:51:31 2018 (r472010) +++ head/devel/powerpc64-gcc/files/patch-gcc-freebsd-mips Fri Jun 8 16:05:07 2018 (r472011) @@ -8,17 +8,17 @@ index 90d4f71..5a05e22 100644 ;; +mips*-*-freebsd*) # FreeBSD/mips[64], either endian. + tm_file="${tm_file} elfos.h ${fbsd_tm_file} mips/elf.h mips/freebsd.h" -+ target_cpu_default=MASK_SOFT_FLOAT_ABI ++ target_cpu_default="MASK_ABICALLS|MASK_SOFT_FLOAT_ABI" + case ${target} in + mips64*-*-freebsd*) + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64" + ;; -+ mips32*-*-freebsd*) -+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32 MIPS_ISA_DEFAULT=33" -+ ;; + mipsn32*-*-freebsd*) -+ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32 MIPS_ISA_DEFAULT=33" ++ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32" + ;; ++ mips*-*-freebsd*) ++ tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32 MIPS_ISA_DEFAULT=3" ++ ;; + esac + case ${target} in + mips*el-*-freebsd*) @@ -64,7 +64,7 @@ new file mode 100644 index 0000000..56a921e --- /dev/null +++ gcc/config/mips/freebsd.h -@@ -0,0 +1,347 @@ +@@ -0,0 +1,320 @@ +/* Definitions for MIPS varients running FreeBSD with ELF format + Copyright (C) 2008 Free Software Foundation, Inc. + Continued by David O'Brien @@ -310,39 +310,12 @@ index 0000000..56a921e + } \ + while (0) + -+/* Default ABI and ISA */ -+/* -+ * XXX/juli -+ * Shouldn't this also be dependent on !mips*? -+ */ -+#ifdef MIPS_CPU_STRING_DEFAULT -+#define DRIVER_SELF_ISA_SPEC "%{!march=*: -march=" MIPS_CPU_STRING_DEFAULT "}" -+#else -+#define DRIVER_SELF_ISA_SPEC "%{!march=*: -march=from-abi}" -+#endif -+ ++/* Always pass ISA to drivers */ +#undef DRIVER_SELF_SPECS -+#if MIPS_ABI_DEFAULT == ABI_N32 -+#define DRIVER_SELF_SPECS \ -+ "%{!EB:%{!EL:%(endian_spec)}}", \ -+ "%{!mabi=*: -mabi=n32}", \ -+ DRIVER_SELF_ISA_SPEC -+#elif MIPS_ABI_DEFAULT == ABI_64 -+#define DRIVER_SELF_SPECS \ -+ "%{!EB:%{!EL:%(endian_spec)}}", \ -+ "%{!mabi=*: -mabi=64}", \ -+ DRIVER_SELF_ISA_SPEC -+#elif MIPS_ABI_DEFAULT == ABI_O64 -+#define DRIVER_SELF_SPECS \ -+ "%{!EB:%{!EL:%(endian_spec)}}", \ -+ "%{!mabi=*: -mabi=o64}", \ -+ DRIVER_SELF_ISA_SPEC -+#else /* default to o32 */ -+#define DRIVER_SELF_SPECS \ -+ "%{!EB:%{!EL:%(endian_spec)}}", \ -+ "%{!mabi=*: -mabi=32}", \ -+ DRIVER_SELF_ISA_SPEC -+#endif ++#define DRIVER_SELF_SPECS \ ++ MIPS_DEFAULT_ISA_LEVEL_SPEC, \ ++ MIPS_ISA_LEVEL_SPEC, \ ++ BASE_DRIVER_SELF_SPECS + +#if 0 +/* Don't default to pcc-struct-return, we want to retain compatibility with