mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-15 19:56:59 +08:00
Merge pull request #13914 from carlocab/linux-keg_relocate
linux/keg_relocate: clean up GCC RPATH fix.
This commit is contained in:
commit
cad6f1cdd1
@ -30,16 +30,10 @@ class Keg
|
|||||||
lib_path = "#{new_prefix}/lib"
|
lib_path = "#{new_prefix}/lib"
|
||||||
rpath << lib_path unless rpath.include? lib_path
|
rpath << lib_path unless rpath.include? lib_path
|
||||||
|
|
||||||
# Add GCC's lib directory (as of GCC 12+) to RPATH when there is existing linkage.
|
# Add GCC's lib directory (as of GCC 12+) to RPATH when there is existing versioned linkage.
|
||||||
# This fixes linkage for newly-poured bottles.
|
# This prevents broken linkage when pouring bottles built with an old GCC formula.
|
||||||
if !name.match?(Version.formula_optionally_versioned_regex(:gcc)) &&
|
unless name.match?(Version.formula_optionally_versioned_regex(:gcc))
|
||||||
rpath.any? { |rp| rp.match?(%r{lib/gcc/\d+$}) }
|
rpath.map! { |rp| rp.sub(%r{lib/gcc/\d+$}, "lib/gcc/current") }
|
||||||
# TODO: Replace with
|
|
||||||
# rpath.map! { |path| path = path.sub(%r{lib/gcc/\d+$}, "lib/gcc/current") }
|
|
||||||
# when
|
|
||||||
# 1. Homebrew/homebrew-core#106755 is merged
|
|
||||||
# 2. No formula has a runtime dependency on a versioned GCC (see `envoy.rb`)
|
|
||||||
rpath.prepend HOMEBREW_PREFIX/"opt/gcc/lib/gcc/current"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
rpath.join(":")
|
rpath.join(":")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user