-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 llvm-config #76646
llvm: fix llvm-config #76646
Conversation
@Bo98 reasonable bandaid until your LLVM patch? Or we could just wait for your patch too, I guess. |
This was suggested before and rejected. Though that was a couple years ago.
I'm still on the fence whether I want to apply it to LLVM 12 or just let it roll into LLVM 13. Any slight touch to LLVM dylibs usually upsets some downstream project, but doing so on major versions is usually seen as acceptable. |
Was the reasoning that this is something that should be fixed upstream? I agree. But, as you point out, it's been years.
Have you upstreamed your patch? |
I will be in a couple days. I've sent an email to first clarify the ABI status of |
Thoughts on this, @Homebrew/core? A similar fix was proposed (and rejected) in #47146. However, the current circumstances are slightly different:
I'm inclined to say these outweigh the objection at #47146, but I'd like some extra opinions on this. |
What is the status of the LLVM patch? I see a 2019 bug report with no action (https://bugs.llvm.org/show_bug.cgi?id=40252) but is there an actual patch that has been accepted? Rejected? Ignored? |
Formula/llvm.rb
Outdated
@@ -141,6 +142,13 @@ def install | |||
system "cmake", "--build", ".", "--target", "install-xcode-toolchain" if MacOS::Xcode.installed? | |||
end | |||
|
|||
on_macos do | |||
if build.stable? && !(lib/"libLLVM-#{version.major}.dylib").exist? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does/doesn't this exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last time I built from HEAD it installed a libLLVM-13git
library, so I assume it exists in HEAD builds. Verifying this now is difficult because building from HEAD seems to fail at the moment, plus it takes ages.
I'm not aware of any circumstances for it to exist in a stable build. I just put it there because it was going to be wrapped in a conditional anyway (build.stable?
), so may as well add an extra guard to avoid overwriting this library if/when this bug does get fixed.
We can drop the existence check if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, dropping existence check makes sense to me 👍🏻. Lets make this error out if it ever starts to exist so we know to remove this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also, added a test to help us more quickly detect breakage from this.
Would also like to know this. |
I never did anything in 2019 because I could never decide whether the problem was in the After a year and a half experience in maintaining the LLVM formula, including overseeing a couple major updates, I've identified that the lack of proper ABI versioning in LLVM shared libraries is problematic. Therefore the problem to me is indeed the lack of a Beyond some I created this provisional patch which I'm going to propose upstream this weekend to see what their thoughts are. We'll see if there is disagreements but to me this seems like the logical approach. One thing I've been trying to clarify first is the unique nature of |
(This diverges a bit from |
`llvm-config` relies on a versioned `libLLVM` (e.g. `libLLVM-12`), but their build system does not install one for some reason. With the symlink: ❯ llvm-config --libs -lLLVM-12 Without: ❯ llvm-config --libs -lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver ... -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTableGen -lLLVMSupport -lLLVMDemangle This deviates from the intended behaviour, as seen on Linux, where `llvm-config --libs` returns the output shown above with the symlink. Attempting to link against the libraries shown by `llvm-config` without this fix is also leads to build failures due to missing symbols. This will also allow Julia to use brewed `llvm` instead of a vendored one. (Homebrew#76527) Closes Homebrew#76798.
Any outstanding questions/objections here? @MikeMcQuaid @fxcoudert |
🤖 A scheduled task has triggered a merge. |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?llvm-config
relies on a versionedlibLLVM
(e.g.libLLVM-12
), buttheir build system does not install one for some reason.
With the symlink:
Without:
This deviates from the intended behaviour, as seen on Linux, where
llvm-config --libs
returns the output shown above with the symlink.Attempting to link against the libraries shown by
llvm-config
withoutthis fix is also leads to build failures due to missing symbols.
This will also allow Julia to use brewed
llvm
instead of a vendoredone. (#76527)