[Pkg-julia-devel] Bug#974779: Bug#974779: severity - Julia: Please upgrade to llvm-toolchain-11

Norbert Preining norbert at preining.info
Fri Jan 8 03:17:54 GMT 2021


Hi Sebastian,

coming back to the llvm-9 vs -10 vs -11 issue.

So, julia fails to build on ppc64el with llvm-9 because llvm-9 has bugs
there, and we cannot use llvm-11 since this is not supported in the
current version of julia.

There are thus the following options:
- keep llvm-10
- drop julia on ppc64el
- fix llvm-9

The necessary fixes for llvm-9 are described here:
https://github.com/JuliaLang/julia/pull/35477
in particular in the two patches that are included in the PR

***** deps/patches/llvm9-D71443-PPC-MC-redef-symbol.patch ******
>From 5cd52dbfa9c60cfd12676924bed97701ee9bc4ef Mon Sep 17 00:00:00 2001
From: Fangrui Song <maskray at google.com>
Date: Thu, 12 Dec 2019 16:18:57 -0800
Subject: [PATCH] [MC][PowerPC] Fix a crash when redefining a symbol after .set

Fix PR44284. This is probably not valid assembly but we should not crash.

Reviewed By: luporl, #powerpc, steven.zhang

Differential Revision: https://reviews.llvm.org/D71443

(cherry picked from commit f99eedeb72644671cd584f48e4c136d47f6b0020)
---
 llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp | 3 ++-
 llvm/test/MC/PowerPC/ppc64-localentry-symbols.s          | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
index 90c3c8d20ed..71f926c265e 100644
--- llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
+++ llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
@@ -196,7 +196,8 @@ public:

   void finish() override {
     for (auto *Sym : UpdateOther)
-      copyLocalEntry(Sym, Sym->getVariableValue());
+      if (Sym->isVariable())
+        copyLocalEntry(Sym, Sym->getVariableValue());
   }

 private:
diff --git llvm/test/MC/PowerPC/ppc64-localentry-symbols.s llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
index f1d5c5d0ab1..a663af57ad4 100644
--- llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
+++ llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
@@ -32,3 +32,8 @@ func:
   nop
   nop
   .localentry func, 8
+
+## PR44284 Don't crash if err is redefined after .set
+.set err, _err
+.globl err
+err:
--
2.26.0
******************************




******* deps/patches/llvm-9.0-D78196.patch ****************
diff --git a/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp b/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
--- a/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
+++ b/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp
@@ -210,6 +210,10 @@
     for (auto *Sym : UpdateOther)
       if (Sym->isVariable())
         copyLocalEntry(Sym, Sym->getVariableValue());
+
+    // Clear the set of symbols that needs to be updated so the streamer can
+    // be reused without issues.
+    UpdateOther.clear();
   }

 private:
****************************


I cannot guarantee that Julia will build with these fixes applied to the
LLVM-9 sources, but at least that is what I read out of the above PR.

In particular looking at the list of other patches applied to LLVM-9:
ifeq ($(LLVM_VER_SHORT),9.0)
$(eval $(call LLVM_PATCH,llvm-D27629-AArch64-large_model_6.0.1))
$(eval $(call LLVM_PATCH,llvm8-D34078-vectorize-fdiv))
$(eval $(call LLVM_PATCH,llvm-6.0-NVPTX-addrspaces)) # NVPTX -- warning: this fails check-llvm-codegen-nvptx
$(eval $(call LLVM_PATCH,llvm-7.0-D44650)) # mingw32 build fix
$(eval $(call LLVM_PATCH,llvm9-D50010-VNCoercion-ni))
$(eval $(call LLVM_PATCH,llvm8-WASM-addrspaces)) # WebAssembly
$(eval $(call LLVM_PATCH,llvm-exegesis-mingw)) # mingw build
$(eval $(call LLVM_PATCH,llvm-test-plugin-mingw)) # mingw build
$(eval $(call LLVM_PATCH,llvm7-revert-D44485))
$(eval $(call LLVM_PATCH,llvm-8.0-D66657-codegen-degenerate)) # remove for 10.0
$(eval $(call LLVM_PATCH,llvm-8.0-D71495-vectorize-freduce)) # remove for 10.0
$(eval $(call LLVM_PATCH,llvm-D75072-SCEV-add-type))
$(eval $(call LLVM_PATCH,llvm-9.0-D65174-limit-merge-stores)) # remove for 10.0

)


I guess you prefer that we drop julia for ppc64el, which would of course
be the easiest way. But I still would like to hear your opinion,
especially since llvm-10-dev is still present as of now, in both testing
and unstable.

Best

Norbert

--
PREINING Norbert                              https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



More information about the Pkg-julia-devel mailing list