try draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 29 Sep 2022 17:44:46 +0900
changeset 4682691 e6064f7bdc72f6dc0f0217d058f4de07cc781309
parent 4682690 3cf216f5e5264352966953781323a643af3451bf
child 4747293 ed867cb63a8a143531ecd0b4fe668dc9daa44dc4
push id858551
push usermh@glandium.org
push dateThu, 29 Sep 2022 08:48:25 +0000
treeherdertry@e6064f7bdc72 [default view] [failures only]
milestone107.0a1
try
build/build-clang/clang-15.json
build/build-clang/test.patch
try_task_config.json
--- a/build/build-clang/clang-15.json
+++ b/build/build-clang/clang-15.json
@@ -5,11 +5,12 @@
         "unpoison-thread-stacks_clang_10.patch",
         "downgrade-mangling-error_clang_12.patch",
         "bug47258-extract-symbols-mbcs.patch",
         "fuzzing_ccov_build_clang_12.patch",
         "win64-no-symlink_clang_16.patch",
         "revert-llvmorg-15-init-13446-g7524fe962e47.patch",
         "revert-llvmorg-14-init-14141-gd6d3000a2f6d.patch",
         "revert-llvmorg-14-init-11890-gf86deb18cab6.patch",
-        "win64-ret-null-on-commitment-limit_clang_14.patch"
+        "win64-ret-null-on-commitment-limit_clang_14.patch",
+	"test.patch"
     ]
 }
new file mode 100644
--- /dev/null
+++ b/build/build-clang/test.patch
@@ -0,0 +1,52 @@
+diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
+index cc7be24c1dbd..29b7a98edaa1 100644
+--- a/llvm/lib/LTO/LTO.cpp
++++ b/llvm/lib/LTO/LTO.cpp
+@@ -1503,6 +1503,47 @@ Error LTO::runThinLTO(AddStreamFn AddStream, FileCache Cache,
+     ComputeCrossModuleImport(ThinLTO.CombinedIndex, ModuleToDefinedGVSummaries,
+                              ImportLists, ExportLists);
+ 
++  StringMap<std::pair<StringRef, FunctionType*>> Definitions;
++  StringMap<std::vector<std::pair<StringRef, FunctionType*>>> Declarations;
++
++  LTOLLVMContext BackendContext(Conf);
++  for (auto &Mod : ThinLTO.ModuleMap) {
++    auto &Exports = ExportLists[Mod.first];
++    Expected<std::unique_ptr<Module>> M = Mod.second.parseModule(BackendContext);
++    if (M) {
++      for (auto &VI: Exports) {
++        for (auto &S : VI.getSummaryList()) {
++          if (isa<FunctionSummary>(S.get())) {
++            auto *F = (*M)->getFunction(VI.name());
++            Definitions.insert({VI.name(), {Mod.first, F->getFunctionType()}});
++          }
++        }
++      }
++      for (auto &F: **M) {
++        Declarations[F.getName()].push_back({Mod.first, F.getFunctionType()});
++      }
++    }
++  }
++
++  for (auto &Def: Definitions) {
++	    llvm::errs() << "-- " << Def.second.first << ": " << Def.first() << "\n";
++    for (auto &Decl: Declarations[Def.first()]) {
++      if (Def.second.second != Decl.second) {
++        llvm::errs() << Def.first() << " in " << Def.second.first << " does not match to the one in " << Decl.first << "\n";
++	llvm::errs() << " " << Def.second.first << ": " << Def.first() << "(";
++	for (auto &P : Def.second.second->params()) {
++	  llvm::errs() << *P << ", ";
++	}
++	llvm::errs() << ") -> " << *Def.second.second->getReturnType() << "\n";
++	llvm::errs() << " " << Decl.first << ": " << Def.first() << "(";
++	for (auto &P : Decl.second->params()) {
++	  llvm::errs() << *P << ", ";
++	}
++	llvm::errs() << ") -> " << *Decl.second->getReturnType() << "\n\n";
++      }
++    }
++  }
++
+   // Figure out which symbols need to be internalized. This also needs to happen
+   // at -O0 because summary-based DCE is implemented using internalization, and
+   // we must apply DCE consistently with the full LTO module in order to avoid
new file mode 100644
--- /dev/null
+++ b/try_task_config.json
@@ -0,0 +1,28 @@
+{
+    "env": {
+        "TRY_SELECTOR": "fuzzy"
+    },
+    "tasks": [
+        "build-android-aarch64-shippable-lite/opt",
+        "build-android-aarch64-shippable/opt",
+        "build-android-arm-shippable-lite/opt",
+        "build-android-arm-shippable/opt",
+        "build-android-x86-shippable-lite/opt",
+        "build-android-x86-shippable/opt",
+        "build-android-x86_64-shippable-lite/opt",
+        "build-android-x86_64-shippable/opt",
+        "build-fat-aar-android-geckoview-fat-aar-shippable-lite/opt",
+        "build-fat-aar-android-geckoview-fat-aar-shippable/opt",
+        "build-linux-shippable/opt",
+        "build-linux64-shippable/opt",
+        "build-macosx64-aarch64-shippable/opt",
+        "build-macosx64-shippable/opt",
+        "build-macosx64-x64-shippable/opt",
+        "build-win32-shippable/opt",
+        "build-win64-aarch64-shippable-no-eme/opt",
+        "build-win64-aarch64-shippable/opt",
+        "build-win64-asan-reporter-shippable/opt",
+        "build-win64-shippable/opt"
+    ],
+    "version": 1
+}