From 9c7f24b84aea4ae1b465afa41445385ada4f2ffb Mon Sep 17 00:00:00 2001 From: Tim D. Smith Date: Wed, 17 Aug 2016 22:55:16 -0700 Subject: Add permit_weak_imports directive Issue Homebrew/homebrew-core#3727 suggested we set -no_weak_imports for new versions of Xcode to ensure that e.g. building on 10.11 against the 10.12 SDK doesn't result in a situation where autotools thinks symbols exist that don't actually exist on the current platform. Further discussion in golang/go#16770 revealed that some packages require weak imports to build normally. --- Library/Homebrew/extend/ENV/shared.rb | 2 ++ Library/Homebrew/extend/os/mac/extend/ENV/std.rb | 4 ++++ Library/Homebrew/extend/os/mac/extend/ENV/super.rb | 4 ++++ 3 files changed, 10 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index c253942ac..c3bd9830a 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -293,6 +293,8 @@ module SharedEnvExtension def permit_arch_flags; end + def permit_weak_imports; end + private def cc=(val) diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb index d9cabc50e..21c375a76 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb @@ -146,4 +146,8 @@ module Stdenv append "CFLAGS", "-I#{MacOS::X11.include}" unless MacOS::CLT.installed? end + + def permit_weak_imports + remove "LDFLAGS", "-Wl,-no_weak_imports" + end end diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index e482020e8..188008b1f 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -107,6 +107,10 @@ module Superenv ENV.x11 = MacOS::X11.installed? end + def permit_weak_imports + remove "HOMEBREW_CCCFG", "w" + end + # These methods are no longer necessary under superenv, but are needed to # maintain an interface compatible with stdenv. alias_method :macosxsdk, :noop -- cgit v1.2.3