diff options
| author | Alex Wang | 2015-09-24 18:43:49 -0400 |
|---|---|---|
| committer | Mike McQuaid | 2015-10-13 13:09:05 +0100 |
| commit | d877fc0b3efcf9a9df9d1532e69ae46b1ad35fbd (patch) | |
| tree | 03a120524c3b50287aea73582036b273c4e58cd0 | |
| parent | ed42b2eb39bd8fc0b3b3a4220905a07713f22203 (diff) | |
| download | brew-d877fc0b3efcf9a9df9d1532e69ae46b1ad35fbd.tar.bz2 | |
superenv: only strip sysroot flags for OS X SDKs.
Removing all sysroot flags is ok until a non-OS X SDK is needed. In
that case, builds can fail due to the non-OS X SDK being overwritten or
overridden by the OS X SDK.
Sysroot flags are now only stripped if they are an OS X SDK. This is
reliant on only OS X SDKs containing the string "macosx", so this will
break if if the wrong SDK shows up. However, the chances of that
happening seem low, as Apple probably doesn't want to introduce
something OS X that doesn't work with OS X, so it should be robust for
the near future.
This could break in an environment without the command line tools. The
fix for that is a bit more involved, though, so that will have to go
later.
Closes Homebrew/homebrew#44312.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
| -rwxr-xr-x | Library/ENV/4.3/cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/ENV/4.3/cc b/Library/ENV/4.3/cc index 1fb6d8207..91707eea9 100755 --- a/Library/ENV/4.3/cc +++ b/Library/ENV/4.3/cc @@ -160,8 +160,9 @@ class Cmd when "-undefineddynamic_lookup" args << "-Wl,-undefined,dynamic_lookup" when /^-isysroot/, /^--sysroot/ - # We set the sysroot - enum.next + sdk = enum.next + # We set the sysroot for OS X SDKs + args << "-isysroot" << sdk unless sdk.downcase.include? "osx" when "-dylib" args << "-Wl,#{arg}" when /^-I(.+)?/ |
