Starting with the Apple Clang shipped with Xcode 12, Apple has enabled -Werror=implicit-function-declaration by default:
Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on). This additional error detection unifies Clang’s behavior for iOS/tvOS and macOS 64-bit targets for this diagnostic. (49917738)
This causes bdbs mutex detection to fail when building on macOS (not cross-compiling):
0checking for mutexes... UNIX/fcntl
1configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM.
2configure: error: Unable to find a mutex implementation
as previously emitted warnings are being turned into errors. i.e:
0configure:18704: checking for mutexes
1configure:18815: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -mmacosx-version-min=10.12 --sysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o conftest -pipe -O2 -I/Users/michael/github/fanquake-bitcoin/depends/x86_64-apple-darwin19.6.0/include -L/Users/michael/github/fanquake-bitcoin/depends/x86_64-apple-darwin19.6.0/lib conftest.c -lpthread >&5
2conftest.c:46:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
3main() {
4^
5conftest.c:51:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration]
6 exit (
7 ^
8conftest.c:51:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
91 warning and 1 error generated.
Append -Wno-error=implicit-function-declaration
to cflags
so that -Wimplicit-function-declaration
returns to being a warning, and the configure checks succeed.
Fixes #19411.