This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Use crtbegin_so%O%s/crtend_so%O%s for -mandroid -shared


Hi,

Android uses crtbegin_so.o and crtend_so.o to build shared library with
-mshared.  OK for trunk in stage 1?


H.J.
---
2011-12-13  H.J. Lu  <hongjiu.lu@intel.com>

	* config/linux-android.h (ANDROID_STARTFILE_SPEC): Use
	crtbegin_so%O%s for -shared.
	(ANDROID_ENDFILE_SPEC): Use crtend_so%O%s for -shared.
---
 gcc/ChangeLog.android      |    5 +++++
 gcc/config/linux-android.h |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100644 gcc/ChangeLog.android

diff --git a/gcc/ChangeLog.android b/gcc/ChangeLog.android
new file mode 100644
index 0000000..fc54522
--- /dev/null
+++ b/gcc/ChangeLog.android
@@ -0,0 +1,5 @@
+2011-12-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* config/linux-android.h (ANDROID_STARTFILE_SPEC): Use
+	crtbegin_so%O%s for -shared.
+	(ANDROID_ENDFILE_SPEC): Use crtend_so%O%s for -shared.
diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
index 94c5274..acbc662 100644
--- a/gcc/config/linux-android.h
+++ b/gcc/config/linux-android.h
@@ -53,8 +53,8 @@
   "%{!static: -ldl}"
 
 #define ANDROID_STARTFILE_SPEC						\
-  "%{!shared:"								\
+  "%{shared: crtbegin_so%O%s;:"						\
   "  %{static: crtbegin_static%O%s;: crtbegin_dynamic%O%s}}"
 
 #define ANDROID_ENDFILE_SPEC \
-  "%{!shared: crtend_android%O%s}"
+  "%{shared: crtend_so%O%s;: crtend_android%O%s}"
-- 
1.7.6.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]