Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Nov 2010 16:25:10 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Erik Cederstrand <erik@cederstrand.dk>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: Clang and -frandom-seed
Message-ID:  <4CE939D6.7090307@FreeBSD.org>
In-Reply-To: <68B6258D-6853-4FF0-BE09-13B8E99BC874@cederstrand.dk>
References:  <E135940E-F79C-4DFA-811D-18CCBF3C609E@cederstrand.dk>	<4CE06C4F.7000002@FreeBSD.org>	<FD61324A-1A22-4731-A563-B0BE8AB93069@cederstrand.dk> <68B6258D-6853-4FF0-BE09-13B8E99BC874@cederstrand.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CE939D6.7090307>