From fba5a874fc981c425cc89f186ffed3aa61837c16 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Sat, 23 Dec 2023 04:02:41 +0000 Subject: [PATCH] os/mac/hardware: use Westmere on >= Ventura --- Library/Homebrew/extend/os/mac/hardware.rb | 4 +++- Library/Homebrew/hardware.rb | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/extend/os/mac/hardware.rb b/Library/Homebrew/extend/os/mac/hardware.rb index 8015835b8a596..d984567c6945a 100644 --- a/Library/Homebrew/extend/os/mac/hardware.rb +++ b/Library/Homebrew/extend/os/mac/hardware.rb @@ -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 diff --git a/Library/Homebrew/hardware.rb b/Library/Homebrew/hardware.rb index ed4034c48ad43..182d8e0077dbf 100644 --- a/Library/Homebrew/hardware.rb +++ b/Library/Homebrew/hardware.rb @@ -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", @@ -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?