Pull effective arch detection into a method
This commit is contained in:
parent
f0b75b2869
commit
e0f86a1a86
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user