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: fix advertise of libxml2.tbd as system-libs #61005

Closed
wants to merge 1 commit into from

Conversation

bcardiff
Copy link
Contributor

@BrewTestBot BrewTestBot added the python Python use is a significant feature of the PR or issue label Sep 12, 2020
@huanghantao
Copy link

@bcardiff Is this PR a solution to this problem?

clang++ -g test.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core mcjit native` -O3 -o test

ld: library not found for -llibxml2.tbd
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

@SMillerDev
Copy link
Member

Is this also submitted upstream?

@bcardiff
Copy link
Contributor Author

@huanghantao yes

@SMillerDev the patch was extracted from change in upstream master, but they were not ported to the 10.x maintenance branch.

@bcardiff bcardiff force-pushed the llvm-10 branch 4 times, most recently from 97c77e1 to 42c3012 Compare September 13, 2020 16:50
@bcardiff
Copy link
Contributor Author

CI passed. Patch files now references a commit in master branch of the patches repo.

FYI, The pull request instructions does not validate some checks regarding the order of some methods in the formula.

Copy link
Member

@SMillerDev SMillerDev left a comment

Choose a reason for hiding this comment

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

Thanks @bcardiff ! Without contributions like yours it'd be impossible to keep homebrew going with the high standards that users have come to expect from the project. You can feel good knowing that you've made the world a tiny bit better for homebrew users around the world! 👍 🎉

@BrewTestBot
Copy link
Member

🤖 A scheduled task has triggered a merge.

@bcardiff
Copy link
Contributor Author

Thanks @SMillerDev. Although I use llvm, I know nothing of the llvm code itself and nothing of CMake. Yet, with git and a bit patience it was enough to make the fix.

I appreciate the recognition. I know at least that Crystal osx devs and its CI will be happier now at least. That was what pushed me forward.

I sent the patch to llvm just in case also at https://reviews.llvm.org/D87590

@bcardiff bcardiff mentioned this pull request Sep 14, 2020
@Geod24
Copy link
Contributor

Geod24 commented Sep 14, 2020

I know at least that Crystal osx devs and its CI will be happier now at least.

Dlang OSX devs say hi, and thanks a mil for the fix and follow up!

Geod24 added a commit to Geod24/homebrew-core that referenced this pull request Sep 14, 2020
The bug it was working around has been fixed in Homebrew#61005
@bayandin bayandin mentioned this pull request Sep 14, 2020
5 tasks
@SMillerDev
Copy link
Member

Open source at it's finest 👌

@thedataking
Copy link

Appreciate everyone's effort here as I too was hitting this issue. After updating to 10.0.1_1, I still see libxml2.tbd in the output of $(brew --prefix llvm)/bin/llvm-config --system-libs. Anybody else seeing this?

Note: I ran brew upgrade llvm to get 10.0.1_1.

@bcardiff
Copy link
Contributor Author

I can confirm the 10.0.1_1 bottle is still advertising the libxml2.tbd, but when building the formula from source everything is good.

$ brew install --build-from-source Formula/llvm.rb 
Updating Homebrew...
...

==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-llvm.diff
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-clang.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/3a6355341bd7f90a5a04abfb376f666c2b3fdaa2fbdd9eec20ffb815596db395--clang-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang-tools-extra-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/e10987c91f52317eec7680e63ec2f6be4181d29abe4bbeb0f221431ef95706e5--clang-tools-extra-10.0.1.src.tar.xz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-compiiler-rt.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/compiler-rt-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/a97b4e25de24ad4c204021d29c375a7c1e161f1f462498d6f4ad36fdd46d6bc2--compiler-rt-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/libcxx-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/58d3dcb5f1bc235cc98072f0ffff0dae8c6a0d02c87244848be235fb57f34a28--libcxx-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/libunwind-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/a3f5232f8ad4864fa36f7764bac70224003a37b79eda0cee50dd49f93eb5801b--libunwind-10.0.1.src.tar.xz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-lld.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/lld-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/70d5e0376302f797be41608daf7d0f98a6c27eb49d9e397ea3864553c37089fe--lld-10.0.1.src.tar.xz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-lldb.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/lldb-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/d7b77196211a09a6a922d978436c535b91c16ce386ed962dde22c18ba25f4924--lldb-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/openmp-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/19562aa0eaac369e822432cc85943bb5a644d6ebac02ee5472d15ce7e236dec5--openmp-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/polly-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/6a92714d670adcb04002c92ad641417143e3f53577b307e632bf442110f12275--polly-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/b11b345cbbb31f7b10defd6ef991018e4c65f45b1b4737181f2be15b0825c332--llvm-10.0.1.src.tar.xz
==> Patching
==> Applying 10.0.1-llvm.diff
patching file cmake/config-ix.cmake
patching file cmake/modules/LLVMConfig.cmake.in
patching file include/llvm/Config/config.h.cmake
patching file lib/Support/CMakeLists.txt
patching file lib/Support/CRC.cpp
patching file lib/Support/Compression.cpp
patching file lib/Support/Unix/Process.inc
patching file test/CMakeLists.txt
patching file test/lit.site.cfg.py.in
patching file unittests/Support/CompressionTest.cpp
patching file utils/gn/secondary/clang/test/BUILD.gn
patching file utils/gn/secondary/compiler-rt/test/BUILD.gn
patching file utils/gn/secondary/lld/test/BUILD.gn
patching file utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
patching file utils/gn/secondary/llvm/test/BUILD.gn
==> Patching clang
==> Applying 10.0.1-clang.diff
patching file CMakeLists.txt
patching file test/CMakeLists.txt
patching file test/lit.site.cfg.py.in
==> Patching lld
==> Applying 10.0.1-lld.diff
patching file CMakeLists.txt
patching file test/CMakeLists.txt
patching file test/lit.site.cfg.py.in
==> Patching lldb
==> Applying 10.0.1-lldb.diff
patching file cmake/modules/LLDBStandalone.cmake
patching file source/Core/CMakeLists.txt
patching file source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
patching file source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
==> Patching compiler-rt
==> Applying 10.0.1-compiiler-rt.diff
patching file cmake/config-ix.cmake
patching file lib/xray/tests/CMakeLists.txt
patching file test/lit.common.configured.in
==> cmake -G Unix Makefiles .. -DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld;lldb;polly;openmp -DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx;libunwind -DLLVM_PO
==> make
==> make install
==> make install-xcode-toolchain
==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH run:
  echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.profile

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/usr/local/opt/llvm/lib"
  export CPPFLAGS="-I/usr/local/opt/llvm/include"

==> Summary
🍺  /usr/local/Cellar/llvm/10.0.1_1: 7,029 files, 1GB, built in 70 minutes 33 seconds
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--69c7d4c803a174dff6809d02255e7e4c19d80f25c73dd5fcf2657769db158e25.diff... (2.6KB)
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--734f87580e89d76507b8c41a5a75b5105c41a2d03a8dc2fad5c7ef027d771a3e.diff... (1.9KB)
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--8ad0ce521b010dfb941c0979c1c072a2b40e4a69424374541d28122ba74ce4a0.diff... (2.3KB)
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--44a605f614a26fb20d127b041e2a87e6adc9b8332e07cbbb6b457bc391cda660.diff... (2KB)


$ llvm-config --libs --system-libs --ldflags
-L/usr/local/Cellar/llvm/10.0.1_1/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-lLLVMXRay -lLLVMWindowsManifest -lLLVMTableGen -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMOrcJIT -lLLVMOrcError -lLLVMJITLink -lLLVMObjectYAML -lLLVMMCA -lLLVMLTO -lLLVMObjCARCOpts -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMLineEditor -lLLVMLibDriver -lLLVMInterpreter -lLLVMFuzzMutate -lLLVMFrontendOpenMP -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMDWARFLinker -lLLVMDlltoolDriver -lLLVMOption -lLLVMDebugInfoGSYM -lLLVMCoverage -lLLVMCoroutines -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Utils -lLLVMX86Info -lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyDesc -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyInfo -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSparcDisassembler -lLLVMSparcCodeGen -lLLVMSparcAsmParser -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMRISCVDisassembler -lLLVMRISCVCodeGen -lLLVMRISCVAsmParser -lLLVMRISCVDesc -lLLVMRISCVUtils -lLLVMRISCVInfo -lLLVMPowerPCDisassembler -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMMSP430Disassembler -lLLVMMSP430CodeGen -lLLVMMSP430AsmParser -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen -lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFCodeGen -lLLVMBPFAsmParser -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAMDGPUDisassembler -lLLVMAMDGPUCodeGen -lLLVMMIRParser -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMAMDGPUAsmParser -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMAMDGPUInfo -lLLVMAArch64Disassembler -lLLVMMCDisassembler -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoDWARF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMTextAPI -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMAArch64AsmParser -lLLVMMCParser -lLLVMAArch64Desc -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMSupport -lLLVMDemangle
-lm -lz -lcurses -lxml2

@jedisct1
Copy link
Contributor

This is going to make Zig users happy, too. Thanks for that fix!

@jedisct1
Copy link
Contributor

jedisct1 commented Sep 17, 2020

Looks like even after rebuilding from source, llvm-config --system-libs still includes -llibxml2.tbd.

@hogepodge
Copy link

I'm up to date and linking against llvm is still throwing "ld: library not found for -llibxml2.tbd"

@bcardiff
Copy link
Contributor Author

Without any guidance of why --build-from-source locally gives a different result than the bottle I'm in a blind spot regarding this.

Maybe it would be better to rollback 10.0.1 in brew and leave the latest 10.0.0 bottle until 10.0.1 is patched correctly (note that that will probably help for 11.0.0)

@jedisct1
Copy link
Contributor

Does having libxml (from Homebrew, not the system one) installed before compiling llvm 10.0.1 make a difference?

@hogepodge
Copy link

I also made the mistake up upgrading to the latesst release of XCode, and LLVM 10.0.1 hasn't caught up on the toolchain yet, so my source build errors out with:

CMake Error at tools/xcode-toolchain/CMakeLists.txt:80 (message):
  Could not identify toolchain dir

😞

@hogepodge
Copy link

I've been trying to figure out how to pin to an earlier version, but many of the docs and suggests are unclear (I'm fairly new to this) and the one method that seemed to work has moved from 'deprecated' to 'removed'.

@garyhe0780
Copy link

garyhe0780 commented Sep 20, 2020

I can confirm the 10.0.1_1 bottle is still advertising the libxml2.tbd, but when building the formula from source everything is good.

$ brew install --build-from-source Formula/llvm.rb 
Updating Homebrew...
...

==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-llvm.diff
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-clang.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/3a6355341bd7f90a5a04abfb376f666c2b3fdaa2fbdd9eec20ffb815596db395--clang-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/clang-tools-extra-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/e10987c91f52317eec7680e63ec2f6be4181d29abe4bbeb0f221431ef95706e5--clang-tools-extra-10.0.1.src.tar.xz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-compiiler-rt.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/compiler-rt-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/a97b4e25de24ad4c204021d29c375a7c1e161f1f462498d6f4ad36fdd46d6bc2--compiler-rt-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/libcxx-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/58d3dcb5f1bc235cc98072f0ffff0dae8c6a0d02c87244848be235fb57f34a28--libcxx-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/libunwind-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/a3f5232f8ad4864fa36f7764bac70224003a37b79eda0cee50dd49f93eb5801b--libunwind-10.0.1.src.tar.xz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-lld.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/lld-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/70d5e0376302f797be41608daf7d0f98a6c27eb49d9e397ea3864553c37089fe--lld-10.0.1.src.tar.xz
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/c7da61787c62822804dd90192dd9dd254511192c/llvm/10.0.1-lldb.diff
######################################################################## 100.0%
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/lldb-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/d7b77196211a09a6a922d978436c535b91c16ce386ed962dde22c18ba25f4924--lldb-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/openmp-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/19562aa0eaac369e822432cc85943bb5a644d6ebac02ee5472d15ce7e236dec5--openmp-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/polly-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/6a92714d670adcb04002c92ad641417143e3f53577b307e632bf442110f12275--polly-10.0.1.src.tar.xz
==> Downloading https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.1/llvm-10.0.1.src.tar.xz
Already downloaded: /Users/bcardiff/Library/Caches/Homebrew/downloads/b11b345cbbb31f7b10defd6ef991018e4c65f45b1b4737181f2be15b0825c332--llvm-10.0.1.src.tar.xz
==> Patching
==> Applying 10.0.1-llvm.diff
patching file cmake/config-ix.cmake
patching file cmake/modules/LLVMConfig.cmake.in
patching file include/llvm/Config/config.h.cmake
patching file lib/Support/CMakeLists.txt
patching file lib/Support/CRC.cpp
patching file lib/Support/Compression.cpp
patching file lib/Support/Unix/Process.inc
patching file test/CMakeLists.txt
patching file test/lit.site.cfg.py.in
patching file unittests/Support/CompressionTest.cpp
patching file utils/gn/secondary/clang/test/BUILD.gn
patching file utils/gn/secondary/compiler-rt/test/BUILD.gn
patching file utils/gn/secondary/lld/test/BUILD.gn
patching file utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
patching file utils/gn/secondary/llvm/test/BUILD.gn
==> Patching clang
==> Applying 10.0.1-clang.diff
patching file CMakeLists.txt
patching file test/CMakeLists.txt
patching file test/lit.site.cfg.py.in
==> Patching lld
==> Applying 10.0.1-lld.diff
patching file CMakeLists.txt
patching file test/CMakeLists.txt
patching file test/lit.site.cfg.py.in
==> Patching lldb
==> Applying 10.0.1-lldb.diff
patching file cmake/modules/LLDBStandalone.cmake
patching file source/Core/CMakeLists.txt
patching file source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
patching file source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
==> Patching compiler-rt
==> Applying 10.0.1-compiiler-rt.diff
patching file cmake/config-ix.cmake
patching file lib/xray/tests/CMakeLists.txt
patching file test/lit.common.configured.in
==> cmake -G Unix Makefiles .. -DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld;lldb;polly;openmp -DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx;libunwind -DLLVM_PO
==> make
==> make install
==> make install-xcode-toolchain
==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH run:
  echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.profile

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/usr/local/opt/llvm/lib"
  export CPPFLAGS="-I/usr/local/opt/llvm/include"

==> Summary
🍺  /usr/local/Cellar/llvm/10.0.1_1: 7,029 files, 1GB, built in 70 minutes 33 seconds
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--69c7d4c803a174dff6809d02255e7e4c19d80f25c73dd5fcf2657769db158e25.diff... (2.6KB)
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--734f87580e89d76507b8c41a5a75b5105c41a2d03a8dc2fad5c7ef027d771a3e.diff... (1.9KB)
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--8ad0ce521b010dfb941c0979c1c072a2b40e4a69424374541d28122ba74ce4a0.diff... (2.3KB)
Removing: /Users/bcardiff/Library/Caches/Homebrew/llvm--patch--44a605f614a26fb20d127b041e2a87e6adc9b8332e07cbbb6b457bc391cda660.diff... (2KB)


$ llvm-config --libs --system-libs --ldflags
-L/usr/local/Cellar/llvm/10.0.1_1/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-lLLVMXRay -lLLVMWindowsManifest -lLLVMTableGen -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMOrcJIT -lLLVMOrcError -lLLVMJITLink -lLLVMObjectYAML -lLLVMMCA -lLLVMLTO -lLLVMObjCARCOpts -lLLVMExtensions -lPolly -lPollyISL -lLLVMPasses -lLLVMLineEditor -lLLVMLibDriver -lLLVMInterpreter -lLLVMFuzzMutate -lLLVMFrontendOpenMP -lLLVMMCJIT -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMDWARFLinker -lLLVMDlltoolDriver -lLLVMOption -lLLVMDebugInfoGSYM -lLLVMCoverage -lLLVMCoroutines -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Utils -lLLVMX86Info -lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyDesc -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyInfo -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSparcDisassembler -lLLVMSparcCodeGen -lLLVMSparcAsmParser -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMRISCVDisassembler -lLLVMRISCVCodeGen -lLLVMRISCVAsmParser -lLLVMRISCVDesc -lLLVMRISCVUtils -lLLVMRISCVInfo -lLLVMPowerPCDisassembler -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMMSP430Disassembler -lLLVMMSP430CodeGen -lLLVMMSP430AsmParser -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMLanaiDisassembler -lLLVMLanaiCodeGen -lLLVMLanaiAsmParser -lLLVMLanaiDesc -lLLVMLanaiInfo -lLLVMHexagonDisassembler -lLLVMHexagonCodeGen -lLLVMHexagonAsmParser -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMBPFDisassembler -lLLVMBPFCodeGen -lLLVMBPFAsmParser -lLLVMBPFDesc -lLLVMBPFInfo -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAMDGPUDisassembler -lLLVMAMDGPUCodeGen -lLLVMMIRParser -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMAMDGPUAsmParser -lLLVMAMDGPUDesc -lLLVMAMDGPUUtils -lLLVMAMDGPUInfo -lLLVMAArch64Disassembler -lLLVMMCDisassembler -lLLVMAArch64CodeGen -lLLVMCFGuard -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoDWARF -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMProfileData -lLLVMObject -lLLVMTextAPI -lLLVMBitReader -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMAArch64AsmParser -lLLVMMCParser -lLLVMAArch64Desc -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMBinaryFormat -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMSupport -lLLVMDemangle
-lm -lz -lcurses -lxml2

when I ran brew install --build-from-source Formula/llvm.rb, it show follow errors:

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 128 formulae.
==> New Casks
copytranslator                                                                                                                                    home-assistant
==> Updated Casks
activedock                cytoscape                 jami                      latexdraw                 netnewswire               odrive                    parallels                 react-native-debugger     shift                     vuescan                   wondershare-uniconverter
chromium                  disk-drill                kext-updater              metasploit                netron                    osquery                   postbox                   rotato                    tinymediamanager          webcatalog                wrike

Error: No available formula with the name "Formula/llvm.rb"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.

then I did some random guess, and tried brew reinstall --build-from-source Formula/llvm, it worked

@bcardiff
Copy link
Contributor Author

@jedisct1 having or not brew's libxml2 installed before building from source leads to the same result for me.

@garybernhardt you would need to checkout this repo and from that working directory run the --build-from-source. Formula/llvm.rb will be a valid path there. That's at least how I do it while working on PRs for brew.

@Blaisorblade
Copy link
Contributor

Can this issue be reopened and the update to 10.0.1_1 be reverted?

@hogepodge
Copy link

Building from source works, but isn't a great experience.

@Blaisorblade
Copy link
Contributor

It doesn't even seem that building from source works for all, see a couple of comments up: #61005 (comment)

@bcardiff bcardiff mentioned this pull request Oct 7, 2020
@bcardiff
Copy link
Contributor Author

bcardiff commented Oct 7, 2020

Since I don't know what is different between the working environment and those that don't work, I send #62480 since it's the only actionable from my side right now.

@Blaisorblade
Copy link
Contributor

For those who have rebuilt from source without success: can you report your versions of macOS and XCode / CommandLineTools? Building LLVM asked me to upgrade my CommandLineTools to the ones for XCode 12 (and Apple must have done something wrong, but that worked eventually).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants