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

mmap() declaration wrong for 32-bit targets with 64-bit off_t #468

Closed
oleavr opened this issue Jul 24, 2017 · 3 comments
Closed

mmap() declaration wrong for 32-bit targets with 64-bit off_t #468

oleavr opened this issue Jul 24, 2017 · 3 comments

Comments

@oleavr
Copy link

oleavr commented Jul 24, 2017

Description

When compiling a 32-bit target with -D_FILE_OFFSET_BITS=64 this
results in the NDK's mmap() prototype not matching Bionic's, which
means the caller pushes a 64-bit value on the stack, whilst the callee
expects a 32-bit value there. This in turn means mmap() likely sees
a bogus offset argument and returns MAP_FAILED.

Environment Details

  • NDK Version: 15.1.4119039
  • Build system: Meson
  • Host OS: Mac
  • Compiler: Clang
  • ABI: armeabi-v7a
  • NDK API level: 14
  • Device API level: 24
@oleavr
Copy link
Author

oleavr commented Jul 24, 2017

Looks like another case of #459. /cc @DanAlbert

@enh
Copy link
Contributor

enh commented Jul 24, 2017

actually #449 is a closer match. fixed in r15c. in the meantime, you should probably turn off _FILE_OFFSET_BITS if you're targeting API 14.

@enh enh closed this as completed Jul 24, 2017
@oleavr
Copy link
Author

oleavr commented Jul 24, 2017

Oops, missed that one – sorry about the dupe!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants