This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Use crtbegin_so%O%s/crtend_so%O%s for -mandroid -shared
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 29 Mar 2012 18:04:48 +1300
- Subject: Re: PATCH: Use crtbegin_so%O%s/crtend_so%O%s for -mandroid -shared
- References: <20111214171156.GC6579@intel.com>
This is OK. I didn't encounter building shared libraries for Android when developed the original Android support.
You can commit this under the "obvious patch" rule. [I've asked SC for reviewer privileges for Android support, so that I can approve more complex patches.]
Thank you,
--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics
On 15/12/2011, at 6:11 AM, H.J. Lu wrote:
> 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
>