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

libc++ linker scripts incorrect for LP32 API 21+ #672

Closed
DanAlbert opened this issue Apr 16, 2018 · 3 comments
Closed

libc++ linker scripts incorrect for LP32 API 21+ #672

DanAlbert opened this issue Apr 16, 2018 · 3 comments
Assignees
Milestone

Comments

@DanAlbert
Copy link
Member

Since we only ship one libc++ linker script set (one shared, one static) in the NDK, this script no longer works for the case where libandroid_support is not used for the target API level. make_standalone_toolchain.py won't copy libandroid_support for android-21+ since it is not needed, but the LP32 linker scripts assume it is needed because it is for earlier API levels.

I think the right solution here is to either ship multiple linker scripts (libc++.so.16, libc++.so.17, etc) for each supported API level, or to just remove them from the NDK distribution and let make_standalone_toolchain.py generate them.

Since we're so late in the r17 release cycle, I don't think we should alter the existing linker scripts since it seems likely that non-standalone toolchain users of them already have libandroid_support on the path, and in the short term we should avoid breaking their use case since the downsides of linking libandroid_support when it is not needed are small.

For r17, we'll switch to having make_standalone_toolchain.py generating its own linker scripts but also preserve the existing linker scripts in the NDK. For r18 we'll either remove them or generate one per API level.

@DanAlbert DanAlbert added this to the r17 milestone Apr 16, 2018
@DanAlbert DanAlbert self-assigned this Apr 16, 2018
@DanAlbert
Copy link
Member Author

While uglier implementation-wise than generating fresh linker scripts, I think we're better off having make_standalone_toolchain.py do a rewrite of the linker scripts after copying them since that will avoid issues where we update one template and forget to update the other.

@DanAlbert DanAlbert modified the milestones: r17, r18 Apr 17, 2018
@DanAlbert
Copy link
Member Author

https://android-review.googlesource.com/c/platform/ndk/+/665595 is the r17 fix for this. Moving the cleanup to r18.

@DanAlbert
Copy link
Member Author

Cleanup merged into master for r18. There's now a set of libc++.so.$API_LEVEL scripts.

lazartrsic pushed a commit to MIPS/ndk that referenced this issue Jun 1, 2018
We were using the same libc++ linker script regardless of API level,
and for 21+ we don't copy libandroid_support since it is not needed.

In this case, rewrite the linker script after we copy it into the
standalone toolchain. We should investigate a different fix for r18,
but I don't think we should be making a more disruptive change this
late in the r17 release.

Test: ./run_tests.py --rebuild
Bug: android/ndk#672
Change-Id: Ia3db77194953c5b72b12b6b4a9320444e2df3ab3
(cherry picked from commit bf1f432b543a22989e11d9e14daba0620cd4d030)
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

1 participant