determine_optflags: Default is -march=native
This commit is contained in:
parent
ad7323bd61
commit
4addff3b2b
@ -7,7 +7,7 @@ module Stdenv
|
|||||||
|
|
||||||
# @private
|
# @private
|
||||||
SAFE_CFLAGS_FLAGS = "-w -pipe".freeze
|
SAFE_CFLAGS_FLAGS = "-w -pipe".freeze
|
||||||
DEFAULT_FLAGS = "-march=core2 -msse4".freeze
|
DEFAULT_FLAGS = "-march=native".freeze
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
def setup_build_environment(formula = nil)
|
def setup_build_environment(formula = nil)
|
||||||
@ -108,7 +108,7 @@ module Stdenv
|
|||||||
|
|
||||||
def gcc_4_2
|
def gcc_4_2
|
||||||
super
|
super
|
||||||
set_cpu_cflags
|
set_cpu_cflags "-march=core2 -msse4"
|
||||||
end
|
end
|
||||||
|
|
||||||
GNU_GCC_VERSIONS.each do |n|
|
GNU_GCC_VERSIONS.each do |n|
|
||||||
@ -124,7 +124,7 @@ module Stdenv
|
|||||||
# Clang mistakenly enables AES-NI on plain Nehalem
|
# Clang mistakenly enables AES-NI on plain Nehalem
|
||||||
map = Hardware::CPU.optimization_flags
|
map = Hardware::CPU.optimization_flags
|
||||||
map = map.merge(nehalem: "-march=native -Xclang -target-feature -Xclang -aes")
|
map = map.merge(nehalem: "-march=native -Xclang -target-feature -Xclang -aes")
|
||||||
set_cpu_cflags "-march=native", map
|
set_cpu_cflags DEFAULT_FLAGS, map
|
||||||
end
|
end
|
||||||
|
|
||||||
def minimal_optimization
|
def minimal_optimization
|
||||||
|
|||||||
@ -235,7 +235,7 @@ module Superenv
|
|||||||
Hardware::CPU.optimization_flags.fetch(arch)
|
Hardware::CPU.optimization_flags.fetch(arch)
|
||||||
elsif Hardware::CPU.intel? && !Hardware::CPU.sse4?
|
elsif Hardware::CPU.intel? && !Hardware::CPU.sse4?
|
||||||
Hardware::CPU.optimization_flags.fetch(Hardware.oldest_cpu)
|
Hardware::CPU.optimization_flags.fetch(Hardware.oldest_cpu)
|
||||||
elsif compiler == :clang
|
elsif ![:gcc_4_0, :gcc_4_2].include?(compiler)
|
||||||
"-march=native"
|
"-march=native"
|
||||||
# This is mutated elsewhere, so return an empty string in this case
|
# This is mutated elsewhere, so return an empty string in this case
|
||||||
else
|
else
|
||||||
|
|||||||
@ -11,7 +11,6 @@ module Hardware
|
|||||||
core: "-march=prescott",
|
core: "-march=prescott",
|
||||||
armv6: "-march=armv6",
|
armv6: "-march=armv6",
|
||||||
armv8: "-march=armv8-a",
|
armv8: "-march=armv8-a",
|
||||||
dunno: "-march=native",
|
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
def optimization_flags
|
def optimization_flags
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user