From owner-freebsd-arch@freebsd.org Thu Nov 5 06:01:30 2015 Return-Path: Delivered-To: freebsd-arch@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 652EFA26870; Thu, 5 Nov 2015 06:01:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CAA81E60; Thu, 5 Nov 2015 06:01:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by igpw7 with SMTP id w7so4344412igp.0; Wed, 04 Nov 2015 22:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=2mq3uR/+35pedFPtAIXzBadb3ngD0Uge7+sPKCQ1CUQ=; b=TvonYi2Huqj8hEmOcTEbim1o6D2Ou9bbay+U6dgJv5FFuQG7O2xsODRE9W1sg+SBnR 6xL4b/VEmDyjqB+KuIpQ7RpHS10WMHbrcJzKwyT9KajThPihaPIOx+pg4dFZquOdpgU7 i54+TzL8hqDtnccef4CvUL1wgKA+3m534B+YSYPc6N/5wOqM4Uq7WElVq1bkd+5l5nrF WpN9khJkLW6CdHJih/O1PIRhW3aR1JxKMTdI49SA6jBr8YFmRfPWnO0DGmJExIxX9Hov wRIx7ZRXBzZpjxx5Ef4fRtCOt2ZagDDIh06h7jb7edd6t1SBkLCBwa+S0xkV21WFVtd4 gWMg== MIME-Version: 1.0 X-Received: by 10.50.155.41 with SMTP id vt9mr1025610igb.22.1446703289619; Wed, 04 Nov 2015 22:01:29 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.36.217.196 with HTTP; Wed, 4 Nov 2015 22:01:29 -0800 (PST) In-Reply-To: References: Date: Wed, 4 Nov 2015 22:01:29 -0800 X-Google-Sender-Auth: vB7NH5bzVTjU-xbCZEQDg4mtUOI Message-ID: Subject: Fwd: COMPILER_TYPE and installworld From: Adrian Chadd To: "freebsd-arch@freebsd.org" , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2015 06:01:30 -0000 Hi, I started digging into why "make installworld" doesn't work when using the external toolchain support using CROSS_TOOLCHAIN= support. This is one of the big hurdles to just using 100% external toolchain using bapt's CROSS_TOOLCHAIN support. The TL;DR seems to be: * buildworld/buildkernel: CC gets set right; PATH doesn't include /usr/bin:/usr/sbin * installkernel: MACHINE is set, CC is not set (so it's 'cc') and PATH includes /usr/bin:/usr/sbin * installworld: MACHINE is set, CC is not set, PATH doesn't include /usr/bin:/usr/sbin The result is that during installkernel it finds 'cc' in /usr/bin and detects it as clang, even though I'm doing a mips-gcc build. During installworld it fails because it can't find 'cc'. So! In the short term, is there any way that during installworld/installkernel we can also set CC, etc appropriately? Otherwise we're either using the wrong compiler logic/version (installkernel) or we're just plain not going to work (installworld.) Also - why is PATH including /usr/bin:/usr/sbin when doing installkernel, but not installworld? To reproduce: * pkg install mips-gcc mips-xtoolchain-gcc mips-binutils * env MAKEOBJDIRPREFIX=/tmp/mips-obj make CROSS_TOOLCHAIN=mips-gcc TARGET=mips TARGET_ARCH=mips TARGET_CPUTYPE=mips32 DESTDIR=/tmp/mips-root -j 4 buildworld buildkernel installworld installkernel KERNCONF=MALTA ... make[4]: "/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/share/mk/bsd.compiler.mk" line 50: warning: "machine: mips, X_COMPILER_TYPE: , CC: cc" make[4]: "/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/share/mk/bsd.compiler.mk" line 96: warning: "Finished; COMPILER_TYPE=clang, COMPILER_VERSION=30700, COMPILER_FEATURES=c++11" .. so in the installkernel setup, the PATH includes /usr/bin which means 'cc' works, and thus it's detecting the compiler as clang even though we're supposed to be using mips-gcc. in the installworld setup, there's no /usr/bin in PATH, so it can't find cc. buildworld is ok: make[6]: "/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/share/mk/bsd.compiler.mk" line 50: warning: "machine: amd64, X_COMPILER_TYPE: , CC: cc" make[6]: "/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/share/mk/bsd.compiler.mk" line 96: warning: "Finished; COMPILER_TYPE=clang, COMPILER_VERSION=30700, COMPILER_FEATURES=c++11" ===> gnu/usr.bin/groff/src/devices/grops (obj) .. for the local stuff, and: make[5]: "/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/share/mk/bsd.compiler.mk" line 50: warning: "machine: mips, X_COMPILER_TYPE: , CC: /usr/local/bin/mips-portbld-freebsd11.0-gcc -isystem /home/adrian/work/freebsd/head-embedded-gcc5/src/../obj/mips_ap//mips.mips/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/tmp/usr/include -L/home/adrian/work/freebsd/head-embedded-gcc5/src/../obj/mips_ap//mips.mips/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/tmp/usr/lib --sysroot=/home/adrian/work/freebsd/head-embedded-gcc5/src/../obj/mips_ap//mips.mips/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/tmp -B/usr/local/mips-freebsd/bin/" make[5]: "/usr/home/adrian/work/freebsd/head-embedded-gcc5/src/share/mk/bsd.compiler.mk" line 96: warning: "Finished; COMPILER_TYPE=gcc, COMPILER_VERSION=50200, COMPILER_FEATURES=c++11" .. for the building mips stuff. So installkernel works only "by magic" because of PATH, and CC is just not being set right for installkernel/installworld. ok, so what now? :) -adrian