Clang and -frandom-seed

Dimitry Andric dim at FreeBSD.org
Mon Nov 22 14:24:07 UTC 2010


On 2010-11-22 15:05, Erik Cederstrand wrote:
> .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?

Well, src.conf is only picked up if you .include <bsd.own.mk>, or
another bsd.*.mk file that includes bsd.own.mk in turn.

So normally, you would have a Makefile in e.g. usr.bin/clang/clang,
which includes bsd.own.mk, and then includes clang.build.mk.  Only in
that case the variables from src.conf are available.

In contrast, make.conf is read from sys.mk, so its contents are always
available.  Same if you put variables on the command line; those even
override *any* assignment in the Makefiles themselves...


More information about the freebsd-toolchain mailing list