aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/super.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb
index db2a1bf2d..cbfd3dd8c 100644
--- a/Library/Homebrew/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/ENV/super.rb
@@ -262,6 +262,14 @@ module Superenv
def universal_binary
self['HOMEBREW_ARCHFLAGS'] = Hardware::CPU.universal_archs.as_arch_flags
append 'HOMEBREW_CCCFG', "u", ''
+
+ # GCC doesn't accept "-march" for a 32-bit CPU with "-arch x86_64"
+ if compiler != :clang && Hardware.is_32_bit?
+ self['HOMEBREW_OPTFLAGS'] = self['HOMEBREW_OPTFLAGS'].sub(
+ /-march=\S*/,
+ "-Xarch_#{Hardware::CPU.arch_32_bit} \\0"
+ )
+ end
end
def cxx11