Skip to content

[android] Avoid linking twice with C++ #21087

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

Conversation

drodriguez
Copy link
Contributor

The Android targetted libraries already link (manually) with the Android
NDK C++ libraries. When using Clang and lld, an extra link to libc++ is
requested, which will fail because Android names it libc++_shared.so
instead. To avoid looking for the wrong name, and since the library is
referenced manually either way, request no linking with the standard C++
libraries (but add the math library in, which is implicitly linked when
C++ is linked, and it is needed for Glibc at least).

Backport of #21086.

The Android targetted libraries already link (manually) with the Android
NDK C++ libraries. When using Clang and lld, an extra link to libc++ is
requested, which will fail because Android names it libc++_shared.so
instead. To avoid looking for the wrong name, and since the library is
referenced manually either way, request no linking with the standard C++
libraries (but add the math library in, which is implicitly linked when
C++ is linked, and it is needed for Glibc at least).
@drodriguez drodriguez requested a review from a team as a code owner December 6, 2018 19:23
@compnerd
Copy link
Member

compnerd commented Dec 6, 2018

@apple/swift5-branch-managers this is a low risk fix, it only impacts the build for the android standard library and corrects it so that we do not accidentally link against two different C++ runtimes which can have undesired consequences.

@compnerd
Copy link
Member

compnerd commented Dec 6, 2018

CC: @tkremenek - seems that I can't actually tag the branch managers :-(

@compnerd
Copy link
Member

compnerd commented Dec 6, 2018

@swift-ci please test

@tkremenek tkremenek merged commit 18941d4 into swiftlang:swift-5.0-branch Dec 7, 2018
@drodriguez drodriguez deleted the avoid-double-cxx-linking-5.0 branch January 7, 2019 19:36
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

Successfully merging this pull request may close these issues.

3 participants