beignet-1.3.2-reproducibility.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Description: Make .h timestamps in .pch file reproducible
  2. Full reproducibility also requires a fixed build path
  3. and the LLVM/Clang patch in the referenced bug.
  4. Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
  5. Bug-Debian: https://bugs.debian.org/877359
  6. Forwarded: https://lists.freedesktop.org/archives/beignet/2019-January/009223.html
  7. --- a/backend/src/libocl/CMakeLists.txt
  8. +++ b/backend/src/libocl/CMakeLists.txt
  9. @@ -229,6 +229,8 @@ ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_D
  10. ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_DIR}/beignet.local.pch
  11. COMMAND mkdir -p ${OCL_OBJECT_DIR}
  12. + # the tests are this way round to return success whether or not SOURCE_DATE_EPOCH is set
  13. + COMMAND test -z $ENV{SOURCE_DATE_EPOCH} || touch -d '@$ENV{SOURCE_DATE_EPOCH}' ${OCL_OBJECT_DIR}/include/*.h
  14. COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS} -I ${OCL_OBJECT_DIR}/include/ -emit-pch -x cl ${OCL_OBJECT_DIR}/include/ocl.h -o ${OCL_OBJECT_DIR}/beignet.local.pch
  15. DEPENDS ${OCL_HEADER_FILES}
  16. COMMENT "Generate the pch file: ${OCL_OBJECT_DIR}/beignet.local.pch"
  17. @@ -236,6 +238,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_D
  18. ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_DIR}/beignet.pch
  19. COMMAND mkdir -p ${OCL_OBJECT_DIR}
  20. + COMMAND test -z $ENV{SOURCE_DATE_EPOCH} || touch -d '@$ENV{SOURCE_DATE_EPOCH}' ${OCL_OBJECT_DIR}/include/*.h
  21. COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS} -I ${OCL_OBJECT_DIR}/include/ --relocatable-pch -emit-pch -isysroot ${LIBOCL_BINARY_DIR} -x cl ${OCL_OBJECT_DIR}/include/ocl.h -o ${OCL_OBJECT_DIR}/beignet.pch
  22. DEPENDS ${OCL_HEADER_FILES}
  23. COMMENT "Generate the pch file: ${OCL_OBJECT_DIR}/beignet.pch"
  24. @@ -273,6 +276,7 @@ if (ENABLE_OPENCL_20)
  25. ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_DIR}/beignet_20.local.pch
  26. COMMAND mkdir -p ${OCL_OBJECT_DIR}
  27. + COMMAND test -z $ENV{SOURCE_DATE_EPOCH} || touch -d '@$ENV{SOURCE_DATE_EPOCH}' ${OCL_OBJECT_DIR}/include/*.h
  28. COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS_20} -I ${OCL_OBJECT_DIR}/include/ -emit-pch -x cl ${OCL_OBJECT_DIR}/include/ocl.h -o ${OCL_OBJECT_DIR}/beignet_20.local.pch
  29. DEPENDS ${OCL_HEADER_FILES}
  30. COMMENT "Generate the pch file: ${OCL_OBJECT_DIR}/beignet_20.local.pch"
  31. @@ -280,6 +284,7 @@ if (ENABLE_OPENCL_20)
  32. ADD_CUSTOM_COMMAND(OUTPUT ${OCL_OBJECT_DIR}/beignet_20.pch
  33. COMMAND mkdir -p ${OCL_OBJECT_DIR}
  34. + COMMAND test -z $ENV{SOURCE_DATE_EPOCH} || touch -d '@$ENV{SOURCE_DATE_EPOCH}' ${OCL_OBJECT_DIR}/include/*.h
  35. COMMAND ${CLANG_EXECUTABLE} -cc1 ${CLANG_OCL_FLAGS_20} -I ${OCL_OBJECT_DIR}/include/ --relocatable-pch -emit-pch -isysroot ${LIBOCL_BINARY_DIR} -x cl ${OCL_OBJECT_DIR}/include/ocl.h -o ${OCL_OBJECT_DIR}/beignet_20.pch
  36. DEPENDS ${OCL_HEADER_FILES}
  37. COMMENT "Generate the pch file: ${OCL_OBJECT_DIR}/beignet_20.pch"