From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 10 15:56:49 2013 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B0E193A5; Wed, 10 Apr 2013 15:56:49 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.friendlyhosting.spb.ru (onlyone.friendlyhosting.spb.ru [IPv6:2a01:4f8:131:60a2::2]) by mx1.freebsd.org (Postfix) with ESMTP id 430537E3; Wed, 10 Apr 2013 15:56:49 +0000 (UTC) Received: from lion.home.serebryakov.spb.ru (unknown [IPv6:2001:470:923f:1:900d:c887:884e:713b]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.friendlyhosting.spb.ru (Postfix) with ESMTPA id 7E9884AC57; Wed, 10 Apr 2013 19:56:47 +0400 (MSK) Date: Wed, 10 Apr 2013 19:56:43 +0400 From: Lev Serebryakov Organization: FreeBSD Project X-Priority: 3 (Normal) Message-ID: <814732856.20130410195643@serebryakov.spb.ru> To: Brooks Davis Subject: Re: building world and kernel without ebuilding ("bootstrap"?) clang? In-Reply-To: <20130410145004.GA66560@lor.one-eyed-alien.net> References: <5164815A.6040908@gmail.com> <1952710103.20130410180935@serebryakov.spb.ru> <20130410145004.GA66560@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: deeptech71 , freebsd-hackers@FreeBSD.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Apr 2013 15:56:49 -0000 Hello, Brooks. You wrote 10 =D0=B0=D0=BF=D1=80=D0=B5=D0=BB=D1=8F 2013 =D0=B3., 18:50:04: BD> The key is to pass the --sysroot option to the compiler. I've got a not BD> quite finished (mostly due to a complete lack of documentation) set of BD> patches to Makefile.inc1 to do this: BD> http://people.freebsd.org/~brooks/patches/xcc3.diff BD> If you set XCC=3D/path/to/clang XCXX=3D/path/to/clang++ XCPP=3Dclang-cp= p then BD> when building world and kernel you will use those compilers and not BD> build a cross compiler. In that mode you will still build and use a BD> cross binutils I've checked this patch right now, it works for me for "buildworld" and "buildkernel" but not for "installworld": mkdir -p /tmp/install.FxqSvHpP progs=3D$(for prog in [ awk cap_mkdb cat chflags chmod chown date echo egr= ep find grep id install ln lockf make mkdir mtree nmtree mv pwd_mkdb rm = sed sh sysctl test true uname wc zic tzsetup; do if progpath=3D`which $pro= g`; then echo $progpath; else echo "Required tool $prog not found in PAT= H." >&2; exit 1; fi; done); libs=3D$(ldd -f "%o %p\n" -f "%o %p\n" $pro= gs 2>/dev/null | sort -u | while read line; do $line; if [ "$2 $3" !=3D = "not found" ]; then echo $2; else echo "Required library $1 not found." = >&2; exit 1; fi; done); cp $libs $progs /tmp/install.FxqSvHpP cp -R ${PATH_LOCALE:-"/usr/share/locale"} /tmp/install.FxqSvHpP/locale cd /data/src; MAKEOBJDIRPREFIX=3D/data/obj.nano/gateway.v2 MACHINE_ARCH=3Da= md64 MACHINE=3Damd64 CPUTYPE=3D PATH=3D/data/obj.nano/gateway.v2/data/src/t= mp/legacy/usr/sbin:/data/obj.nano/gateway.v2/data/src/tmp/legacy/usr/bin:/d= ata/obj.nano/gateway.v2/data/src/tmp/legacy/usr/games:/data/obj.nano/gatewa= y.v2/data/src/tmp/legacy/bin:/data/obj.nano/gateway.v2/data/src/tmp/usr/sbi= n:/data/obj.nano/gateway.v2/data/src/tmp/usr/bin:/data/obj.nano/gateway.v2/= data/src/tmp/usr/games:/tmp/install.FxqSvHpP LD_LIBRARY_PATH=3D/tmp/instal= l.FxqSvHpP PATH_LOCALE=3D/tmp/install.FxqSvHpP/locale /data/obj.nano/gatew= ay.v2/data/src/make.amd64/make -f Makefile.inc1 __MAKE_SHELL=3D/tmp/inst= all.FxqSvHpP/sh reinstall; MAKEOBJDIRPREFIX=3D/data/obj.nano/gateway.v2 MA= CHINE_ARCH=3Damd64 MACHINE=3Damd64 CPUTYPE=3D PATH=3D/data/obj.nano/gateway= .v2/data/src/tmp/legacy/usr/sbin:/data/obj.nano/gateway.v2/data/src/tmp/leg= acy/usr/bin:/data/obj.nano/gateway.v2/data/src/tmp/legacy/usr/games:/data/o= bj.nano/gateway.v2/data/src/tmp/legacy/bin:/data/obj.nano/gateway.v2/data/s= rc/tmp/usr/sbin:/data/obj.nano/gateway.v2/data/src/tmp/usr/bin:/data/obj.na= no/gateway.v2/data/src/tmp/usr/games:/tmp/install.FxqSvHpP LD_LIBRARY_PATH= =3D/tmp/install.FxqSvHpP PATH_LOCALE=3D/tmp/install.FxqSvHpP/locale rm -rf= /tmp/install.FxqSvHpP cc: not found "/data/src/share/mk/bsd.compiler.mk", line 9: warning: "cc --version" retur= ned non-zero status "/data/src/share/mk/bsd.compiler.mk", line 17: Unable to determine compiler= type for cc. Consider setting COMPILER_TYPE. *** [installworld] Error code 1 1 error *** [installworld] Error code 2 1 error (sources is /data/src, OBJDIRPREFIX is /data/obj.nano/gateway.v2) --=20 // Black Lion AKA Lev Serebryakov