From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 8 22:07:51 2013 Return-Path: Delivered-To: freebsd-hackers@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 21D9DD08 for ; Mon, 8 Apr 2013 22:07:51 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-ea0-x234.google.com (mail-ea0-x234.google.com [IPv6:2a00:1450:4013:c01::234]) by mx1.freebsd.org (Postfix) with ESMTP id AFC3BEFE for ; Mon, 8 Apr 2013 22:07:50 +0000 (UTC) Received: by mail-ea0-f180.google.com with SMTP id d10so2375850eaj.25 for ; Mon, 08 Apr 2013 15:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=u8f7sSeVGxYs2KSuXm2DjYcCnUuN6Fn08qhv3rG4SYI=; b=oq3muQTnZ1g5uONEuHGGmaVNXbhxu7K4wtHSiJHrOgmekOM5DNko+fOjbHbsAlteAn tH8abDN5FjA1uLSy3uIIJz3CUcnzTcmdIOUH1Bbxy2K0BOOPK0gJNMt5J683CrGXFHca t55c7EfVdHLkE+udJ/fSbzNHew71ve3bGBfC1O2ZInB8WkqjpRjGBvhm1RSmbYlhL7f6 wYMYTpSWEBHHTinFGEtzezaoDtVU/BVf9FHaUrIg23biDR/IuqRLU7cicTAfIDAMqOOM uUxLROoi9HBxzjRs/y3f/HxZFJ4RrbLQ1tDssh63P3ZkVsFZbOx4zcoKRHUxOQEI/Uj+ MRAQ== X-Received: by 10.15.98.141 with SMTP id bj13mr24193895eeb.29.1365458869670; Mon, 08 Apr 2013 15:07:49 -0700 (PDT) Received: from [192.168.1.80] (1F2E5BE5.dsl.pool.telekom.hu. [31.46.91.229]) by mx.google.com with ESMTPS id a41sm281032eei.4.2013.04.08.15.07.47 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 15:07:48 -0700 (PDT) Message-ID: <51634D82.9060901@gmail.com> Date: Tue, 09 Apr 2013 01:06:42 +0200 From: deeptech71 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:18.0) Gecko/20100101 SeaMonkey/2.15 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: Re: building world and kernel without ebuilding ("bootstrap"?) clang? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 08 Apr 2013 22:15:16 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2013 22:07:51 -0000 Lev Serebryakov wrote: > Is it possible to build NanoBSD faster? Use system compiler, and don't build bootstrap compiler at all? There are some issues when building "updated" sources [1]. There was a thread about adding support for an "external" compiler [2], but that yielded a non-working solution [3]. 1. Add the following or similar to /etc/make.conf: CC=/full/path/to/clang CPP=/full/path/to/clang-cpp CXX=/full/path/to/clang++ Note: make sure clang-cpp or similar exists. 2. Add the following to /etc/src.conf: WITHOUT_GCC=1 WITHOUT_CLANG=1 Note: ``make delete-old'' will prompt you to remove the compilers. 3. In case of an "external", modern version of Clang, remove its header files that are already present in the system at /usr/include (eg., stdio.h). 4. Selectively apply to the source tree (all are required for my purposes): Index: usr.bin/xlint/llib/Makefile =================================================================== --- usr.bin/xlint/llib/Makefile (revision 249254) +++ usr.bin/xlint/llib/Makefile (working copy) @@ -9,9 +9,9 @@ CLEANFILES+= ${LIBS} llib-lposix.ln: llib-lposix - ${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC} + CC=${CC:Q} ${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC} llib-lstdc.ln: llib-lstdc - ${LINT} ${LINTFLAGS} -Cstdc ${.ALLSRC} + CC=${CC:Q} ${LINT} ${LINTFLAGS} -Cstdc ${.ALLSRC} .include Index: Makefile.inc1 =================================================================== --- Makefile.inc1 (revision 249254) +++ Makefile.inc1 (working copy) @@ -680,7 +680,7 @@ ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep id install ${_install-info} \ ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \ - rm sed sh sysctl test true uname wc ${_zoneinfo} + rm sed sh sysctl test true uname wc ${_zoneinfo} cp btxld dd ls # # distributeworld Index: sys/conf/kern.mk =================================================================== --- sys/conf/kern.mk (revision 249254) +++ sys/conf/kern.mk (working copy) @@ -5,7 +5,7 @@ # CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \ - -Wundef -Wno-pointer-sign -fformat-extensions \ + -Wundef -Wno-pointer-sign -Wno-format \ -Wmissing-include-dirs -fdiagnostics-show-option \ ${CWARNEXTRA} # 5. If need be, use the following fake script as Clang (required for my purposes): #!/bin/sh /path/to/real/clang --sysroot=/usr/obj/tmp "$@" || /path/to/real/clang "$@" 6. If there are still build errors, yell that FreeBSD sux. And let these seemingly-retarded instructions be a warning to all active developers. (What a nice day for a flame war!) [1] http://lists.freebsd.org/pipermail/freebsd-current/2013-February/040160.html [2] http://lists.freebsd.org/pipermail/freebsd-arch/2013-February/014055.html [3] http://people.freebsd.org/~brooks/patches/xcc3.diff