This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Use crtbegin_so%O%s/crtend_so%O%s for -mandroid -shared
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 Dec 2011 09:11:56 -0800
- Subject: PATCH: Use crtbegin_so%O%s/crtend_so%O%s for -mandroid -shared
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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