Merge pull request #11459 from danielnachun/gcc_fix
super: fix GCC linkage issue in Linux
This commit is contained in:
commit
273b06c822
@ -199,10 +199,23 @@ module Superenv
|
|||||||
|
|
||||||
sig { returns(T.nilable(PATH)) }
|
sig { returns(T.nilable(PATH)) }
|
||||||
def determine_library_paths
|
def determine_library_paths
|
||||||
paths = [
|
paths = []
|
||||||
keg_only_deps.map(&:opt_lib),
|
if compiler.match?(GNU_GCC_REGEXP)
|
||||||
HOMEBREW_PREFIX/"lib",
|
# Add path to GCC runtime libs for version being used to compile,
|
||||||
]
|
# so that the linker will find those libs before any that may be linked in $HOMEBREW_PREFIX/lib.
|
||||||
|
# https://github.com/Homebrew/brew/pull/11459#issuecomment-851075936
|
||||||
|
begin
|
||||||
|
f = gcc_version_formula(compiler.to_s)
|
||||||
|
rescue FormulaUnavailableError
|
||||||
|
nil
|
||||||
|
else
|
||||||
|
paths << f.opt_lib/"gcc"/f.version.major if f.any_version_installed?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
paths << keg_only_deps.map(&:opt_lib)
|
||||||
|
paths << HOMEBREW_PREFIX/"lib"
|
||||||
|
|
||||||
paths += homebrew_extra_library_paths
|
paths += homebrew_extra_library_paths
|
||||||
PATH.new(paths).existing
|
PATH.new(paths).existing
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user