[LLVMdev] Non-deterministic builds
John McCall
rjmccall at apple.com
Fri Nov 12 10:44:23 PST 2010
On Nov 12, 2010, at 10:38 AM, John McCall wrote:
>
> On Nov 12, 2010, at 7:10 AM, Sebastian Redl wrote:
>
>> On 12.11.2010 15:26, Erik Cederstrand wrote:
>>> I have noticed that two consecutive builds of clang, clang++ and tblgen don't produce identical binaries (as in md5 sums) on identical source code (I'm on FreeBSD). I ran strings(1) on the two clang binaries, and I get the following:
>>> 251862c251862
>>> < N4llvm3sys11ThreadLocalIKN144_GLOBAL__N__usr_home_erik_freebsd_head_src_lib_clang_libllvmsupport_.._.._.._contrib_llvm_lib_Support_CrashRecoveryContext.cpp_00000000_BFDB511124CrashRecoveryContextImplEEE
>>> ---
>>>> N4llvm3sys11ThreadLocalIKN144_GLOBAL__N__usr_home_erik_freebsd_head_src_lib_clang_libllvmsupport_.._.._.._contrib_llvm_lib_Support_CrashRecoveryContext.cpp_00000000_A7307A7424CrashRecoveryContextImplEEE
>>>
>> Urgh, are we using random elements in the unnamed namespace symbol
>> generation?
>
>
> This is definitely not the direct output of clang. We mangle anonymous namespaces the same way that GCC does, i.e. 12_GLOBAL__N_1. If there's a compiler that mangles filenames into anonymous namespace names — or anything later in the toolchain which does it — I'm not aware of it.
Woah, this -frandom-seed business is new to me, nevermind.
John.
More information about the llvm-dev
mailing list