Skip to content

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

Closed

Description

@DanAlbert

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.

Activity

  1. added this to the r17 milestone on Apr 16, 2018
  2. self-assigned this
    on Apr 16, 2018
  3. DanAlbert commented on Apr 16, 2018

    @DanAlbert
    ContributorAuthor

    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.

  4. modified the milestones: r17, r18 on Apr 17, 2018
  5. DanAlbert commented on Apr 17, 2018

    @DanAlbert
    ContributorAuthor
  6. DanAlbert commented on May 2, 2018

    @DanAlbert
    ContributorAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions