From owner-freebsd-mips@FreeBSD.ORG Mon Sep 2 02:01:37 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6B854972; Mon, 2 Sep 2013 02:01:37 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1083126BD; Mon, 2 Sep 2013 02:01:36 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r8221TEU092442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 1 Sep 2013 19:01:29 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r8221TxA092441; Sun, 1 Sep 2013 19:01:29 -0700 (PDT) (envelope-from jmg) Date: Sun, 1 Sep 2013 19:01:29 -0700 From: John-Mark Gurney To: Adrian Chadd Subject: Re: how do i cross build world/kernel with clang? Message-ID: <20130902020129.GD36239@funkthat.com> Mail-Followup-To: Adrian Chadd , freebsd-current , "freebsd-mips@freebsd.org" References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Sun, 01 Sep 2013 19:01:29 -0700 (PDT) Cc: freebsd-current , "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Sep 2013 02:01:37 -0000 Adrian Chadd wrote this message on Sat, Aug 31, 2013 at 19:30 -0700: > How do i cross-build a mips world/kernel with clang? > > ie, how do I tell the build system to build a mips targetted clang instead > of gcc and use that to build everything? I finally figured out why my advice didn't work for you the other day.. It's because if you specify WITH_CLANG_IS_CC=YES, it doesn't imply WITH_CLANG=YES... and clang is turned off by default for mips... # make TARGET_ARCH=mips -j 8 WITH_CLANG_IS_CC=YES WITH_CLANG=YES toolchain [...] # make buildenv TARGET_ARCH=mips WITH_CLANG_IS_CC=YES Entering world for mips:mips # cc --version FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 Target: mips-unknown-freebsd10.0 Thread model: posix The WITH_CLANG_IS_CC=YES is probably unnecessary on the buildenv command... Though the toolchain build failed, as apparently there are issues w/ clang, mips and libc: --- libc.so.7 --- /usr/obj/mips.mips/usr/src/tmp/usr/bin/ld: /usr/obj/mips.mips/usr/src/tmp/usr/li b/crtbeginS.o: warning: linking PIC files with non-PIC files /usr/obj/mips.mips/usr/src/tmp/usr/bin/ld: /usr/obj/mips.mips/usr/src/tmp/usr/li b/crtn.o: warning: linking PIC files with non-PIC files exect.So: In function `exect': (.text+0x18): relocation truncated to fit: R_MIPS_PC16 against `__cerror' [...] -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."