Bug#877359: clang: precompiled headers are not reproducible

Rebecca N. Palmer rebecca_palmer at zoho.com
Sat Sep 30 21:52:30 UTC 2017


Package: clang-4.0
Version: 1:4.0.1-5
Severity: wishlist
User: reproducible-builds at lists.alioth.debian.org
Usertags: toolchain randomness
Control: affects -1 beignet-opencl-icd liboclgrind-16.10
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Generating a .pch precompiled header with clang gives a different result 
each time, even when run with faketime (i.e. probably not a timestamp) 
and separately from the rest of the build process (i.e. probably not a 
filesystem ordering issue).

Possibly a pseudorandom ordering of something within the file?? e.g. the 
method pool hash table http://clang.llvm.org/docs/PCHInternals.html

There are ~12 packages that ship .pch files, but I suspect that only 2 
(beignet and oclgrind) actually build and use them in Debian; the rest 
look like either iOS/MacOS-only files (mostly documentation examples), 
or files that are called .pch but contain something entirely different.

$ faketime "2017-10-01 12:00:00" /usr/bin/clang-4.0 -cc1 -fno-builtin 
-ffp-contract=off -triple spir64 -cl-kernel-arg-info -fblocks 
-DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND -cl-std=CL2.0 
-D__OPENCL_C_VERSION__=200 -I 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl//usr/local/lib/beignet//include/ 
--relocatable-pch -emit-pch -isysroot 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl 
-x cl 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl//usr/local/lib/beignet//include/ocl.h 
-o 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl//usr/local/lib/beignet//beignet_20.pch
E: cowdancer: cannot fstat ilistfile /.ilist
Can't read /proc/cpuinfo: Cannot allocate memory
$ md5sum usr/local/lib/beignet/*.pch
d55df577aa72cefc69c5b39df3491841  usr/local/lib/beignet/beignet_20.pch
$ faketime "2017-10-01 12:00:00" /usr/bin/clang-4.0 -cc1 -fno-builtin 
-ffp-contract=off -triple spir64 -cl-kernel-arg-info -fblocks 
-DGEN7_SAMPLER_CLAMP_BORDER_WORKAROUND -cl-std=CL2.0 
-D__OPENCL_C_VERSION__=200 -I 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl//usr/local/lib/beignet//include/ 
--relocatable-pch -emit-pch -isysroot 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl 
-x cl 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl//usr/local/lib/beignet//include/ocl.h 
-o 
/home/rnpalmer/Debian/builds/stackbuild/beignet/build2/backend/src/libocl//usr/local/lib/beignet//beignet_20.pch
E: cowdancer: cannot fstat ilistfile /.ilist
Can't read /proc/cpuinfo: Cannot allocate memory
$ md5sum usr/local/lib/beignet/*.pch
e61f28727c32337a63bddced613fcf78  usr/local/lib/beignet/beignet_20.pch



More information about the Pkg-llvm-team mailing list