Skip to content
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

fuzz: don't try and use fopencookie() when building for Android #22069

Merged
merged 1 commit into from May 26, 2021

Conversation

fanquake
Copy link
Member

When building for Android, _GNU_SOURCE will be defined:

/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, or define the cookie_io_functions_t type, which results in compile failures:

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.

When building for Android, _GNU_SOURCE will be defined, but it doesn't
actually have the fopencookie() function, or define the
cookie_io_functions_t type.

For now just skip trying to use it if we are building for Android.

Should fix bitcoin#22062.
Copy link
Contributor

@practicalswift practicalswift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cr ACK 1be6267

@maflcko maflcko merged commit 48c86ec into bitcoin:master May 26, 2021
@fanquake fanquake deleted the dont_use_custom_stream_android branch May 26, 2021 05:52
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 27, 2021
…ing 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 bitcoin#22062.

ACKs for top commit:
  practicalswift:
    cr ACK 1be6267

Tree-SHA512: d62f63d0624af04b76c7e07b0332c71eca2bf9cd9e096a60aea9e212b7bbc1548e9fa9a76d065ec719bb345fe8726619c3bd2d0631f54d877c82972b7b289321
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when compiling fuzz binary for aarch64-linux-android target
3 participants