build: fix mutex detection when building bdb on macOS#20195
build: fix mutex detection when building bdb on macOS#20195laanwj merged 1 commit intobitcoin:masterfrom
Conversation
|
environment:"macos big sur beta 11.0" & "Command_Line_Tools_for_Xcode_12.2_beta_3" |
|
tACK. Tested depends build on: @awesome-doge you are running the contrib script, which has not been fixed (rather than building depends, which this fix addresses). @fanquake do we want to add an |
|
environment:"macos big sur beta 11.0" & "Command_Line_Tools_for_Xcode_12.2_beta_3" |
|
Note that this only fixes the depends build, not Tested 0729d1a on macOS Catalina 10.15.7 with Xcode 12.0.1, but I haven't tested on Big Sur. It builds, functional wallet tests and feature_backwards_compatibility.py still pass. I might try upgrading a machine to Big Sur beta later today. |
|
ACK Adding |
|
tACK 0729d1a on Big Sur beta 10 (20A5395g) with Xcode 12.1 |
|
Is the mutex check the only thing in bdb that needs Also, perhaps we should put this in |
|
I was playing with a commit for the contrib script which adds to CFLAGS as I thought this approach was cleaner too: willcl-ark@266b574 |
Gitian builds
|
Starting with the Clang shipped with Xcode 12, Apple has enabled -Werror=implicit-function-declaration by default. This causes bdbs mutex detection to fail when building on macOS (not cross-compiling): checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation as previously emitted warnings are being turned into errors. i.e: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] Append -Wno-error=implicit-function-declaration to cflags so that -Wimplicit-function-declaration returns to being a warning, and the configure checks will succeed. Fixes bitcoin#19411.
0729d1a to
d0a829e
Compare
Yes as far as I've seen.
The first time I tested this, I'm sure that putting this in |
|
Code review ACK d0a829e |
…macOS d0a829e build: fix mutex detection when building bdb on macOS (fanquake) Pull request description: Starting with the Apple Clang shipped with Xcode 12, [Apple has enabled -Werror=implicit-function-declaration by default](https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes): > 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): ```bash checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation ``` as previously emitted warnings are being turned into errors. i.e: ```bash configure:18704: checking for mutexes configure: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 conftest.c:46:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] main() { ^ conftest.c:51:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] exit ( ^ conftest.c:51:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 warning and 1 error generated. ``` Append `-Wno-error=implicit-function-declaration` to `cflags` so that `-Wimplicit-function-declaration` [returns to being a warning](https://clang.llvm.org/docs/UsersManual.html#cmdoption-wno-error), and the configure checks succeed. Fixes bitcoin#19411. ACKs for top commit: laanwj: Code review ACK d0a829e Tree-SHA512: 7813005b1fc0b370f843b6c0672acab32c999416e92c3f02b75d866e9c7aa41fe5822704fc74de6b65f0d7d94f2cdd05cc7c3ee83295ff1ecbc71d8492b9a2bf
Starting with the Clang shipped with Xcode 12, Apple has enabled -Werror=implicit-function-declaration by default. This causes bdbs mutex detection to fail when building on macOS (not cross-compiling): checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation as previously emitted warnings are being turned into errors. i.e: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] Append -Wno-error=implicit-function-declaration to cflags so that -Wimplicit-function-declaration returns to being a warning, and the configure checks will succeed. Fixes bitcoin#19411. Github-Pull: bitcoin#20195 Rebased-From: d0a829e
|
Added to #20166 for backporting. |
7566af4 doc: Update data directory path comments (Hennadii Stepanov) 09261de util: Add StripRedundantLastElementsOfPath function (Hennadii Stepanov) 8ef0dac macOS deploy: use the new plistlib API (Jonas Schnelli) 314e795 build: fix mutex detection when building bdb on macOS (fanquake) 1f67a30 random: fixes read buffer resizing in RandAddSeedPerfmon (Ethan Heilman) 6113b54 net: Send post-verack handshake messages at most once (MarcoFalke) bdf15d0 rpc: Adjust witness-tx deserialize error message (MarcoFalke) 731502a rpc: Properly deserialize txs with witness before signing (MarcoFalke) ee0082b Avoid the use of abs64 in timedata (Pieter Wuille) 05bd0c2 docs: Correct description for getblockstats's txs field (Nadav Ivgi) Pull request description: Backports the following PRs to the 0.20 branch: * #19777 - docs: Correct description for getblockstats's txs field * #19836 - rpc: Properly deserialize txs with witness before signing * #20080 - Strip any trailing `/` in -datadir and -blocksdir paths * #20082 - [bugfix] random: fixes read buffer to use min rather than max * #20141 - Avoid the use of abs64 in timedata * #20146 - net: Send post-verack handshake messages at most once * #20195 - build: fix mutex detection when building bdb on macOS * #20298 - macOS deploy: use the new plistlib API Will add additional commits as they become available. ACKs for top commit: MarcoFalke: review ACK 7566af4 🗡 Tree-SHA512: add6bb978313c12c3e07bc232636ae9d1ab0edd0b816705c5c70eeb1cc04097165fd5e29d60c706886943ceb1f749a422020766b4aa2d23be51e9f839157a4bb
…macOS d0a829e build: fix mutex detection when building bdb on macOS (fanquake) Pull request description: Starting with the Apple Clang shipped with Xcode 12, [Apple has enabled -Werror=implicit-function-declaration by default](https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes): > 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): ```bash checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation ``` as previously emitted warnings are being turned into errors. i.e: ```bash configure:18704: checking for mutexes configure: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 conftest.c:46:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] main() { ^ conftest.c:51:2: error: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))' [-Werror,-Wimplicit-function-declaration] exit ( ^ conftest.c:51:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 warning and 1 error generated. ``` Append `-Wno-error=implicit-function-declaration` to `cflags` so that `-Wimplicit-function-declaration` [returns to being a warning](https://clang.llvm.org/docs/UsersManual.html#cmdoption-wno-error), and the configure checks succeed. Fixes bitcoin#19411. ACKs for top commit: laanwj: Code review ACK d0a829e Tree-SHA512: 7813005b1fc0b370f843b6c0672acab32c999416e92c3f02b75d866e9c7aa41fe5822704fc74de6b65f0d7d94f2cdd05cc7c3ee83295ff1ecbc71d8492b9a2bf
07f08d4 build: fix mutex detection when building bdb on macOS (fanquake) 07185c3 build: use -isysroot over --sysroot on macOS (fanquake) 424ea09 depends: Add --sysroot option to mac os native compile flags (Russell Yanofsky) Pull request description: Fixing macOS depends builds, solving #2456 issue. Back porting: * bitcoin#18743. * bitcoin#20195. * bitcoin#21793. ACKs for top commit: Fuzzbawls: ACK 07f08d4 random-zebra: utACK 07f08d4 and merging... Tree-SHA512: 2de72a30e8bdfad582b303993eff8384e74d3699992695d6d7a6ec14f0e40898e7e1d70fc6e6a74318eaf21d5e312c346748a4a5986f1f29aa149150e30bdb3f
See bitcoin/bitcoin@d0a829e from bitcoin/bitcoin#20195 Starting with the Clang shipped with Xcode 12, Apple has enabled -Werror=implicit-function-declaration by default. This causes bdbs mutex detection to fail when building on macOS
See bitcoin/bitcoin@d0a829e from bitcoin/bitcoin#20195 Starting with the Clang shipped with Xcode 12, Apple has enabled -Werror=implicit-function-declaration by default. This causes bdbs mutex detection to fail when building on macOS
Starting with the Apple Clang shipped with Xcode 12, Apple has enabled -Werror=implicit-function-declaration by default:
This causes bdbs mutex detection to fail when building on macOS (not cross-compiling):
checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementationas previously emitted warnings are being turned into errors. i.e:
Append
-Wno-error=implicit-function-declarationtocflagsso that-Wimplicit-function-declarationreturns to being a warning, and the configure checks succeed.Fixes #19411.