From owner-freebsd-toolchain@FreeBSD.ORG Sun Nov 21 15:25:04 2010 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F8C5106566C for ; Sun, 21 Nov 2010 15:25:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id C31808FC0C for ; Sun, 21 Nov 2010 15:25:03 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:b9a3:5f94:4931:f43f] (unknown [IPv6:2001:7b8:3a7:0:b9a3:5f94:4931:f43f]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 0D55E5C5A; Sun, 21 Nov 2010 16:25:03 +0100 (CET) Message-ID: <4CE939D6.7090307@FreeBSD.org> Date: Sun, 21 Nov 2010 16:25:10 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.13pre) Gecko/20101118 Lanikai/3.1.7pre MIME-Version: 1.0 To: Erik Cederstrand References: <4CE06C4F.7000002@FreeBSD.org> <68B6258D-6853-4FF0-BE09-13B8E99BC874@cederstrand.dk> In-Reply-To: <68B6258D-6853-4FF0-BE09-13B8E99BC874@cederstrand.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-toolchain@freebsd.org Subject: Re: Clang and -frandom-seed X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 15:25:04 -0000 On 2010-11-19 16:51, Erik Cederstrand wrote: > Poking around, I decided to add this patch: > > # svn diff lib/clang/clang.build.mk > Index: lib/clang/clang.build.mk > =================================================================== > --- lib/clang/clang.build.mk (revision 215422) > +++ lib/clang/clang.build.mk (working copy) > @@ -28,6 +28,13 @@ > CXXFLAGS+=-fno-rtti > .endif > > +.ifdef WITH_DETERMINISTIC > +CXXFLAGS+=-frandom-seed=0 > +.endif This will probably not work as expected. The -frandom-seed option must be different for each source file. > and added "WITH_DETERMINISTIC=true" to /etc/src.conf. The "random-seed=0" should ensure that the same random elements are generated every time. > > I then ran two buildworlds with the same MAKEOBJDIRPREFIX but two different DESTDIRs, and compared the two clang binaries. The random-seed option does show up un the log, so it's getting picked up, but apparently it was not enough, as the random elements are still different. > > Any hints on where in the build infrastructure I should add the flag, or what to grep for in the buildworld log to find out what's wrong? > > Also, how can I compile just clang? I tried "cd src/usr.bin/clang; make" but it dies violently: > > /usr/home/erik/freebsd/head/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h: At global scope: > /usr/home/erik/freebsd/head/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h:999: error: expected ',' or '...' before '&' token > /usr/home/erik/freebsd/head/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h:1000: error: ISO C++ forbids declaration of 'LangOptions' with no type > /usr/home/erik/freebsd/head/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h:1019: error: expected declaration before '}' token I don't see this error if I repeat your commands, but in any case you must first build in lib/clang, before you can build in usr.bin/clang, e.g.: make -C $SRCDIR/lib/clang && make -C $SRCDIR/usr.bin/clang