-
Notifications
You must be signed in to change notification settings - Fork 37.7k
depends: fix compiling bdb with clang-16 on aarch64 #27462
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
Unrelated: Interesting, that probably also means we can't switch to C++20 with depends, as long as bdb is around, assuming that depends is compiled with the same flags as Bitcoin Core? |
This is only broken on aarch64, right? |
Yea. Otherwise the CI should be failing. I haven't looked into the x86_64 vs aarch64 code in bdb. (updated title) |
Concept ACK. To @MarcoFalke's point, how nasty would a patch be to actually fix the casts? |
The first failures occur in configure, so probably nasty. |
Guix Build: ed1f83a77d00:/bitcoin# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
05fb39e87c26ce80c12c9a1e054eb5b558a454120c19cc555d7ab1d6508c0749 guix-build-0cc90822d502/output/aarch64-linux-gnu/SHA256SUMS.part
c488ff0d8eb0e1ec605f5ca6836b3dba4ab468f2f51ad2356ec9a632f6aee4c5 guix-build-0cc90822d502/output/aarch64-linux-gnu/bitcoin-0cc90822d502-aarch64-linux-gnu-debug.tar.gz
32c33bdb964d7eb3fe16f30f00b5eb3582e65e1c53d93be62ffe2e159ed2e5ba guix-build-0cc90822d502/output/aarch64-linux-gnu/bitcoin-0cc90822d502-aarch64-linux-gnu.tar.gz
93e6cb10b0acb01daa904b5a2a810eef4a0e6cb644c7bcab522bf3f368faa7ad guix-build-0cc90822d502/output/arm-linux-gnueabihf/SHA256SUMS.part
a266006b08ec1f1c9590721d0e6fc616281f8d96ba692d65302081d1c29cb19e guix-build-0cc90822d502/output/arm-linux-gnueabihf/bitcoin-0cc90822d502-arm-linux-gnueabihf-debug.tar.gz
c50055c3a2fe9a804a184d0eecfd334b57666774b529d049529f0c7d4dcd1956 guix-build-0cc90822d502/output/arm-linux-gnueabihf/bitcoin-0cc90822d502-arm-linux-gnueabihf.tar.gz
289ed95547b61597b60d1d3d0d11f1000725dbe882e856ef257418ea3a0223eb guix-build-0cc90822d502/output/arm64-apple-darwin/SHA256SUMS.part
2a031cd937cc370409996570a413d2ccf5541aee6881a1598dd0680fe006f5bd guix-build-0cc90822d502/output/arm64-apple-darwin/bitcoin-0cc90822d502-arm64-apple-darwin-unsigned.dmg
70d645f92719f79a3bbb1ac0cf1cf871609163c7a00ddaa1f80a0ced7534aa90 guix-build-0cc90822d502/output/arm64-apple-darwin/bitcoin-0cc90822d502-arm64-apple-darwin-unsigned.tar.gz
f02cc0c4f55d08aae79acc45d9de470b8c910dcebdacebb38480692c34ed9223 guix-build-0cc90822d502/output/arm64-apple-darwin/bitcoin-0cc90822d502-arm64-apple-darwin.tar.gz
614940475d1219cbab5a1c01e7be6cf1b40675b571bae344b32bc2fee76cd5fd guix-build-0cc90822d502/output/dist-archive/bitcoin-0cc90822d502.tar.gz
d9a0a0de3db69c9bc561e4014bde35820cc778cb97fc6140f761631d8c62f90a guix-build-0cc90822d502/output/powerpc64-linux-gnu/SHA256SUMS.part
2f34368e54dbab5dd1d9734ad818030ab432b99e7b3e54469400736534720478 guix-build-0cc90822d502/output/powerpc64-linux-gnu/bitcoin-0cc90822d502-powerpc64-linux-gnu-debug.tar.gz
b8f9e26637e27453713547b2d0eeb8f06bff24368a28e24aaabaf5c268fe18c3 guix-build-0cc90822d502/output/powerpc64-linux-gnu/bitcoin-0cc90822d502-powerpc64-linux-gnu.tar.gz
a024401d89295a9875cdaa4aff6c36272d29527d33078b9dd184525f812e630e guix-build-0cc90822d502/output/powerpc64le-linux-gnu/SHA256SUMS.part
19e3dbe1b853fe47f55bee2bc5fa17766dae9376d3efce0a37320940c8cbe09f guix-build-0cc90822d502/output/powerpc64le-linux-gnu/bitcoin-0cc90822d502-powerpc64le-linux-gnu-debug.tar.gz
58ed0e123da877934552ded68a142f881c7e11290f24047fe95ffc2d8c095543 guix-build-0cc90822d502/output/powerpc64le-linux-gnu/bitcoin-0cc90822d502-powerpc64le-linux-gnu.tar.gz
ea90971b0a4029c27ad8dab096dacee452ba0120921026d0f0b81c18ce389d3a guix-build-0cc90822d502/output/riscv64-linux-gnu/SHA256SUMS.part
39823ee979381fac92a4b3e745092771e7010a98d5dde532b4f7d7d54eccc6c8 guix-build-0cc90822d502/output/riscv64-linux-gnu/bitcoin-0cc90822d502-riscv64-linux-gnu-debug.tar.gz
fb7b0f3d6bac3ba8eade24e4a0ad9656a4fe627f41cb1c12ecc456e61561419d guix-build-0cc90822d502/output/riscv64-linux-gnu/bitcoin-0cc90822d502-riscv64-linux-gnu.tar.gz
e78399eeb59aec9c8fb24da3f9f237c8e2b26bf04a1b6e6e230a488aaec8fa86 guix-build-0cc90822d502/output/x86_64-apple-darwin/SHA256SUMS.part
5a82eb03bcf33b6ca40458ac4bf37058e97b71ce957246f7b2149430d5f554fa guix-build-0cc90822d502/output/x86_64-apple-darwin/bitcoin-0cc90822d502-x86_64-apple-darwin-unsigned.dmg
3b26f4786a5a69fe5440cbd4583f30deb99b3047f6a36f58f331185de72a3e13 guix-build-0cc90822d502/output/x86_64-apple-darwin/bitcoin-0cc90822d502-x86_64-apple-darwin-unsigned.tar.gz
271387a4882d34d7a7effe8678d0989af78ce6e46cba2bf2d9f2b2ce1ee0aff9 guix-build-0cc90822d502/output/x86_64-apple-darwin/bitcoin-0cc90822d502-x86_64-apple-darwin.tar.gz
d1b0dc135cd51e7bd0fe8f2a997c19d724e4b8302d7e29d6c310670e81154c43 guix-build-0cc90822d502/output/x86_64-linux-gnu/SHA256SUMS.part
54b0dd7d8f5ee51f9f99313ddc2439892e3c41046349e67e206dd40979c447e2 guix-build-0cc90822d502/output/x86_64-linux-gnu/bitcoin-0cc90822d502-x86_64-linux-gnu-debug.tar.gz
a280f0f5f002e52df4c7f1fcbdee619ba40e401047eb0c046ce78411d3dd836b guix-build-0cc90822d502/output/x86_64-linux-gnu/bitcoin-0cc90822d502-x86_64-linux-gnu.tar.gz
f18582890648c119ed7069d30a5c6eb2e56f9ca8ea26c7f5caf65f2e1b6f7404 guix-build-0cc90822d502/output/x86_64-w64-mingw32/SHA256SUMS.part
ccef6cdc725b5a047699b486a72f792a2eef396b7f7e1163c989c4297d3f31c9 guix-build-0cc90822d502/output/x86_64-w64-mingw32/bitcoin-0cc90822d502-win64-debug.zip
4b54d569784032fe8e9626dc284f20077ab834953e666d2eaa1cf6143ffaacae guix-build-0cc90822d502/output/x86_64-w64-mingw32/bitcoin-0cc90822d502-win64-setup-unsigned.exe
42d938b7a34fefc0c08e086216919e155d35a84eaa29f44a788a0f028c87332b guix-build-0cc90822d502/output/x86_64-w64-mingw32/bitcoin-0cc90822d502-win64-unsigned.tar.gz
c571f23f07690fb0c3846055d70d48650e4a2ecdc7838b92cf5a5f1d85223715 guix-build-0cc90822d502/output/x86_64-w64-mingw32/bitcoin-0cc90822d502-win64.zip |
May be interesting: I don't hit any issues when cross building for aarch64-linux-gnu from x86_64:
^^ (Where clang/clang++ are clang16 via PATH) builds fine. |
Compiling bdb with clang-16 on aarch64 (hardware) currently fails: ```bash make -C depends/ bdb CC=clang CXX=clang++ ... checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation ``` Looking at config.log we've got: ```bash configure:18704: checking for mutexes configure:18815: clang -o conftest -pipe -std=c11 -O2 -Wno-error=implicit-function-declaration -Wno-error=format-security -I/bitcoin/depends/aarch64-unknown-linux-gnu/include -D_GNU_SOURCE -D_REENTRANT -L/bitcoin/depends/aarch64-unknown-linux-gnu/lib conftest.c -lpthread >&5 conftest.c:45:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] main() { ^ int conftest.c:50:2: warning: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] exit ( ^ conftest.c:50:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 warning and 1 error generated. ``` Clang-16 changed `-Wimplicit-function-declaration` and `-Wimplicit-int` warnings into errors, see: https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes. > The -Wimplicit-function-declaration and -Wimplicit-int warnings now > default to an error in C99, C11, and C17. As of C2x, support for implicit > function declarations and implicit int has been removed, and the > warning options will have no effect. Specifying -Wimplicit-int in > C89 mode will now issue warnings instead of being a noop.
0cc9082
to
f8b8458
Compare
I've updated the commit message and PR description with more information. |
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.
ACK f8b8458, tested on Ubuntu Lunar (aarch64
) with:
make -C depends bdb CC=clang-16 CXX=clang++-16
and
make -C depends bdb CC=clang-16 CXX="clang++-16 -stdlib=libc++"
Wait, did we ever figure out why this only happens when not cross-compiling? That's fishy to me. |
f8b8458 depends: fix compiling bdb with clang-16 on aarch64 (fanquake) Pull request description: Compiling bdb with clang-16 on aarch64 (hardware) currently fails: ```bash make -C depends/ bdb CC=clang CXX=clang++ ... checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation ``` Looking at config.log we've got: ```bash configure:18704: checking for mutexes configure:18815: clang -o conftest -pipe -std=c11 -O2 -Wno-error=implicit-function-declaration -Wno-error=format-security -I/bitcoin/depends/aarch64-unknown-linux-gnu/include -D_GNU_SOURCE -D_REENTRANT -L/bitcoin/depends/aarch64-unknown-linux-gnu/lib conftest.c -lpthread >&5 conftest.c:45:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] main() { ^ int conftest.c:50:2: warning: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] exit ( ^ conftest.c:50:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 warning and 1 error generated. ``` Clang-16 changed `-Wimplicit-function-declaration` and `-Wimplicit-int` warnings into errors, see: https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes. > The -Wimplicit-function-declaration and -Wimplicit-int warnings now > default to an error in C99, C11, and C17. As of C2x, support for implicit > function declarations and implicit int has been removed, and the > warning options will have no effect. Specifying -Wimplicit-int in > C89 mode will now issue warnings instead of being a noop. ACKs for top commit: hebasto: ACK f8b8458, tested on Ubuntu Lunar (`aarch64`) with: Tree-SHA512: 5ca078b1c00915446e9f0f2ecaa4342295a2097996554345753315d1c81c23000c57be14e1ac5506a87820f5114aba748456f2c2b6426b0810504d62d761a787
This does happen when cross-compiling with Clang-16, i.e The fact that this doesn't fail in the same way, when using a different cross-compiler (GCC), cross-compiling on x86_64, seems like a potentially related, but separate issue? |
Ok, yeah, I guess my question was: why isn't this slipping into a "CC=clang" build. But point taken that's not really a supported combo. |
Compiling bdb with clang-16 on aarch64 (hardware) currently fails: ```bash make -C depends/ bdb CC=clang CXX=clang++ ... checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation ``` Looking at config.log we've got: ```bash configure:18704: checking for mutexes configure:18815: clang -o conftest -pipe -std=c11 -O2 -Wno-error=implicit-function-declaration -Wno-error=format-security -I/bitcoin/depends/aarch64-unknown-linux-gnu/include -D_GNU_SOURCE -D_REENTRANT -L/bitcoin/depends/aarch64-unknown-linux-gnu/lib conftest.c -lpthread >&5 conftest.c:45:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] main() { ^ int conftest.c:50:2: warning: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] exit ( ^ conftest.c:50:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 warning and 1 error generated. ``` Clang-16 changed `-Wimplicit-function-declaration` and `-Wimplicit-int` warnings into errors, see: https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes. > The -Wimplicit-function-declaration and -Wimplicit-int warnings now > default to an error in C99, C11, and C17. As of C2x, support for implicit > function declarations and implicit int has been removed, and the > warning options will have no effect. Specifying -Wimplicit-int in > C89 mode will now issue warnings instead of being a noop. Github-Pull: bitcoin#27462 Rebased-From: f8b8458
Compiling bdb with clang-16 on aarch64 (hardware) currently fails: ```bash make -C depends/ bdb CC=clang CXX=clang++ ... checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation ``` Looking at config.log we've got: ```bash configure:18704: checking for mutexes configure:18815: clang -o conftest -pipe -std=c11 -O2 -Wno-error=implicit-function-declaration -Wno-error=format-security -I/bitcoin/depends/aarch64-unknown-linux-gnu/include -D_GNU_SOURCE -D_REENTRANT -L/bitcoin/depends/aarch64-unknown-linux-gnu/lib conftest.c -lpthread >&5 conftest.c:45:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] main() { ^ int conftest.c:50:2: warning: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] exit ( ^ conftest.c:50:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit' 1 warning and 1 error generated. ``` Clang-16 changed `-Wimplicit-function-declaration` and `-Wimplicit-int` warnings into errors, see: https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes. > The -Wimplicit-function-declaration and -Wimplicit-int warnings now > default to an error in C99, C11, and C17. As of C2x, support for implicit > function declarations and implicit int has been removed, and the > warning options will have no effect. Specifying -Wimplicit-int in > C89 mode will now issue warnings instead of being a noop. Github-Pull: bitcoin#27462 Rebased-From: f8b8458
dc711fb doc: update 24.1 release notes (fanquake) fc8c1a8 doc: fix/improve warning helps in {create,load,unload,restore}wallet (Jon Atack) 3a26b19 bugfix: rest: avoid segfault for invalid URI (pablomartin4btc) c40b1da depends: fix compiling bdb with clang-16 on aarch64 (fanquake) 0bac52d Don't return OutputType::UNKNOWN in ParseOutputType (Pttn) Pull request description: Backports: * bitcoin#27279 (only f73782a) * bitcoin#27462 * bitcoin#27468 * bitcoin#27473 ACKs for top commit: stickies-v: ACK dc711fb hebasto: re-ACK dc711fb jonatack: ACK dc711fb Tree-SHA512: 72c673be82689e3c3a1c2564a1fdd6afe0b357b7aa8bec9524fe6999804fbccf310da0b074e647af14b753e5e695024e268fe4f69aa58747f541f7f429ebede6
Just in case it's ever helpful (or as @MarcoFalke said, in case we need this for c++20), here's a set of depends patches for bdb that should fix the existing configure checks: https://github.com/theuni/bitcoin/commits/bdb-configure-int-checks The code itself still isn't patched for the missing prototypes, but if the time comes and we need to do that, it should be simple enough. |
@theuni Thanks for following up. Hopefully we'll be able to avoid the route of having to do even more invasive patching. |
f091933 depends: fix compiling bdb with clang-16 on aarch64 (fanquake) c14f3b3 bdb: disable Werror for format-security (fanquake) ec7a883 build: suppress array-bounds errors in libxkbcommon (fanquake) Pull request description: Any further backports for 23.x. Currently: * 1bdbbbd from #25436 - which fixes building QT in depends with GCC > 12.1 * #25763 * #27462 ACKs for top commit: TheCharlatan: ACK f091933 Tree-SHA512: 8432ae37906e347ed30e2adc99a8b51e7f44159d04244fa749c5666c3b27cdd4fa89394c41674f980c09cc6c11367c3ee9c0922a2a8bd65ea471f9fd71a108ad
Compiling bdb with clang-16 on aarch64 (hardware) currently fails:
make -C depends/ bdb CC=clang CXX=clang++ ... checking for mutexes... UNIX/fcntl configure: WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM. configure: error: Unable to find a mutex implementation
Looking at config.log we've got:
Clang-16 changed
-Wimplicit-function-declaration
and-Wimplicit-int
warnings into errors, see:
https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes.