Skip to content
Snippets Groups Projects
Commit 31052a92 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #782 from MikeMcQuaid/weak-imports-opt-in

Make -no_weak_imports opt-in.
parents 67fef712 602fb0e5
No related branches found
No related tags found
No related merge requests found
......@@ -79,11 +79,6 @@ class Build
ENV.activate_extensions!
# Go makes extensive use of weak imports.
if formula_deps.any? { |f| f.name == "go" }
ENV.permit_weak_imports
end
if superenv?
ENV.keg_only_deps = keg_only_deps
ENV.deps = formula_deps
......
......@@ -293,6 +293,7 @@ module SharedEnvExtension
def permit_arch_flags; end
# A no-op until we enable this by default again (which we may never do).
def permit_weak_imports; end
private
......
module SharedEnvExtension
def no_weak_imports?
def no_weak_import_support?
return false unless compiler == :clang
if MacOS::Xcode.version && MacOS::Xcode.version < "8.0"
......
......@@ -28,11 +28,6 @@ module Stdenv
# depend on it already being installed to build itself.
ld64 if Formula["ld64"].installed?
end
# Xcode 8 should be told to fail to link against weak links
# Issue from Apple engineer:
# https://github.com/Homebrew/homebrew-core/issues/3727
append "LDFLAGS", "-Wl,-no_weak_imports" if no_weak_imports?
end
def homebrew_extra_pkg_config_paths
......@@ -147,7 +142,7 @@ module Stdenv
append "CFLAGS", "-I#{MacOS::X11.include}" unless MacOS::CLT.installed?
end
def permit_weak_imports
remove "LDFLAGS", "-Wl,-no_weak_imports"
def no_weak_imports
append "LDFLAGS", "-Wl,-no_weak_imports"
end
end
......@@ -81,10 +81,6 @@ module Superenv
s << "s" if MacOS.version >= :mountain_lion
# Fix issue with >= 10.8 apr-1-config having broken paths
s << "a" if MacOS.version >= :mountain_lion
# Xcode 8 should be told to fail to link against weak links
# Issue from Apple engineer:
# https://github.com/Homebrew/homebrew-core/issues/3727
s << "w" if no_weak_imports?
s
end
......@@ -107,8 +103,8 @@ module Superenv
ENV.x11 = MacOS::X11.installed?
end
def permit_weak_imports
remove "HOMEBREW_CCCFG", "w"
def no_weak_imports
add "HOMEBREW_CCCFG", "w"
end
# These methods are no longer necessary under superenv, but are needed to
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment