Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Puts build-tool args first
Browse files Browse the repository at this point in the history
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 #14781.
  • Loading branch information
mxcl authored and Dennis Luxen committed Sep 17, 2012
1 parent bdd4260 commit 640b176
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Library/ENV/4.3/cc
Expand Up @@ -64,24 +64,24 @@ class Cmd
refurbished_args
end
if tool != 'ld'
args.unshift("--sysroot=#$sdkroot")
args << "--sysroot=#$sdkroot"
else
args.unshift($sdkroot).unshift("-syslibroot")
args << "-syslibroot" << $sdkroot
end if nclt?
case mode
when :cpp
%w{-E} + cppflags + args
%w{-E} + args + cppflags
when :ld
ldflags + args
when :cc
cflags + cppflags + args
cflags + args + cppflags
when :ccld
cflags + cppflags + ldflags + args
cflags + args + cppflags + ldflags
end.compact
end
def refurbished_args
lset = Set.new(syslibpath)
iset = Set.new(syscpath)
lset = Set.new(libpath + syslibpath)
iset = Set.new(cpath.flatten)

args = []
whittler = @args.each
Expand Down

0 comments on commit 640b176

Please sign in to comment.