about summary refs log tree commit diff homepage
path: root/scripts/build/patches/llvm38.patch
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2019-08-31 10:25:37 +0200
committerMartinNowack <martin.nowack@gmail.com>2019-09-05 14:00:30 +0100
commit649c8bce588f04ed9099686f0d9ed9c326567c44 (patch)
tree4649e7e812e2c482fc3348d6e8fca4362db9613e /scripts/build/patches/llvm38.patch
parent368409073b0e4037a879bcc3f30265aa93a2b367 (diff)
downloadklee-649c8bce588f04ed9099686f0d9ed9c326567c44.tar.gz
build: additional patches for LLVM 3.8-5.0
Diffstat (limited to 'scripts/build/patches/llvm38.patch')
-rw-r--r--scripts/build/patches/llvm38.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/scripts/build/patches/llvm38.patch b/scripts/build/patches/llvm38.patch
new file mode 100644
index 00000000..e6afcce9
--- /dev/null
+++ b/scripts/build/patches/llvm38.patch
@@ -0,0 +1,55 @@
+--- include/llvm/IR/ValueMap.h
++++ include/llvm/IR/ValueMap.h
+@@ -99,7 +99,7 @@ public:
+   explicit ValueMap(const ExtraData &Data, unsigned NumInitBuckets = 64)
+       : Map(NumInitBuckets), Data(Data) {}
+ 
+-  bool hasMD() const { return MDMap; }
++  bool hasMD() const { return static_cast<bool>(MDMap); }
+   MDMapT &MD() {
+     if (!MDMap)
+       MDMap.reset(new MDMapT);
+
+
+Backport from https://reviews.llvm.org/rC330696 to include the detection of GCC
+versions without second and third component in path, such as
+"/usr/lib/gcc/x86_64-redhat-linux/8/". Support for single digit versions was
+introduced with https://reviews.llvm.org/D14727
+--- tools/clang/lib/Driver/ToolChains.cpp
++++ tools/clang/lib/Driver/ToolChains.cpp
+@@ -1241,20 +1241,31 @@ Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) {
+   if (First.first.getAsInteger(10, GoodVersion.Major) || GoodVersion.Major < 0)
+     return BadVersion;
+   GoodVersion.MajorStr = First.first.str();
+-  if (Second.first.getAsInteger(10, GoodVersion.Minor) || GoodVersion.Minor < 0)
++  if (First.second.empty())
++    return GoodVersion;
++  StringRef MinorStr = Second.first;
++  if (Second.second.empty()) {
++    if (size_t EndNumber = MinorStr.find_first_not_of("0123456789")) {
++      GoodVersion.PatchSuffix = MinorStr.substr(EndNumber);
++      MinorStr = MinorStr.slice(0, EndNumber);
++    }
++  }
++  if (MinorStr.getAsInteger(10, GoodVersion.Minor) || GoodVersion.Minor < 0)
+     return BadVersion;
+-  GoodVersion.MinorStr = Second.first.str();
++  GoodVersion.MinorStr = MinorStr.str();
+ 
+   // First look for a number prefix and parse that if present. Otherwise just
+   // stash the entire patch string in the suffix, and leave the number
+   // unspecified. This covers versions strings such as:
++  //   5        (handled above)
+   //   4.4
++  //   4.4-patched
+   //   4.4.0
+   //   4.4.x
+   //   4.4.2-rc4
+   //   4.4.x-patched
+   // And retains any patch number it finds.
+-  StringRef PatchText = GoodVersion.PatchSuffix = Second.second.str();
++  StringRef PatchText = Second.second.str();
+   if (!PatchText.empty()) {
+     if (size_t EndNumber = PatchText.find_first_not_of("0123456789")) {
+       // Try to parse the number and any suffix.
+