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

[LLVM] Add LLVM_full, LLVM_full_assert 18 recipes #8265

Merged
merged 7 commits into from
Jun 18, 2024

Conversation

mofeing
Copy link
Contributor

@mofeing mofeing commented Mar 8, 2024

No description provided.

@Zentrik
Copy link
Contributor

Zentrik commented Mar 31, 2024

Zentrik@25f1fba should fix the patches not applying.

@Zentrik
Copy link
Contributor

Zentrik commented Apr 1, 2024

Odd, I could have sworn the patches applied when I build LLVM_full@18 x86_64-linux-gnu-cxx11 locally.

@Zentrik
Copy link
Contributor

Zentrik commented Apr 1, 2024

The symlink for the assert builds points to the LLVM 17 patches.

@Zentrik
Copy link
Contributor

Zentrik commented Apr 2, 2024

Maybe we need to add #include <cmath> for the failing file on darwin?

@giordano
Copy link
Member

giordano commented Apr 2, 2024

If it's an upstream bug, first open a PR upstream.

@Zentrik
Copy link
Contributor

Zentrik commented Apr 14, 2024

Filed llvm/llvm-project#88664.

Also, I noticed that while we download the 10.14 sdk for LLVM >= 15, that's missing /usr/include/c++/v1 (as noted in phracker/MacOSX-SDKs#21) and so I don't think that get's updated. Is this an issue?

Also rm -rf /opt/${target}/${target}/sys-root/System was failing in with errors like [17:38:16] rm: can't remove '/opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root/System/Library/PrivateFrameworks/MetalPerformanceShaders.framework/Versions/A': I/O error. I think that was due to running in unprivileged mode. Should I open an issue?

@mofeing
Copy link
Contributor Author

mofeing commented Apr 15, 2024

Filed llvm/llvm-project#88664.

Can you open an issue in https://github.com/JuliaLang/llvm-project?

@Zentrik
Copy link
Contributor

Zentrik commented Apr 15, 2024

I don't see a way to create issues, do you want me to make a pr with the fix?

@Zentrik
Copy link
Contributor

Zentrik commented Apr 15, 2024

The windows build seems to be failing on building tblgen-to-irdl in a similar fashion to llvm/llvm-project#58015. We disabled building tblgen-lsp-server to deal with that.

@mofeing
Copy link
Contributor Author

mofeing commented Apr 15, 2024

I don't see a way to create issues, do you want me to make a pr with the fix?

Yes, sorry. I meant a PR.

@giordano giordano force-pushed the llvm-18 branch 3 times, most recently from 0e0eeec to 89c4f4d Compare May 2, 2024 14:36
@Zentrik
Copy link
Contributor

Zentrik commented May 2, 2024

We probably still need a patch to deal with tblgen-to-irdl failing on windows. I was trying to make sure it worked when building statically before opening an upstream issue but my pc crashed and I haven't been able to test that yet.

Upstream issue here, llvm/llvm-project#90881.

@giordano
Copy link
Member

giordano commented May 2, 2024

I'm sure there are still plenty of things to fix, as it's always the case with LLVM 🙂 But let's get this going and see where it fails.

@giordano
Copy link
Member

giordano commented May 3, 2024

Alright, Windows builds are (as usual) the only failing ones. Example:

[00:26:06] ninja: job failed: : && /opt/bin/x86_64-w64-mingw32-libgfortran5-cxx11/x86_64-w64-mingw32-clang++ --target=x86_64-w64-mingw32 --sysroot=/opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/ -remap -D__USING_SJLJ_EXCEPTIONS__ -D__CRT__NO_INLINE -pthread -DMLIR_CAPI_ENABLE_WINDOWS_DLL_DECLSPEC -fvisibility-inlines-hidden -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Werror=mismatched-tags -O3 -DNDEBUG -Wl,--stack,16777216    -Wl,--gc-sections tools/mlir/tools/tblgen-to-irdl/CMakeFiles/tblgen-to-irdl.dir/tblgen-to-irdl.cpp.obj tools/mlir/tools/tblgen-to-irdl/CMakeFiles/tblgen-to-irdl.dir/OpDefinitionsGen.cpp.obj -o bin/tblgen-to-irdl.exe -Wl,--out-implib,lib/libtblgen-to-irdl.dll.a -Wl,--major-image-version,0,--minor-image-version,0  lib/libLLVMTableGen.a  lib/libLLVMTableGen.a  lib/libMLIRIR.a  lib/libMLIRIRDL.a  lib/libMLIRTblgenLib.a  lib/libMLIRSupport.a  lib/libMLIRDialect.a  lib/libMLIRInferTypeOpInterface.a  lib/libMLIRSideEffectInterfaces.a  lib/libMLIRIR.a  lib/libMLIRSupport.a  lib/libLLVM-18jl.dll.a  lib/libLLVMTableGen.a  lib/libLLVMSupport.a  -lpsapi  -lshell32  -lole32  -luuid  -ladvapi32  -lws2_32  /workspace/destdir/lib/libz.dll.a  lib/libLLVMDemangle.a  lib/libMLIRTableGen.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && :
[00:26:06] clang-16: warning: argument unused during compilation: '-remap' [-Wunused-command-line-argument]
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::parser<long long>::parse(llvm::cl::Option&, llvm::StringRef, llvm::StringRef, long long&)
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::basic_parser_impl::getOptionWidth(llvm::cl::Option const&) const
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::basic_parser_impl::printOptionInfo(llvm::cl::Option const&, unsigned long long) const
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::parser<long long>::printOptionDiff(llvm::cl::Option const&, long long, llvm::cl::OptionValue<long long>, unsigned long long) const
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::Option::anchor()
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::Option::addOccurrence(unsigned int, llvm::StringRef, llvm::StringRef, bool)
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::raw_ostream::operator<<(double)
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, char const*, bool)
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::Option::error(llvm::Twine const&, llvm::StringRef, llvm::raw_ostream&)
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::generic_parser_base::getOptionWidth(llvm::cl::Option const&) const
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::generic_parser_base::printGenericOptionDiff(llvm::cl::Option const&, llvm::cl::GenericOptionValue const&, llvm::cl::GenericOptionValue const&, unsigned long long) const
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::generic_parser_base::printOptionInfo(llvm::cl::Option const&, unsigned long long) const
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::cl::AddLiteralOption(llvm::cl::Option&, llvm::StringRef)
[00:26:06] >>> defined at libLLVMSupport.a(CommandLine.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::outs()
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::nulls()
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::raw_ostream::operator<<(llvm::formatv_object_base const&)
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::raw_fd_stream::raw_fd_stream(int, bool)
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::raw_fd_ostream::~raw_fd_ostream()
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::raw_ostream::changeColor(llvm::raw_ostream::Colors, bool, bool)
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: duplicate symbol: llvm::raw_ostream::resetColor()
[00:26:06] >>> defined at libLLVMSupport.a(raw_ostream.cpp.obj)
[00:26:06] >>> defined at libLLVM-18jl.dll
[00:26:06] 
[00:26:06] ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)

@Zentrik this is what you were referring to, right? Edit: ah, yes, I see you opened llvm/llvm-project#90881

@Zentrik
Copy link
Contributor

Zentrik commented May 3, 2024

@Zentrik
Copy link
Contributor

Zentrik commented May 3, 2024

🎉

@giordano giordano requested review from vchuravy and gbaraldi May 3, 2024 15:02
@gbaraldi
Copy link
Contributor

gbaraldi commented May 3, 2024

I guess they are linking to LLVMSupport still even with dylibs on but yeah that fix is fine.

@gbaraldi
Copy link
Contributor

gbaraldi commented May 3, 2024

LGTM

@vchuravy
Copy link
Member

vchuravy commented May 3, 2024

I think folks may want tblgen-to-irdl. But generally we have to build tblgen on the host once and then provide it again.
But yeah this is commonly a cmake mistake somewhere else.

LGTM, but we may need to look at that one specifically

@vtjnash
Copy link
Member

vtjnash commented Jun 18, 2024

Can we drop the last commit and fix the merge conflict, then merge, so that we don't block upgrading llvm for existing uses, for a conflict with building a new tool that seems to have been misconfigured in cmake somewhere?

@giordano giordano force-pushed the llvm-18 branch 2 times, most recently from cde0bde to 5754ebc Compare June 18, 2024 03:19
@giordano
Copy link
Member

Done. @vchuravy @gbaraldi do you want to have another look?

@vchuravy
Copy link
Member

vchuravy commented Jun 18, 2024

Patch list is: JuliaLang/llvm-project@llvmorg-18.1.7...julia-18.1.7-0
Previous to compare: JuliaLang/llvm-project@llvmorg-17.0.6...julia-17.0.6-5

I don't have time to take a detailed look, but I trust @giordano and @mofeing

@giordano
Copy link
Member

We recently did some cleanup of patches no longer needed in the release-18 branch 🙂

@vchuravy vchuravy merged commit 2015a4f into JuliaPackaging:master Jun 18, 2024
29 checks passed
@mofeing mofeing deleted the llvm-18 branch June 18, 2024 18:45
amontoison pushed a commit that referenced this pull request Jun 22, 2024
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.

6 participants