aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/extend/ENV/std.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb
index 381549744..b6ca357b0 100644
--- a/Library/Homebrew/extend/ENV/std.rb
+++ b/Library/Homebrew/extend/ENV/std.rb
@@ -301,17 +301,19 @@ module Stdenv
remove flags, %r{-mssse3}
remove flags, %r{-msse4(\.\d)?}
append flags, xarch unless xarch.empty?
+ append flags, map.fetch(effective_arch, default)
+ end
+ def effective_arch
if ARGV.build_bottle?
- arch = ARGV.bottle_arch || Hardware.oldest_cpu
- append flags, Hardware::CPU.optimization_flags.fetch(arch)
+ ARGV.bottle_arch || Hardware.oldest_cpu
elsif Hardware::CPU.intel? && !Hardware::CPU.sse4?
# If the CPU doesn't support SSE4, we cannot trust -march=native or
# -march=<cpu family> to do the right thing because we might be running
# in a VM or on a Hackintosh.
- append flags, Hardware::CPU.optimization_flags.fetch(Hardware.oldest_cpu)
+ Hardware.oldest_cpu
else
- append flags, map.fetch(Hardware::CPU.family, default)
+ Hardware::CPU.family
end
end