Bug 1381043 - Backport llvm r313872 to 3.9 to avoid llvm-dsymutil crashing on bad rust DWARF data. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 12 Oct 2017 17:54:31 +0900
changeset 385957 a3225b6f61933a483d9313667ccacffd96e3f251
parent 385956 1b6a3e8b08935eddd2291d8c1fb83a70dd5e7e47
child 385958 95555b11aaafb46646e8c8b2f8b53ee8532f5e77
push id32672
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 09:00:05 +0000
treeherdermozilla-central@3efcb26e5f37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1381043
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1381043 - Backport llvm r313872 to 3.9 to avoid llvm-dsymutil crashing on bad rust DWARF data. r=froydnj Ideally, we'd backport it to the clang 4 toolchain too, but that results in silently(!) missing crash symbols for libxul.
build/build-clang/clang-3.9-linux64.json
build/build-clang/r313872-for-3.9.patch
--- a/build/build-clang/clang-3.9-linux64.json
+++ b/build/build-clang/clang-3.9-linux64.json
@@ -12,11 +12,12 @@
     "python_path": "/usr/bin/python2.7",
     "gcc_dir": "/builds/worker/workspace/build/src/gcc",
     "cc": "/builds/worker/workspace/build/src/gcc/bin/gcc",
     "cxx": "/builds/worker/workspace/build/src/gcc/bin/g++",
     "as": "/builds/worker/workspace/build/src/gcc/bin/gcc",
     "patches": [
       "llvm-debug-frame.patch",
       "r277806.patch",
-      "r285657.patch"
+      "r285657.patch",
+      "r313872-for-3.9.patch"
     ]
 }
new file mode 100644
--- /dev/null
+++ b/build/build-clang/r313872-for-3.9.patch
@@ -0,0 +1,17 @@
+--- a/llvm/tools/dsymutil/DwarfLinker.cpp
++++ b/llvm/tools/dsymutil/DwarfLinker.cpp
+@@ -1489,8 +1489,12 @@
+   uint64_t RefOffset = *RefValue.getAsReference(&Unit);
+ 
+   if ((RefCU = getUnitForOffset(Units, RefOffset)))
+-    if (const auto *RefDie = RefCU->getOrigUnit().getDIEForOffset(RefOffset))
+-      return RefDie;
++    if (const auto *RefDie = RefCU->getOrigUnit().getDIEForOffset(RefOffset)) {
++      // In a file with broken references, an attribute might point to a NULL
++      // DIE.
++      if(!RefDie->isNULL())
++        return RefDie;
++    }
+ 
+   Linker.reportWarning("could not find referenced DIE", &Unit, &DIE);
+   return nullptr;