From owner-freebsd-current@FreeBSD.ORG Fri May 17 21:35:30 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE523E96; Fri, 17 May 2013 21:35:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 783CAA08; Fri, 17 May 2013 21:35:30 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::f50f:aff0:929b:1a2e] (unknown [IPv6:2001:7b8:3a7:0:f50f:aff0:929b:1a2e]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 76F5C5C44; Fri, 17 May 2013 23:35:26 +0200 (CEST) Subject: Re: WITHOUT_CLANG + WITHOUT_GCC vs XCC + WITHOUT_CROSS_COMPILER Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=us-ascii From: Dimitry Andric X-Priority: 3 (Normal) In-Reply-To: <1713488536.20130518004618@serebryakov.spb.ru> Date: Fri, 17 May 2013 23:35:25 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <1713488536.20130518004618@serebryakov.spb.ru> To: lev@FreeBSD.org X-Mailer: Apple Mail (2.1503) Cc: freebsd-current@freebsd.org, Brooks Davis X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 May 2013 21:35:30 -0000 On May 17, 2013, at 22:46, Lev Serebryakov wrote: > I've explored new options to build world and kernel with external > compiler. My goal is not to use "modern" compiler or "true" > cross-compilation, but fast building of system, which (almost) > identical to host system and doesn't need compiler (NanoBSD image for > router). > > What I found, that if WITHOUT_LCNAG and WITHOUT_GCC are both set, and > WITHOUT_CROSS_COMPILER and XCC/XCXX/XCPP are NOT set, world and > kernel is build with "system" compiler, but without "cross" options > (like -isystem and --sysroot). So, it works only by accident, and not > in way, that user (developer) could expect. For some historic reason, the cross-tools compiler is always built with its default "sysroot" path set to ${WORLDTMP}. I used quotes, because it is not only about finding headers and libraries, but also to find other toolchain binaries (cc1, as, ld and so on) under ${WORLDTMP}. I suspect this was all done before gcc and the other toolchain components grew proper sysroot support. Indeed, it would probably be better to revert that, and compile all stages after cross-tools with --sysroot=${WORLDTMP} (and probably -B${WORLDTMP}/usr/bin). It might not be trivial to get this properly working for all edge cases, though. > What I expected, that in such case cross-clang will be built at > "stage 3: cross tools" and used to build world, but no clang (And > support libraries) or gcc will be built at "stage 4.4: building > everything". Currently, if you set WITHOUT_CLANG, it will not build clang, not in any stage. Similar for WITHOUT_GCC. > Do we need such mode? Well, if you are not interested in having any compilers (or toolchain components) in your final world, they should not be built, right? > Is current behavior (risky on, IMHO) Ok? No, obviously not. If you build world with "old" system headers (for example when building head on stable/9), there will be trouble. > I think, ideal situation is when WITHOUT_CLANG + WITHOUT_GCC but no > WITHOUT_CROSS_COMPILER IS supported "as expected" > (compiler-as-cross-tool is built, but compiler-as-part-of-everything > is not), but at least system need to abort "both compilers are > disabled and no cross-tools set" configuration for now, am I right? Yes, a seatbelt would probably be wise for the time being. -Dimitry