Index: build/config/android/BUILD.gn |
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn |
index 0503bef1e1f3edd4ef79313dbbb37deeab1d87d5..a96c71fec182ac0f63b2a3063ae2f7aa0879d562 100644 |
--- a/build/config/android/BUILD.gn |
+++ b/build/config/android/BUILD.gn |
@@ -146,18 +146,18 @@ config("runtime_library") { |
defines = [ "__GNU_SOURCE=1" ] # Necessary for clone(). |
ldflags = [ "-nostdlib" ] |
lib_dirs = [ "$android_libcpp_root/libs/$android_app_abi" ] |
- libs = [ |
- "c", |
- "dl", |
- "m", |
- ] |
- # The libc++ runtime library. |
+ # The libc++ runtime library (must come first). |
if (is_component_build) { |
- libs += [ "c++_shared" ] |
+ libs = [ "c++_shared" ] |
} else { |
- libs += [ "c++_static" ] |
+ libs = [ "c++_static" ] |
} |
+ libs += [ |
+ "c", |
+ "dl", |
+ "m", |
+ ] |
if (is_clang) { |
# Work around incompatibilities between bionic and clang headers. |