File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ class Rust < Formula
122122 end
123123 end
124124
125+ def llvm
126+ Formula [ "llvm" ]
127+ end
128+
125129 def install
126130 # Ensure that the `openssl` crate picks up the intended library.
127131 # https://docs.rs/openssl/latest/openssl/#manual
@@ -169,7 +173,7 @@ def install
169173 --prefix=#{ prefix }
170174 --sysconfdir=#{ etc }
171175 --tools=#{ tools . join ( "," ) }
172- --llvm-root=#{ Formula [ " llvm" ] . opt_prefix }
176+ --llvm-root=#{ llvm . opt_prefix }
173177 --enable-llvm-link-shared
174178 --enable-profiler
175179 --enable-vendor
@@ -207,6 +211,14 @@ def post_install
207211 MachO . codesign! ( dylib ) if Hardware ::CPU . arm?
208212 chmod 0444 , dylib
209213 end
214+ return unless OS . mac?
215+
216+ # Symlink our LLVM here to make sure the adjacent bin/rust-lld can find it.
217+ # Needs to be done in `postinstall` to avoid having `change_dylib_id` done on it.
218+ lib . glob ( "rustlib/*/lib" ) do |dir |
219+ # Use `ln_sf` instead of `install_symlink` to avoid resolving this into a Cellar path.
220+ ln_sf llvm . opt_lib /shared_library ( "libLLVM" ) , dir
221+ end
210222 end
211223
212224 test do
You can’t perform that action at this time.
0 commit comments