Skip to content

Commit

Permalink
Merge pull request #18759 from alebcay/restrict-native-optflags
Browse files Browse the repository at this point in the history
shared: only fall back to -march=native on supported architectures
  • Loading branch information
MikeMcQuaid authored Nov 13, 2024
2 parents 69fd4a6 + a70d15c commit 5a2c264
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Library/Homebrew/extend/os/linux/extend/ENV/shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions Library/Homebrew/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 5a2c264

Please sign in to comment.