Always pass -headerpad_max_install_names to the linker
We use install_name_tool pretty liberally, so we need to take steps to ensure libraries and executables are always linked with this flag. Closes Homebrew/homebrew#20233. Fixes Homebrew/homebrew#17984. Fixes Homebrew/homebrew#22078.
This commit is contained in:
parent
ebae9ca7bb
commit
84369dd949
@ -191,7 +191,12 @@ class Cmd
|
|||||||
syslibpath
|
syslibpath
|
||||||
end
|
end
|
||||||
def ldflags
|
def ldflags
|
||||||
libpath.to_flags('-L')
|
args = libpath.to_flags('-L')
|
||||||
|
case mode
|
||||||
|
when :ld then args << '-headerpad_max_install_names'
|
||||||
|
when :ccld then args << '-Wl,-headerpad_max_install_names'
|
||||||
|
end
|
||||||
|
args
|
||||||
end
|
end
|
||||||
def cppflags
|
def cppflags
|
||||||
sys, opt = cpath
|
sys, opt = cpath
|
||||||
|
|||||||
@ -55,6 +55,8 @@ module Stdenv
|
|||||||
# Os is the default Apple uses for all its stuff so let's trust them
|
# Os is the default Apple uses for all its stuff so let's trust them
|
||||||
set_cflags "-Os #{SAFE_CFLAGS_FLAGS}"
|
set_cflags "-Os #{SAFE_CFLAGS_FLAGS}"
|
||||||
|
|
||||||
|
append 'LDFLAGS', '-Wl,-headerpad_max_install_names'
|
||||||
|
|
||||||
# set us up for the user's compiler choice
|
# set us up for the user's compiler choice
|
||||||
self.send self.compiler
|
self.send self.compiler
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user