Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build 13.0.0 #131

Merged
merged 7 commits into from
Oct 2, 2021
Merged

Build 13.0.0 #131

merged 7 commits into from
Oct 2, 2021

Conversation

h-vetinari
Copy link
Member

Like #116
CC @xhochy @isuruf

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@h-vetinari h-vetinari marked this pull request as draft September 14, 2021 08:47
@h-vetinari
Copy link
Member Author

Opened https://bugs.llvm.org/show_bug.cgi?id=51859 upstream for the linux+x86 failure and marked it as blocking for 13.0.0.

@h-vetinari
Copy link
Member Author

h-vetinari commented Sep 14, 2021

For completeness, building on ppc fails with both gcc 8 & 9, so I'm trying 11 (skipped 10 for now):

GCC 8: environment resolution error
Packaging libllvm13
INFO:conda_build.build:Packaging libllvm13
INFO conda_build.build:build(2274): Packaging libllvm13
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

## Package Plan ##

  environment location: /home/conda/feedstock_root/build_artifacts/llvm-package_1631623423088/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol


The following NEW packages will be INSTALLED:

    _libgcc_mutex: 0.1-conda_forge      conda-forge
    _openmp_mutex: 4.5-1_gnu            conda-forge
    libgcc-ng:     11.1.0-h16e2c27_8    conda-forge
    libgomp:       11.1.0-h16e2c27_8    conda-forge
    libstdcxx-ng:  11.1.0-h8186cfa_8    conda-forge
    zlib:          1.2.11-h6eb9509_1010 conda-forge

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (repodata.json): ...working... done

[...]

The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.12=0
  - feature:|@/linux-64::__glibc==2.12=0
  - bzip2==1.0.8=h7f98852_4 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - expat==2.4.1=h9c3ff4c_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - gcc_impl_linux-64==8.4.0=he7ac559_17 -> libgcc-ng[version='>=4.9'] -> __glibc[version='>=2.17']
  - gcc_impl_linux-ppc64le==8.4.0=h4ff2a5e_19 -> libgcc-ng[version='>=4.9'] -> __glibc[version='>=2.17']
  - krb5==1.19.2=hcc1bbae_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - libcurl==7.78.0=h2574ce0_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - libedit==3.1.20191231=he28a2e2_2 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - libev==4.33=h516909a_1 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - libnghttp2==1.43.0=h812cca2_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - libuv==1.42.0=h7f98852_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - lz4-c==1.9.3=h9c3ff4c_1 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - ncurses==6.2=h58526e2_4 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - readline==8.1=h46c0cb4_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - rhash==1.4.1=h7f98852_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - xz==5.2.5=h516909a_1 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - zlib==1.2.11=h516909a_1010 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - zstd==1.5.0=ha95c52a_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.12

Note that strict channel priority may have removed packages required for satisfiability.
GCC 9: linker error
[ 88%] Linking CXX static library ../../../../lib/libLLVMExegesisX86.a
[ 88%] Built target LLVMExegesisX86
../../lib/libLLVMXCoreCodeGen.a(XCoreLowerThreadLocal.cpp.o): in function `initializeXCoreLowerThreadLocalPassOnce(llvm::PassRegistry&)':
XCoreLowerThreadLocal.cpp:(.text._ZL39initializeXCoreLowerThreadLocalPassOnceRN4llvm12PassRegistryE+0xbc): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::PassRegistry::registerPass(llvm::PassInfo const&, bool)' defined in .text._ZN4llvm12PassRegistry12registerPassERKNS_8PassInfoEb section in ../../lib/libLLVMCore.a(PassRegistry.cpp.o)
../../lib/libLLVMXCoreCodeGen.a(XCoreLowerThreadLocal.cpp.o): in function `(anonymous namespace)::XCoreLowerThreadLocal::~XCoreLowerThreadLocal()':
XCoreLowerThreadLocal.cpp:(.text._ZN12_GLOBAL__N_121XCoreLowerThreadLocalD2Ev+0x30): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::ModulePass::~ModulePass()' defined in .text._ZN4llvm10ModulePassD2Ev section in ../../lib/libLLVMCore.a(Pass.cpp.o)
../../lib/libLLVMXCoreCodeGen.a(XCoreLowerThreadLocal.cpp.o): in function `(anonymous namespace)::XCoreLowerThreadLocal::~XCoreLowerThreadLocal()':
XCoreLowerThreadLocal.cpp:(.text._ZN12_GLOBAL__N_121XCoreLowerThreadLocalD0Ev+0x38): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::ModulePass::~ModulePass()' defined in .text._ZN4llvm10ModulePassD2Ev section in ../../lib/libLLVMCore.a(Pass.cpp.o)
../../lib/libLLVMXCoreCodeGen.a(XCoreLowerThreadLocal.cpp.o): in function `llvm::Pass* llvm::callDefaultCtor<(anonymous namespace)::XCoreLowerThreadLocal>()':
XCoreLowerThreadLocal.cpp:(.text._ZN4llvm15callDefaultCtorIN12_GLOBAL__N_121XCoreLowerThreadLocalEEEPNS_4PassEv+0x78): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::PassRegistry::getPassRegistry()' defined in .text._ZN4llvm12PassRegistry15getPassRegistryEv section in ../../lib/libLLVMCore.a(PassRegistry.cpp.o)
../../lib/libLLVMXCoreCodeGen.a(XCoreLowerThreadLocal.cpp.o): in function `llvm::createXCoreLowerThreadLocalPass()':
XCoreLowerThreadLocal.cpp:(.text._ZN4llvm31createXCoreLowerThreadLocalPassEv+0x78): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::PassRegistry::getPassRegistry()' defined in .text._ZN4llvm12PassRegistry15getPassRegistryEv section in ../../lib/libLLVMCore.a(PassRegistry.cpp.o)
../../lib/libLLVMXCoreCodeGen.a(XCoreLowerThreadLocal.cpp.o): in function `void std::__insertion_sort<llvm::WeakTrackingVH*, __gnu_cxx::__ops::_Iter_less_iter>(llvm::WeakTrackingVH*, llvm::WeakTrackingVH*, __gnu_cxx::__ops::_Iter_less_iter)':
XCoreLowerThreadLocal.cpp:(.text._ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_[_ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_]+0xe0): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::ValueHandleBase::AddToExistingUseList(llvm::ValueHandleBase**)' defined in .text._ZN4llvm15ValueHandleBase20AddToExistingUseListEPPS0_ section in ../../lib/libLLVMCore.a(Value.cpp.o)
XCoreLowerThreadLocal.cpp:(.text._ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_[_ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_]+0x13c): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::ValueHandleBase::RemoveFromUseList()' defined in .text._ZN4llvm15ValueHandleBase17RemoveFromUseListEv section in ../../lib/libLLVMCore.a(Value.cpp.o)
XCoreLowerThreadLocal.cpp:(.text._ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_[_ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_]+0x17c): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::ValueHandleBase::AddToExistingUseList(llvm::ValueHandleBase**)' defined in .text._ZN4llvm15ValueHandleBase20AddToExistingUseListEPPS0_ section in ../../lib/libLLVMCore.a(Value.cpp.o)
XCoreLowerThreadLocal.cpp:(.text._ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_[_ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_]+0x1cc): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::ValueHandleBase::RemoveFromUseList()' defined in .text._ZN4llvm15ValueHandleBase17RemoveFromUseListEv section in ../../lib/libLLVMCore.a(Value.cpp.o)
XCoreLowerThreadLocal.cpp:(.text._ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_[_ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_]+0x20c): relocation truncated to fit: R_PPC64_REL24 against symbol `llvm::ValueHandleBase::AddToExistingUseList(llvm::ValueHandleBase**)' defined in .text._ZN4llvm15ValueHandleBase20AddToExistingUseListEPPS0_ section in ../../lib/libLLVMCore.a(Value.cpp.o)
XCoreLowerThreadLocal.cpp:(.text._ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_[_ZSt16__insertion_sortIPN4llvm14WeakTrackingVHEN9__gnu_cxx5__ops15_Iter_less_iterEEvT_S6_T0_]+0x240): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
make[2]: *** [tools/llvm-shlib/CMakeFiles/LLVM.dir/build.make:299: lib/libLLVM-13.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:30826: tools/llvm-shlib/CMakeFiles/LLVM.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
GCC 11: linker error
[ 88%] Building CXX object tools/llvm-exegesis/lib/X86/CMakeFiles/LLVMExegesisX86.dir/X86Counter.cpp.o
collect2: error: ld returned 1 exit status
make[2]: *** [tools/llvm-shlib/CMakeFiles/LLVM.dir/build.make:299: lib/libLLVM-13.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:30826: tools/llvm-shlib/CMakeFiles/LLVM.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 88%] Linking CXX static library ../../../../lib/libLLVMExegesisX86.a
[ 88%] Built target LLVMExegesisX86
make: *** [Makefile:156: all] Error 2

@h-vetinari
Copy link
Member Author

h-vetinari commented Sep 14, 2021

Raised another issue for the PPC build problems going back to #115, which seem to affect all GCC versions >=9 when building: https://bugs.llvm.org/show_bug.cgi?id=51863

@h-vetinari
Copy link
Member Author

h-vetinari commented Sep 15, 2021

Upstream noted (re: PPC-vs-GCC):

Try removing -fno-plt from C(XX)?FLAGS, or try appending -fplt to them to overwrite the existing -fno-plt. I'm not sure if this resolves the issue, but it can be said that the compiler option -fno-plt affects relocations in some manner.

I can see that we have

CFLAGS=-mcpu=power8 -mtune=power8 -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/llvm-package-13.0.0.rc3 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix

and best as I can tell this is originally coming from here. The GCC docs make -fno-plot sound performance-relevant, so that's probably the reason it's added everywhere?

Options I see ATM:

Option Fixes
issue now
Solves issue long-term Comment
Use linux-anvil-cos7-x86_64
for building PPC
Probably?
Nope
No, still bound to GCC < 9 get around glibc 2.12
resolution issues
Try again with GCC 8.5.0 Maybe? No, still bound to GCC < 9 Probably needs this PR
Remove -fno-plt ?
Passes ✔️
Unblocks GCC version;
performance impact?
+ bump to GCC >= 9;
helps debug upstream

Any thoughts/advice @isuruf @xhochy @beckermr?

EDIT: Resolution error remains with glibc 2.17
The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.17=0
  - feature:|@/linux-64::__glibc==2.17=0
  - bzip2==1.0.8=h7f98852_4 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - expat==2.4.1=h9c3ff4c_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - gcc_impl_linux-64==8.4.0=he7ac559_17 -> libgcc-ng[version='>=4.9'] -> __glibc[version='>=2.17']
  - gcc_impl_linux-ppc64le==8.4.0=h4ff2a5e_19 -> libgcc-ng[version='>=4.9'] -> __glibc[version='>=2.17']
  - krb5==1.19.2=hcc1bbae_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - libcurl==7.78.0=h2574ce0_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - libedit==3.1.20191231=he28a2e2_2 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - libev==4.33=h516909a_1 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - libnghttp2==1.43.0=h812cca2_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - libuv==1.42.0=h7f98852_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - lz4-c==1.9.3=h9c3ff4c_1 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - ncurses==6.2=h58526e2_4 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - readline==8.1=h46c0cb4_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - rhash==1.4.1=h7f98852_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']
  - xz==5.2.5=h516909a_1 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']
  - zstd==1.5.0=ha95c52a_0 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.17

@h-vetinari
Copy link
Member Author

Unexpectedly, the build without -fno-plt now passes on PPC with GCC 9. I'll communicate this upstream, but that gives us perhaps the best short-term option here: just build without that flag, and accept the (presumed) perf-hit on PPC (until it is fixed).

Thoughts?

@h-vetinari
Copy link
Member Author

Regarding the failure of building for PPC with GCC, upstream said:

Unfortunately, the fix for this would not be something this community can provide as the bug is in GCC.

I do however think that removing the -fno-plt option for PPC builds is the correct course of action (irrespective of whether any GCC bugs with this option are ever fixed).

@h-vetinari h-vetinari changed the title WIP: try building 13.0.0.rc3 WIP: try building 13.0.0.rc's Sep 25, 2021
@h-vetinari
Copy link
Member Author

With the comments happening on the upstream bug for the multiple.ll failure, I just saw noticed the following in build.sh:

if [[ "$target_platform" == "linux-64" ]]; then
  CMAKE_ARGS="${CMAKE_ARGS} -DLLVM_USE_INTEL_JITEVENTS=ON"
fi

I traced the addition of this back to b676b4b by @anton-malakhov. Sorry for the ping out of the blue, but since the addition isn't commented, could you maybe quickly explain what it does?

@h-vetinari h-vetinari changed the title WIP: try building 13.0.0.rc's Build rc's for 13.0.0 Sep 27, 2021
@h-vetinari h-vetinari marked this pull request as ready for review September 27, 2021 04:51
@h-vetinari
Copy link
Member Author

@conda-forge/llvmdev @xhochy
This now builds for all architectures and is ready IMO; only the last few commits need review, the rest is a clean merge of master into the rc-branch.

For the two failures I'm following the respective upstream recommendations to circumvent them, see:
https://bugs.llvm.org/show_bug.cgi?id=51859
https://bugs.llvm.org/show_bug.cgi?id=51863

@h-vetinari
Copy link
Member Author

If we want to have a chance to report bugs in clang/lld/openmp before 13.0.0 final, we should consider merging this? Any comment @isuruf @xhochy?

@h-vetinari
Copy link
Member Author

Would people prefer to carry https://reviews.llvm.org/D110589 (not landed yet) rather than removing -DLLVM_USE_INTEL_JITEVENTS=ON?

@xhochy
Copy link
Member

xhochy commented Sep 29, 2021

Would people prefer to carry https://reviews.llvm.org/D110589 (not landed yet) rather than removing -DLLVM_USE_INTEL_JITEVENTS=ON?

From a quick look at the description, this patch is about fixing a faulty test vs disabling a feature? Then I would prefer the patch.

@h-vetinari
Copy link
Member Author

From a quick look at the description, this patch is about fixing a faulty test vs disabling a feature? Then I would prefer the patch.

Yeah, in the meantime, the discussion on the issue has progressed, and I think everyone agrees with (the approach for) the patch - though it hasn't landed yet.

Will update later, thanks for taking a look! :)

@h-vetinari
Copy link
Member Author

PTAL @xhochy @isuruf

#- patches/expect-fastmath-entrypoints-in-add-TLI-mappings.ll.patch # adjusts test added in 10.0.0 for intel-D47188-svml-VF.patch effects
# Revert an upstream change for Numba
# ref: https://github.com/numba/llvmlite/blob/v0.29.0/conda-recipes/0001-Revert-Limit-size-of-non-GlobalValue-name.patch
- patches/numba-0001-Revert-Limit-size-of-non-GlobalValue-name.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to this patch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't apply anymore. There's no NonGlobalValueMaxNameSize left in https://github.com/llvm/llvm-project/blob/release/13.x/llvm/lib/IR/Value.cpp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in function.cpp. See llvm/llvm-project@8d25762

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for the info. To be honest, I'm not sure I fully understand what's necessary for this (and think it should be done when the other numba-patches are adapted, cf. #123). Is the following the patch as you would envision it?

diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 4034b1505bd0..26600bd2d9b9 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -77,10 +77,6 @@ using ProfileCount = Function::ProfileCount;
 // are not in the public header file...
 template class llvm::SymbolTableListTraits<BasicBlock>;

-static cl::opt<unsigned> NonGlobalValueMaxNameSize(
-    "non-global-value-max-name-size", cl::Hidden, cl::init(1024),
-    cl::desc("Maximum size for the name of non-global values."));
-
 //===----------------------------------------------------------------------===//
 // Argument Implementation
 //===----------------------------------------------------------------------===//
@@ -390,7 +386,7 @@ Function::Function(FunctionType *Ty, LinkageTypes Linkage, unsigned AddrSpace,

   // We only need a symbol table for a function if the context keeps value names
   if (!getContext().shouldDiscardValueNames())
-    SymTab = std::make_unique<ValueSymbolTable>(NonGlobalValueMaxNameSize);
+    SymTab = std::make_unique<ValueSymbolTable>();

   // If the function has arguments, mark them as lazily built.
   if (Ty->getNumParams())

@h-vetinari
Copy link
Member Author

LLVM 13.0.0 has been released. Can someone point this PR to master, please?

@h-vetinari h-vetinari changed the title Build rc's for 13.0.0 Build 13.0.0 Oct 1, 2021
@isuruf isuruf changed the base branch from rc to master October 1, 2021 06:28
@h-vetinari
Copy link
Member Author

Annoyingly, the windows build failed during package upload. Could you please restart it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants