Skip to content

Commit

Permalink
Merge pull request #7334 from Bo98/std-nehalem
Browse files Browse the repository at this point in the history
ENV/std: conditionally apply AES-NI workaround
  • Loading branch information
MikeMcQuaid committed Apr 13, 2020
2 parents 9b8762f + df47668 commit c5c161a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Library/Homebrew/extend/ENV/std.rb
Expand Up @@ -112,9 +112,11 @@ def determine_cxx
def clang
super
replace_in_cflags(/-Xarch_#{Hardware::CPU.arch_32_bit} (-march=\S*)/, '\1')
# Clang mistakenly enables AES-NI on plain Nehalem
map = Hardware::CPU.optimization_flags
.merge(nehalem: "-march=nehalem -Xclang -target-feature -Xclang -aes")
if DevelopmentTools.clang_build_version < 700
# Clang mistakenly enables AES-NI on plain Nehalem
map[:nehalem] = "-march=nehalem -Xclang -target-feature -Xclang -aes"
end
set_cpu_cflags map
end

Expand Down

0 comments on commit c5c161a

Please sign in to comment.