New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openssh: inreplace to apply workaround to Apple clang 14.0.3 #135373
Conversation
# Also can segfault at runtime: https://github.com/Homebrew/homebrew-core/issues/135200 | ||
if Hardware::CPU.intel? && DevelopmentTools.clang_build_version == 1403 | ||
inreplace "configure", "-fzero-call-used-regs=all", "-fzero-call-used-regs=used" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corresponding configure.ac
:
# clang 15 seems to have a bug in -fzero-call-used-regs=all. See
# https://bugzilla.mindrot.org/show_bug.cgi?id=3475 and
# https://github.com/llvm/llvm-project/issues/59242
case "$CLANG_VER" in
15.*) OSSH_CHECK_CFLAG_COMPILE([-fzero-call-used-regs=used]) ;;
*) OSSH_CHECK_CFLAG_COMPILE([-fzero-call-used-regs=all]) ;;
esac
Apple clang 14.0.3 is based on LLVM 15. Upstream fix would require changing configure.ac
logic to detect this particular version. Just using simple inreplace for now and maybe we can add details to existing upstream bug.
Haven't checked if root cause of every reported OpenSSH issue, but worked for me locally to fix segfault issue.
Corresponding LLVM bug fix https://reviews.llvm.org/D139679 went in 15.0.7. Looks like it was zeroing out some registers which could lead to original ssh-keygen
issue (i.e. argc/argv getting zeroed) and the segfault issue where some variables were NULL.
I know that right now this is just in testing, but please bump I've had a couple times recently where I've hit problems in homebrew only to find that the underlying bug has been fixed and re-bottled so I needed to manually |
Sounds like llvm/llvm-project#57692 so this is looking like the correct fix. |
🤖 An automated task has requested bottles to be published to this PR. |
🤖 An automated task has requested bottles to be published to this PR. |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?