Skip to content

Commit

Permalink
Merge pull request #16392 from Bo98/westmere
Browse files Browse the repository at this point in the history
os/mac/hardware: use Westmere on >= Ventura
  • Loading branch information
Bo98 authored Dec 23, 2023
2 parents 3798cac + fba5a87 commit 338d626
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Library/Homebrew/extend/os/mac/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ def self.oldest_cpu(version = nil)
end
if CPU.arch == :arm64
:arm_vortex_tempest
# This cannot use a newer CPU e.g. ivybridge because Rosetta 2 does not
# This cannot use a newer CPU e.g. haswell because Rosetta 2 does not
# support AVX instructions in bottles:
# https://github.com/Homebrew/homebrew-core/issues/67713
elsif version >= :ventura
:westmere
elsif version >= :mojave
:nehalem
else
Expand Down
5 changes: 3 additions & 2 deletions Library/Homebrew/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ def optimization_flags
native: arch_flag("native"),
ivybridge: "-march=ivybridge",
sandybridge: "-march=sandybridge",
westmere: "-march=westmere",
nehalem: "-march=nehalem",
core2: "-march=core2",
core: "-march=prescott",
arm_vortex_tempest: "",
arm_vortex_tempest: "", # TODO: -mcpu=apple-m1 when we've patched all our GCCs to support it
armv6: "-march=armv6",
armv8: "-march=armv8-a",
ppc64: "-mcpu=powerpc64",
Expand Down Expand Up @@ -225,7 +226,7 @@ def rustflags_target_cpu
@target_cpu ||= case (cpu = oldest_cpu)
when :core
:prescott
when :native, :ivybridge, :sandybridge, :nehalem, :core2
when :native, :ivybridge, :sandybridge, :westmere, :nehalem, :core2
cpu
end
return if @target_cpu.blank?
Expand Down

0 comments on commit 338d626

Please sign in to comment.