Hi Norbert On 2021-01-08 12:17:54, Norbert Preining wrote: > 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
Sylvestre, could you apply the two patches to llvm-toolchain-9 so that we can check if that fixes the julia build on ppc64el? If that doesn't help, we can still look at droping julia from ppc64el. > ***** deps/patches/llvm9-D71443-PPC-MC-redef-symbol.patch ****** > From 5cd52dbfa9c60cfd12676924bed97701ee9bc4ef Mon Sep 17 00:00:00 2001 > From: Fangrui Song <mask...@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. FWIW, I have already added the removal hint for llvm-toolchain-10, but removal is still blocked by julia: trying: -llvm-toolchain-10 skipped: -llvm-toolchain-10 (61, 0, 187) got: 29+0: a-5:a-23:a-0:a-0:i-0:m-0:m-0:p-0:s-1 * amd64: cantor-backend-julia, julia, libjulia-dev, libjulia1 (from https://release.debian.org/britney/update_output.txt) So once julia is either built on or removed from ppc64el and therefore able to migrate, llvm-toolchain-10 will be removed from testing. Cheers -- Sebastian Ramacher