diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb index 2d42c97b9c652..75ccb956fd408 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/shared.rb @@ -7,8 +7,10 @@ def effective_arch @bottle_arch.to_sym elsif @build_bottle Hardware.oldest_cpu - else + elsif Hardware::CPU.intel? || Hardware::CPU.arm? :native + else + :none end end end diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index d970ced6f2379..138b5e118fe20 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -27,6 +27,7 @@ class << self sig { returns(T::Hash[Symbol, String]) } def optimization_flags @optimization_flags ||= T.let({ + none: "", native: arch_flag("native"), ivybridge: "-march=ivybridge", sandybridge: "-march=sandybridge",