Merge pull request #5505 from sjackman/march-native-linux

Use -march=native for non-bottle source builds [Linux]
This commit is contained in:
Mike McQuaid 2019-01-08 19:10:48 +00:00 committed by GitHub
commit e0342ac7cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -1 +1,5 @@
require "extend/os/mac/extend/ENV/shared" if OS.mac? if OS.mac?
require "extend/os/mac/extend/ENV/shared"
elsif OS.linux?
require "extend/os/linux/extend/ENV/shared"
end

View File

@ -0,0 +1,10 @@
module SharedEnvExtension
# @private
def effective_arch
if ARGV.build_bottle?
ARGV.bottle_arch || Hardware.oldest_cpu
else
:native
end
end
end

View File

@ -7,6 +7,7 @@ module Hardware
class << self class << self
OPTIMIZATION_FLAGS = { OPTIMIZATION_FLAGS = {
native: "-march=native",
nehalem: "-march=nehalem", nehalem: "-march=nehalem",
penryn: "-march=penryn", penryn: "-march=penryn",
core2: "-march=core2", core2: "-march=core2",