diff --git a/Library/Homebrew/shims/super/cc b/Library/Homebrew/shims/super/cc index 74c3384406..5fa4876563 100755 --- a/Library/Homebrew/shims/super/cc +++ b/Library/Homebrew/shims/super/cc @@ -310,6 +310,7 @@ class Cmd args << "-#{ENV["HOMEBREW_OPTIMIZATION_LEVEL"]}" optflags.each do |optflag| flag = optflag.split("=").first + # For runtime CPU detection builds, pass our optimisation flag whenever the build hasn't provided its own. args << optflag if !runtime_cpu_detection? || @args.none? { |arg| arg.start_with?(flag) } end args.concat(archflags)