From owner-svn-src-head@freebsd.org Fri Apr 7 20:11:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 375E9D3352D; Fri, 7 Apr 2017 20:11:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F77C866; Fri, 7 Apr 2017 20:11:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id C2B1210A7DB; Fri, 7 Apr 2017 16:11:29 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316622 - head/share/mk Date: Fri, 07 Apr 2017 13:10:13 -0700 Message-ID: <3876116.W5eNvcJ1Jh@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201704072002.v37K21Ux032932@repo.freebsd.org> References: <201704072002.v37K21Ux032932@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 07 Apr 2017 16:11:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Apr 2017 20:11:31 -0000 On Friday, April 07, 2017 08:02:01 PM John Baldwin wrote: > Author: jhb > Date: Fri Apr 7 20:02:01 2017 > New Revision: 316622 > URL: https://svnweb.freebsd.org/changeset/base/316622 > > Log: > Explicitly set the desired MIPS ABI in toolchain flags. > > Specifically, set '-mabi=XX' in AFLAGS, CFLAGS, and LDFLAGS. This permits > building MIPS worlds and binaries with a toolchain whose default output > does not match the desired TARGET_ARCH. > > _LDFLAGS (which is used with LD instead of with CC) required an update as > LD does not accept the -mabi flags (so they must be stripped from LDFLAGS > when generating _LDFLAGS). For bare uses of LD (rather than linking via > CC), the desired ABI must be set by setting an explicit linker emulation > as done in r316514 for kernels and kernel modules. With this (and other recent commits), I can build (and run) mips and mips64 world + kernels under QEMU with external GCC from ports via the mips-xtoolchain-gcc package. (mipsn32 also builds, but it fails to boot in the same failure case for both old and new GCC) Building mips: make CROSS_TOOLCHAIN=mips-gcc TARGET_CPUTYPE=mips3 TARGET_ARCH=mips buildworld For mips64 and mipsn32 TARGET_CPUTYPE is not required and only TARGET_ARCH has to be changed. (Previously mips-gcc has worked for 32-bit mips as that was the default target for mips-gcc. There is a mips64-xtoolchain-gcc that targets mips64 by default that previously worked for mips64. However, you can now use either of these toolchains to build any mips variant. Previously mips64-gcc could only build mips64, and mips-gcc could only build o32 mips. Neither package was able to build n32. We could perhaps drop the mips64-gcc package at some point in the future.) -- John Baldwin