Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index db5bf662d30735af777d891a9887c975e5aea19a..7315d2dd191d31afb8376d8af90e00bcb6f64de0 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -2441,12 +2441,14 @@ |
['_type=="shared_library"', { |
'ldflags': [ |
'-Wl,-shared,-Bsymbolic', |
+ # crtbegin_so.o should be the last item in ldflags. |
+ '<(android_ndk_lib)/crtbegin_so.o', |
+ ], |
+ 'libraries': [ |
+ # crtend_so.o needs to be the last item in libraries. |
+ # Do not add any libraries after this! |
+ '<(android_ndk_lib)/crtend_so.o', |
], |
- # Use of -nostdlib prevents the compiler from bringing |
- # in crtbegin_dynamic.o et al, so we get an undefined |
- # reference to ___dso_handle when building |
- # gtest_target_type==shared_library. |
- 'ldflags!': [ '-nostdlib' ], |
}], |
], |
}], |