Try to integrate a pach to make pch reproducible Thanks to Rebecca Palmer for the patch (Closes: #877359)

This commit is contained in:
Sylvestre Ledru 2018-11-10 14:35:06 +01:00
parent 7e5c11fd6b
commit 7a048d4ca0
3 changed files with 44 additions and 0 deletions

3
debian/changelog vendored
View File

@ -1,6 +1,9 @@
llvm-toolchain-7 (1:7.0.1~+rc2-3) unstable; urgency=medium
* Disable gold for sparc* (Closes: #913260)
* Try to integrate a pach to make pch reproducible
Thanks to Rebecca Palmer for the patch
(Closes: #877359)
-- Sylvestre Ledru <sylvestre@debian.org> Thu, 08 Nov 2018 20:50:39 +0100

40
debian/patches/reproducible-pch.diff vendored Normal file
View File

@ -0,0 +1,40 @@
Description: Make ordering of OPENCL_EXTENSION_TYPES reproducible
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Bug-Debian: https://bugs.debian.org/877359
Forwarded: no
Index: llvm-toolchain-7-7/clang/lib/Serialization/ASTWriter.cpp
===================================================================
--- llvm-toolchain-7-7.orig/clang/lib/Serialization/ASTWriter.cpp
+++ llvm-toolchain-7-7/clang/lib/Serialization/ASTWriter.cpp
@@ -4293,9 +4293,13 @@ void ASTWriter::WriteOpenCLExtensionType
return;
RecordData Record;
+ // Sort to allow reproducible .pch files - https://bugs.debian.org/877359
+ std::map<TypeID, std::set<std::string>> sortedOpenCLTypeExtMap;
for (const auto &I : SemaRef.OpenCLTypeExtMap) {
- Record.push_back(
- static_cast<unsigned>(getTypeID(I.first->getCanonicalTypeInternal())));
+ sortedOpenCLTypeExtMap[getTypeID(I.first->getCanonicalTypeInternal())]=I.second;
+ }
+ for (const auto &I : sortedOpenCLTypeExtMap) {
+ Record.push_back(static_cast<unsigned>(I.first));
Record.push_back(I.second.size());
for (auto Ext : I.second)
AddString(Ext, Record);
@@ -4308,8 +4312,12 @@ void ASTWriter::WriteOpenCLExtensionDecl
return;
RecordData Record;
+ std::map<DeclID, std::set<std::string>> sortedOpenCLDeclExtMap;
for (const auto &I : SemaRef.OpenCLDeclExtMap) {
- Record.push_back(getDeclID(I.first));
+ sortedOpenCLDeclExtMap[getDeclID(I.first)]=I.second;
+ }
+ for (const auto &I : sortedOpenCLDeclExtMap) {
+ Record.push_back(I.first);
Record.push_back(static_cast<unsigned>(I.second.size()));
for (auto Ext : I.second)
AddString(Ext, Record);

View File

@ -87,3 +87,4 @@ symbolizer-path.diff
remove-apple-clang-manpage.diff
mips-rdhwr.diff
clang-arm-default-vfp3-on-armv7a.patch
reproducible-pch.diff