Puts build-tool args first
build-tool provided args must be considered first by cc, etc. Generally this already occurred for -I flags, because most of our -I flags were -isystem. However it didn't occur for keg-only flags and -L paths. This was an error. I amended the refurbishment code to ensure any paths we want to control the order of are thoroughly scrubbed out of the build-tool provided args. This ensures reliability for our builds. However this path-scrubbing should always occur, even during configure (I am fairly sure of this). So more work is required. Fixes Homebrew/homebrew#14781.
This commit is contained in:
parent
da1905f216
commit
4bf72a3e62
@ -64,24 +64,24 @@ class Cmd
|
|||||||
refurbished_args
|
refurbished_args
|
||||||
end
|
end
|
||||||
if tool != 'ld'
|
if tool != 'ld'
|
||||||
args.unshift("--sysroot=#$sdkroot")
|
args << "--sysroot=#$sdkroot"
|
||||||
else
|
else
|
||||||
args.unshift($sdkroot).unshift("-syslibroot")
|
args << "-syslibroot" << $sdkroot
|
||||||
end if nclt?
|
end if nclt?
|
||||||
case mode
|
case mode
|
||||||
when :cpp
|
when :cpp
|
||||||
%w{-E} + cppflags + args
|
%w{-E} + args + cppflags
|
||||||
when :ld
|
when :ld
|
||||||
ldflags + args
|
ldflags + args
|
||||||
when :cc
|
when :cc
|
||||||
cflags + cppflags + args
|
cflags + args + cppflags
|
||||||
when :ccld
|
when :ccld
|
||||||
cflags + cppflags + ldflags + args
|
cflags + args + cppflags + ldflags
|
||||||
end.compact
|
end.compact
|
||||||
end
|
end
|
||||||
def refurbished_args
|
def refurbished_args
|
||||||
lset = Set.new(syslibpath)
|
lset = Set.new(libpath + syslibpath)
|
||||||
iset = Set.new(syscpath)
|
iset = Set.new(cpath.flatten)
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
whittler = @args.each
|
whittler = @args.each
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user