Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index 429438efb7a5a6686e26fb42995553350b926159..d210bbbd0e36d0d5afe4251437553a7e990c666d 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -2427,12 +2427,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' ], |
}], |
], |
}], |