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

Unresolved stderr on android 5.0 with ndk14 and unified headers #321

Closed
jpharvey opened this issue Mar 9, 2017 · 2 comments
Closed

Unresolved stderr on android 5.0 with ndk14 and unified headers #321

jpharvey opened this issue Mar 9, 2017 · 2 comments
Assignees
Milestone

Comments

@jpharvey
Copy link

jpharvey commented Mar 9, 2017

Description

Building our library with NDK 14 on windows results in an unresolved symbol when loading our shared library of stderr on Android 5.0/5.1. It is ok on 6 & above

We used the following command to create the standalone toolchain
python build\tools\make_standalone_toolchain.py --arch arm --api 21 --unified-headers --install-dir=e:\compilers\android\android-ndk-r14-arm --stl=libc++

The result of this is that the bash scripts bin/clang & bin/clang++ pass -D ANDROID_API=21 to clang38
but the bin/clang.cmd & bin/clang++.cmd do not add the define. I think this is a bug in the generation scripts and I don't believe from the documentation of unified headers that we are supposed to pass that define to the compiler when using the standalone toolchain.

Environment Details

Not all of these will be relevant to every bug, but please provide as much
information as you can.

  • NDK Version: Value: 14
  • Build sytem:standalone toolchain/ custom?
    • Host OS: Windows,
  • Compiler: clang.
  • ABI:
  • STL: libc++
  • NDK API level: 21
  • Device API level:
@jpharvey
Copy link
Author

jpharvey commented Mar 9, 2017

Just a quick followup
I believe the fix for this is at line 280 of make_standalone_toolchaing.py

add
if unified_headers:
flags += ' -D__ANDROID_API__={}'.format(api)

after
if windows:
flags = '-target {} --sysroot %~dp0\..\sysroot'.format(target)

@DanAlbert DanAlbert self-assigned this Mar 11, 2017
@DanAlbert DanAlbert added this to the r14b milestone Mar 13, 2017
@DanAlbert
Copy link
Member

Merged into r14. Thanks!

a252539783 pushed a commit to a252539783/aosp-platform-ndk that referenced this issue May 3, 2017
We rebuild the list of flags when we create the Windows standalone
toolchains since we need to use batch variables/paths instead. Add
the unified headers flags there too.

This slipped by before because the standalone toolchain tests were
still disabled on Windows from back when they weren't supported there.
I enabled them recently so those are being run now.

Test: ./validate.py # On Windows.
Bug: android/ndk#321
Change-Id: I5f00e6469343f5bbe6c0d415eed2b27d11184ba0
(cherry picked from commit d90623e)
miodragdinic pushed a commit to MIPS/ndk that referenced this issue Apr 17, 2018
We rebuild the list of flags when we create the Windows standalone
toolchains since we need to use batch variables/paths instead. Add
the unified headers flags there too.

This slipped by before because the standalone toolchain tests were
still disabled on Windows from back when they weren't supported there.
I enabled them recently so those are being run now.

Test: ./validate.py # On Windows.
Bug: android/ndk#321
Change-Id: I5f00e6469343f5bbe6c0d415eed2b27d11184ba0
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