Date: Sun, 21 Nov 2010 16:23:05 +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: <4CE93959.7070600@FreeBSD.org> In-Reply-To: <FD61324A-1A22-4731-A563-B0BE8AB93069@cederstrand.dk> References: <E135940E-F79C-4DFA-811D-18CCBF3C609E@cederstrand.dk> <4CE06C4F.7000002@FreeBSD.org> <FD61324A-1A22-4731-A563-B0BE8AB93069@cederstrand.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2010-11-15 11:10, Erik Cederstrand wrote: > I was thinking of something along the same lines. I think we agree > that it only needs to be random across files, not across builds. > Someone on llvm-dev also suggested using the path (either full or > relative to src/) as a seed. The path should relative, to guarantee the same result for every location you can put the source. > 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CE93959.7070600>