Conversation
On the 32-bit MSYS2 runtime (3.3.x), the Cygwin C library exports
arc4random_stir() as a symbol in its import library (libmsys-2.0.a),
but the corresponding header (stdlib.h) does not declare it. Only
arc4random(), arc4random_buf(), and arc4random_uniform() are declared.
OpenSSH's configure script uses AC_CHECK_FUNCS to probe for
arc4random_stir. That macro provides its own prototype ("char
arc4random_stir();") for the link test, so the test succeeds on 32-bit.
Configure then defines HAVE_ARC4RANDOM_STIR, which suppresses the
no-op fallback macro in openbsd-compat/openbsd-compat.h and defines.h.
When entropy.c is later compiled, the call to arc4random_stir() at line
120 has no visible declaration, and GCC 15's
-Wimplicit-function-declaration (now an error by default) aborts the
build.
The 64-bit runtime (3.6.x) does not have this problem: its import
library was cleaned up to match the headers, dropping arc4random_stir
and arc4random_addrandom. So the configure link test fails on 64-bit,
HAVE_ARC4RANDOM_STIR stays undefined, and the no-op macro
("#define arc4random_stir()") activates correctly.
Work around this on i686 by passing ac_cv_func_arc4random_stir=no to
configure, which forces the same no-op macro path that the 64-bit build
takes naturally. The OpenSSH source itself documents arc4random_stir()
as a "noop on recent arc4random() implementations", so skipping the
actual call is the intended behavior.
Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes git-for-windows/git#6152