Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Nov 2010 15:05:24 +0100
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: Clang and -frandom-seed
Message-ID:  <1F5D7910-3AC6-4ACA-A7C5-EC28B9EABF52@cederstrand.dk>
In-Reply-To: <4CE93959.7070600@FreeBSD.org>
References:  <E135940E-F79C-4DFA-811D-18CCBF3C609E@cederstrand.dk> <4CE06C4F.7000002@FreeBSD.org> <FD61324A-1A22-4731-A563-B0BE8AB93069@cederstrand.dk> <4CE93959.7070600@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Den 21/11/2010 kl. 16.23 skrev Dimitry Andric:

> On 2010-11-15 11:10, Erik Cederstrand wrote:
> 
>> Where in the build scripts would I need to add this flag? Something like:
>> 
>> CXXFLAGS += -frandom-seed=${.TARGET}
> 
> Rather use:
> 
> CXXFLAGS+=-frandom-seed=${.IMPSRC:S/^${.CURDIR}\///}
> 
> which is rather contorted, but I see no other way to generate a relative
> path. :)
> 
> Also, this generates an empty '-frandom-seed=' option for every command
> that uses CXXFLAGS but isn't a compilation at all, such as most linking
> commands.  It is probably not harmful, though.

I added

.ifdef WITH_DETERMINISTIC
CXXFLAGS+=-frandom-seed=\"${.IMPSRC:S/^${.CURDIR}\///}\"
.endif

to lib/clang/clang.build.mk

and "WITH_DETERMINISTIC=true" to src.conf, but apparently the flag isn't being propagated to clang.build.mk. However it is being picked up if I pass it on the command-line:

make WITH_DETERMINISTIC=true buildworld

Why isn't the flag available in clang.build.mk?

Erik

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1F5D7910-3AC6-4ACA-A7C5-EC28B9EABF52>