Skip to content

Commit 48c86ec

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#22069: fuzz: don't try and use fopencookie() when building for Android
1be6267 fuzz: don't try and use fopencookie when building for Android (fanquake) Pull request description: When building for Android, `_GNU_SOURCE` will be defined: ```bash /home/ubuntu/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang++ -dM -E -x c++ - < /dev/null #define _GNU_SOURCE 1 #define _LP64 1 #define __AARCH64EL__ 1 #define __AARCH64_CMODEL_SMALL__ 1 #define __ANDROID_API__ 30 #define __ANDROID__ 1 #define __ARM_64BIT_STATE 1 ..... ``` but it doesn't have the [`fopencookie()` function](https://www.gnu.org/software/libc/manual/html_node/Streams-and-Cookies.html), or define the `cookie_io_functions_t` type, which results in compile failures: ```bash In file included from test/fuzz/addition_overflow.cpp:7: ./test/fuzz/util.h:388:15: error: unknown type name 'cookie_io_functions_t' const cookie_io_functions_t io_hooks = { ^ 15 warnings and 1 error generated. ``` Just skip trying to use it if we are building for Android. Should fix #22062. ACKs for top commit: practicalswift: cr ACK 1be6267 Tree-SHA512: d62f63d0624af04b76c7e07b0332c71eca2bf9cd9e096a60aea9e212b7bbc1548e9fa9a76d065ec719bb345fe8726619c3bd2d0631f54d877c82972b7b289321
2 parents 35b83e6 + 1be6267 commit 48c86ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/fuzz/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ class FuzzedFileProvider
384384
[&] {
385385
mode = "a+";
386386
});
387-
#ifdef _GNU_SOURCE
387+
#if defined _GNU_SOURCE && !defined __ANDROID__
388388
const cookie_io_functions_t io_hooks = {
389389
FuzzedFileProvider::read,
390390
FuzzedFileProvider::write,

0 commit comments

Comments
 (0)