From d877fc0b3efcf9a9df9d1532e69ae46b1ad35fbd Mon Sep 17 00:00:00 2001 From: Alex Wang Date: Thu, 24 Sep 2015 18:43:49 -0400 Subject: 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 --- Library/ENV/4.3/cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Library/ENV') 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(.+)?/ -- cgit v1.2.3