diff options
| author | Jack Nagel | 2014-04-29 00:09:07 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-29 00:09:07 -0500 |
| commit | 90008dd038a4c373a29b26641798c0e33991ad25 (patch) | |
| tree | 0197fad195a5403dfa82f39eed669d9219f5b722 /Library/Homebrew/extend | |
| parent | b9c22daa742fe92d58ab2f292b57d0b77421be7b (diff) | |
| download | homebrew-90008dd038a4c373a29b26641798c0e33991ad25.tar.bz2 | |
Make ENV.O4 a no-op
On older Apple compilers "-O4" is known to cause build errors. On recent
clang, it's the same as "-O3" and you have to pass "-O3 -flto" to get
the old behavior.
Diffstat (limited to 'Library/Homebrew/extend')
| -rw-r--r-- | Library/Homebrew/extend/ENV/std.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ENV/super.rb | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index bbf5d3b03..0b9352a43 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -103,9 +103,9 @@ module Stdenv alias_method :j1, :deparallelize # These methods are no-ops for compatibility. - %w{fast Og}.each { |opt| define_method(opt) {} } + %w{fast O4 Og}.each { |opt| define_method(opt) {} } - %w{O4 O3 O2 O1 O0 Os}.each do |opt| + %w{O3 O2 O1 O0 Os}.each do |opt| define_method opt do remove_from_cflags(/-O./) append_to_cflags "-#{opt}" @@ -116,7 +116,6 @@ module Stdenv # we don't use locate because gcc 4.0 has not been provided since Xcode 4 self.cc = "#{MacOS.dev_tools_path}/gcc-4.0" self.cxx = "#{MacOS.dev_tools_path}/g++-4.0" - replace_in_cflags '-O4', '-O3' set_cpu_cflags '-march=nocona -mssse3' @compiler = :gcc_4_0 end @@ -130,7 +129,6 @@ module Stdenv self.cc = MacOS.locate("gcc-4.2") self.cxx = MacOS.locate("g++-4.2") - replace_in_cflags '-O4', '-O3' set_cpu_cflags @compiler = :gcc end @@ -276,7 +274,6 @@ module Stdenv def universal_binary append_to_cflags Hardware::CPU.universal_archs.as_arch_flags - replace_in_cflags '-O4', '-O3' # O4 seems to cause the build to fail append 'LDFLAGS', Hardware::CPU.universal_archs.as_arch_flags if compiler != :clang && Hardware.is_32_bit? diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index 138741757..a0efec453 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -294,7 +294,7 @@ module Superenv append 'HOMEBREW_CCCFG', "3", '' end - %w{O4 O3 O2 O1 O0 Os}.each do |opt| + %w{O3 O2 O1 O0 Os}.each do |opt| define_method opt do self['HOMEBREW_OPTIMIZATION_LEVEL'] = opt end @@ -305,7 +305,7 @@ module Superenv # These methods are no longer necessary under superenv, but are needed to # maintain an interface compatible with stdenv. - noops.concat %w{fast Og libxml2 x11 set_cpu_flags macosxsdk remove_macosxsdk} + noops.concat %w{fast O4 Og libxml2 x11 set_cpu_flags macosxsdk remove_macosxsdk} # These methods provide functionality that has not yet been ported to # superenv. |
