Merge pull request #17950 from Homebrew/ld_classic
This commit is contained in:
commit
4e95bad9c4
@ -104,11 +104,13 @@ module Superenv
|
|||||||
# K - Don't strip -arch <arch>, -m32, or -m64
|
# K - Don't strip -arch <arch>, -m32, or -m64
|
||||||
# d - Don't strip -march=<target>. Use only in formulae that
|
# d - Don't strip -march=<target>. Use only in formulae that
|
||||||
# have runtime detection of CPU features.
|
# have runtime detection of CPU features.
|
||||||
# w - Pass -no_weak_imports to the linker
|
|
||||||
# D - Generate debugging information
|
# D - Generate debugging information
|
||||||
|
# w - Pass `-no_weak_imports` to the linker
|
||||||
# f - Pass `-no_fixup_chains` to `ld` whenever it
|
# f - Pass `-no_fixup_chains` to `ld` whenever it
|
||||||
# is invoked with `-undefined dynamic_lookup`
|
# is invoked with `-undefined dynamic_lookup`
|
||||||
# o - Pass `-oso_prefix` to `ld` whenever it is invoked
|
# o - Pass `-oso_prefix` to `ld` whenever it is invoked
|
||||||
|
# c - Pass `-ld_classic` to `ld` whenever it is invoked
|
||||||
|
# with `-dead_strip_dylibs`
|
||||||
#
|
#
|
||||||
# These flags will also be present:
|
# These flags will also be present:
|
||||||
# a - apply fix for apr-1-config path
|
# a - apply fix for apr-1-config path
|
||||||
|
@ -143,6 +143,10 @@ module Superenv
|
|||||||
|
|
||||||
# Strip build prefixes from linker where supported, for deterministic builds.
|
# Strip build prefixes from linker where supported, for deterministic builds.
|
||||||
append_to_cccfg "o" if DevelopmentTools.ld64_version >= 512
|
append_to_cccfg "o" if DevelopmentTools.ld64_version >= 512
|
||||||
|
|
||||||
|
# Pass `-ld_classic` whenever the linker is invoked with `-dead_strip_dylibs`
|
||||||
|
# on `ld` versions that don't properly handle that option.
|
||||||
|
append_to_cccfg "c" if DevelopmentTools.ld64_version >= "1015.7" && DevelopmentTools.ld64_version <= "1022.1"
|
||||||
end
|
end
|
||||||
|
|
||||||
def no_weak_imports
|
def no_weak_imports
|
||||||
|
@ -324,11 +324,13 @@ class Cmd
|
|||||||
args << "-no_weak_imports" if no_weak_imports?
|
args << "-no_weak_imports" if no_weak_imports?
|
||||||
args << "-no_fixup_chains" if no_fixup_chains?
|
args << "-no_fixup_chains" if no_fixup_chains?
|
||||||
args << "-oso_prefix" << formula_buildpath if oso_prefix? && formula_buildpath
|
args << "-oso_prefix" << formula_buildpath if oso_prefix? && formula_buildpath
|
||||||
|
args << "-ld_classic" if ld_classic?
|
||||||
when :ccld, :cxxld
|
when :ccld, :cxxld
|
||||||
args << "-Wl,-headerpad_max_install_names"
|
args << "-Wl,-headerpad_max_install_names"
|
||||||
args << "-Wl,-no_weak_imports" if no_weak_imports?
|
args << "-Wl,-no_weak_imports" if no_weak_imports?
|
||||||
args << "-Wl,-no_fixup_chains" if no_fixup_chains?
|
args << "-Wl,-no_fixup_chains" if no_fixup_chains?
|
||||||
args << "-Wl,-oso_prefix,#{formula_buildpath}" if oso_prefix? && formula_buildpath
|
args << "-Wl,-oso_prefix,#{formula_buildpath}" if oso_prefix? && formula_buildpath
|
||||||
|
args << "-Wl,-ld_classic" if ld_classic?
|
||||||
end
|
end
|
||||||
args
|
args
|
||||||
end
|
end
|
||||||
@ -441,6 +443,10 @@ class Cmd
|
|||||||
config.include?("o") && !configure?
|
config.include?("o") && !configure?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ld_classic?
|
||||||
|
config.include?("c") && calls_ld? && @args.any? { |arg| arg.match?(/^(-Wl,)?-dead_strip_dylibs$/) }
|
||||||
|
end
|
||||||
|
|
||||||
def calls_ld?
|
def calls_ld?
|
||||||
return true if mode == :ld
|
return true if mode == :ld
|
||||||
return false unless [:ccld, :cxxld].include?(mode)
|
return false unless [:ccld, :cxxld].include?(mode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user