public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][ARM] Support arm-android-eabi
@ 2008-06-27 18:22 Doug Kwan (關振德)
  2008-06-27 22:38 ` Mark Mitchell
  0 siblings, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-06-27 18:22 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

Hi,

    This patch adds support for arm-android-eabi, which is different
from the generic arm-*-eabi target.

Tested with arm-none-eabi that the change does not affect the
non-Android arm-*-eabi targets.

-Doug

ChangeLog:

2008-06-27  Doug Kwan  <dougkwan@google.com>

        * configure.ac (arm*-android-eabi*): Do not build libmudflap. libssp
        and libstdc++-v3.
        * configure: Renegerate.

gcc/ChangeLog:

2008-06-27  Doug Kwan  <dougkwan@google.com>

        * config.gcc (arm*-*-eabi*): Support arm*-android-eabi*.
        * config/arm/arm.h (CC1_SPEC): Include subtarget_cc1_spec.
        (CC1PLUS_SPEC): New.
        (EXTRA_SEPCS): Add subtarget_cc1_spec and cc1plus_spec.
        (SUBTARGET_CC1_SPEC): New.
        (SUBTARGET_CC1PLUS_SPEC): New.
        * config/arm/android.h (File) New header.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 14781 bytes --]

Index: gcc/configure
===================================================================
--- gcc/configure	(revision 137168)
+++ gcc/configure	(working copy)
@@ -1123,7 +1123,7 @@ esac
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi
-    cd $ac_popdir
+    cd "$ac_popdir"
   done
 fi
 
@@ -2311,6 +2311,13 @@ case "${target}" in
     ;;
   arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+    # Also disable libmudflap, libspp and libstdc++-v3 on arm-android-eabi
+    case "${target}" in
+      *-android-*)
+      noconfigdirs="$noconfigdirs target-mudflap target-libssp"
+      noconfigdirs="$noconfigdirs target-libstdc++-v3"
+      ;;
+    esac
     libgloss_dir=arm
     ;;
   arm*-*-linux-gnueabi)
@@ -3504,8 +3511,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3563,8 +3569,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3680,8 +3685,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3735,8 +3739,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3781,8 +3784,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -3826,8 +3828,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4011,8 +4012,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4070,8 +4070,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4142,8 +4141,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4187,8 +4185,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_cxx_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4612,8 +4609,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4678,8 +4674,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -4721,8 +4716,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -12173,8 +12167,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-	 { ac_try='test -z "$ac_c_werror_flag"
-			 || test ! -s conftest.err'
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
@@ -13215,11 +13208,6 @@ esac
   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
   esac
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
   # Let's still pretend it is `configure' which instantiates (i.e., don't
   # use $as_me), people would be surprised to read:
   #    /* config.h.  Generated by config.status.  */
@@ -13258,6 +13246,12 @@ echo "$as_me: error: cannot find input f
 	 fi;;
       esac
     done` || { (exit 1); exit 1; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
Index: gcc/gcc/config.gcc
===================================================================
--- gcc/gcc/config.gcc	(revision 137168)
+++ gcc/gcc/config.gcc	(working copy)
@@ -746,6 +746,10 @@ arm*-*-eabi* | arm*-*-symbianelf* )
 	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
 	tmake_file="arm/t-arm arm/t-arm-elf"
 	case ${target} in
+	arm*-android-eabi*)
+	  tmake_file="${tmake_file} arm/t-bpabi"
+	  tm_file="${tm_file} arm/android.h"
+	  ;;
 	arm*-*-eabi*)
 	  tmake_file="${tmake_file} arm/t-bpabi"
 	  ;;
Index: gcc/gcc/config/arm/arm.h
===================================================================
--- gcc/gcc/config/arm/arm.h	(revision 137168)
+++ gcc/gcc/config/arm/arm.h	(working copy)
@@ -149,9 +149,11 @@ extern void (*arm_lang_output_object_att
 %{mbig-endian:%{mlittle-endian:						\
 	%e-mbig-endian and -mlittle-endian may not be used together}}"
 
-#ifndef CC1_SPEC
-#define CC1_SPEC ""
-#endif
+#undef  CC1_SPEC
+#define CC1_SPEC "%(subtarget_cc1_spec)"
+
+#undef  CC1PLUS_SPEC
+#define CC1PLUS_SPEC "%(subtarget_cc1plus_spec)"
 
 /* This macro defines names of additional specifications to put in the specs
    that can be used in various specifications like CC1_SPEC.  Its definition
@@ -163,6 +165,8 @@ extern void (*arm_lang_output_object_att
 
    Do not define this macro if it does not need to do anything.  */
 #define EXTRA_SPECS						\
+  { "subtarget_cc1_spec",	SUBTARGET_CC1_SPEC },           \
+  { "subtarget_cc1plus_spec",	SUBTARGET_CC1PLUS_SPEC },       \
   { "subtarget_cpp_spec",	SUBTARGET_CPP_SPEC },           \
   SUBTARGET_EXTRA_SPECS
 
@@ -170,6 +174,14 @@ extern void (*arm_lang_output_object_att
 #define SUBTARGET_EXTRA_SPECS
 #endif
 
+#ifndef SUBTARGET_CC1_SPEC
+#define SUBTARGET_CC1_SPEC      ""
+#endif
+
+#ifndef SUBTARGET_CC1PLUS_SPEC
+#define SUBTARGET_CC1PLUS_SPEC  ""
+#endif
+
 #ifndef SUBTARGET_CPP_SPEC
 #define SUBTARGET_CPP_SPEC      ""
 #endif
Index: gcc/gcc/config/arm/android.h
===================================================================
--- gcc/gcc/config/arm/android.h	(revision 0)
+++ gcc/gcc/config/arm/android.h	(revision 0)
@@ -0,0 +1,134 @@
+/* Definitions for Android based ARM systems using EABI
+   Copyright (C) 2008
+   Free Software Foundation, Inc.
+   Contributed by Doug Kwan <dougkwan@google.com>
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+/* elfos.h should have already been included.  Now just override
+   any conflicting definitions and add any extras.  */
+
+/* Run-time Target Specification.  */
+#ifndef TARGET_VERSION
+#define TARGET_VERSION	fputs (" (ARM/Android)", stderr);
+#endif
+
+/* Default to using software floating point.  */
+#ifndef TARGET_DEFAULT
+#define TARGET_DEFAULT	(0)
+#endif
+
+/* Now we define the strings used to build the spec file.  */
+
+/* Start file for executables is crtbegin_startic.o or crtbegin_dynamic.o.
+   There is no start file for shared object.  */
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC	\
+"%{!shared: " \
+  "%{static:crtbegin_static%O%s} " \
+  "%{!static:crtbegin_dynamic%O%s}}"
+
+/* End file for executables is crtend.o.  There is no endfile for shared
+   object.  */
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC	"%{!shared:crtend%O%s}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "-lc %{!static:-ldl}"
+
+#undef  PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+
+/* Return a nonzero value if DECL has a section attribute.  */
+#define IN_NAMED_SECTION(DECL)						\
+  ((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL)	\
+   && DECL_SECTION_NAME (DECL) != NULL_TREE)
+
+#undef  ASM_OUTPUT_ALIGNED_BSS
+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN)   	\
+  do									\
+    {									\
+      if (IN_NAMED_SECTION (DECL))					\
+	switch_to_section (get_named_section (DECL, NULL, 0));		\
+      else								\
+	switch_to_section (bss_section);				\
+      									\
+      ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT));	\
+									\
+      last_assemble_variable_decl = DECL;				\
+      ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL);			\
+      ASM_OUTPUT_SKIP (FILE, SIZE ? (int)(SIZE) : 1);			\
+    } 									\
+  while (0)
+
+#undef  ASM_OUTPUT_ALIGNED_DECL_LOCAL
+#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN)	\
+  do									\
+    {									\
+      if ((DECL) != NULL && IN_NAMED_SECTION (DECL))			\
+	switch_to_section (get_named_section (DECL, NULL, 0));		\
+      else								\
+	switch_to_section (bss_section);				\
+									\
+      ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT));	\
+      ASM_OUTPUT_LABEL (FILE, NAME);					\
+      fprintf (FILE, "\t.space\t%d\n", SIZE ? (int)(SIZE) : 1);		\
+    }									\
+  while (0)
+
+#ifndef SUBTARGET_CPU_DEFAULT
+#define SUBTARGET_CPU_DEFAULT 		TARGET_CPU_arm7tdmi
+#endif
+
+/* Define the __ANDROID__ macro.  */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()                                \
+  do                                                            \
+    {                                                           \
+      /* Include the default BPABI stuff.  */                   \
+      TARGET_BPABI_CPP_BUILTINS ();                             \
+      builtin_define ("__ANDROID__");                           \
+    }                                                           \
+  while (false)
+
+/* The libgcc udivmod functions may throw exceptions.  If newlib is
+   configured to support long longs in I/O, then printf will depend on
+   udivmoddi4, which will depend on the exception unwind routines,
+   which will depend on abort, which is defined in libc.  */ 
+#undef LINK_GCC_C_SEQUENCE_SPEC
+#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group"
+
+/* Run-time dynamic linker is /system/bin/linker.  */
+#undef	LINK_SPEC
+#define LINK_SPEC \
+  "%{version:-v} " \
+  "%{static:-Bstatic} " \
+  "%{!static: " \
+     "%{shared:-shared -Bsymbolic} " \
+     "%{!shared: -Bdynamic " \
+        "%{rdynamic:-export-dynamic} " \
+        "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}}"
+
+
+/* Androind does not support exceptions and RTTI.  */
+#undef SUBTARGET_CC1_SPEC
+#define SUBTARGET_CC1_SPEC \
+  "%{!fexceptions:-fno-exceptions}"
+
+#undef SUBTARGET_CC1PLUS_SPEC
+#define SUBTARGET_CC1PLUS_SPEC \
+  "%{!frtti:-fno-rtti} "
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 137168)
+++ gcc/configure.ac	(working copy)
@@ -560,6 +560,13 @@ case "${target}" in
     ;;
   arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* )
     noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+    # Also disable libmudflap, libspp and libstdc++-v3 on arm-android-eabi 
+    case "${target}" in
+      *-android-*)
+      noconfigdirs="$noconfigdirs target-mudflap target-libssp"
+      noconfigdirs="$noconfigdirs target-libstdc++-v3"
+      ;;
+    esac
     libgloss_dir=arm
     ;;
   arm*-*-linux-gnueabi)

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-27 18:22 [PATCH][ARM] Support arm-android-eabi Doug Kwan (關振德)
@ 2008-06-27 22:38 ` Mark Mitchell
  2008-06-27 22:45   ` Andrew Pinski
  2008-06-28 18:09   ` Doug Kwan (關振德)
  0 siblings, 2 replies; 30+ messages in thread
From: Mark Mitchell @ 2008-06-27 22:38 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"; +Cc: gcc-patches

Doug Kwan (關振德) wrote:

>     This patch adds support for arm-android-eabi, which is different
> from the generic arm-*-eabi target.

Why -- and how -- is it different?  Why can't this just be a -mandroid 
switch to the standard ARM EABI target?

The fact that you need different compilers for (say) EABI vs. GNU/Linux 
is unfortunate.  But, we should be trying very hard to avoid needing 
multiple compilers for minor differences between bare-metal systems.  We 
should do like every other compiler and support multiple target systems 
from a single compiler build.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-27 22:38 ` Mark Mitchell
@ 2008-06-27 22:45   ` Andrew Pinski
  2008-06-27 23:05     ` Mark Mitchell
  2008-06-28 18:09   ` Doug Kwan (關振德)
  1 sibling, 1 reply; 30+ messages in thread
From: Andrew Pinski @ 2008-06-27 22:45 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: "Doug Kwan (關振德)", gcc-patches

On Fri, Jun 27, 2008 at 3:37 PM, Mark Mitchell <mark@codesourcery.com> wrote:
> Why -- and how -- is it different?  Why can't this just be a -mandroid
> switch to the standard ARM EABI target?

A major difference I Noticed is that exceptions and RTTI are not on by default.

>
> The fact that you need different compilers for (say) EABI vs. GNU/Linux is
> unfortunate.  But, we should be trying very hard to avoid needing multiple
> compilers for minor differences between bare-metal systems.  We should do
> like every other compiler and support multiple target systems from a single
> compiler build.

Yes that would be nice except it slows down the compiler in most cases.

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-27 22:45   ` Andrew Pinski
@ 2008-06-27 23:05     ` Mark Mitchell
  0 siblings, 0 replies; 30+ messages in thread
From: Mark Mitchell @ 2008-06-27 23:05 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: "Doug Kwan (關振德)", gcc-patches

Andrew Pinski wrote:

>> The fact that you need different compilers for (say) EABI vs. GNU/Linux is
>> unfortunate.  But, we should be trying very hard to avoid needing multiple
>> compilers for minor differences between bare-metal systems.  We should do
>> like every other compiler and support multiple target systems from a single
>> compiler build.
> 
> Yes that would be nice except it slows down the compiler in most cases.

I doubt there is any significant effect.  Different CPUs (e.g., Power6 
vs. e500mc) might slow down some of the compiler.  Setting things like 
-fno-exceptions at startup are essentially free.

To be clear, I'm not suggesting that we magically collapse all the ARM 
targets into one.  That would be nice, but it's hard.  I'm just 
suggesting that we not create an arm-android-eabi target that's 
different from arm-none-eabi.  Instead, let's just have an -mandroid 
option to set the hooks appropriately.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-27 22:38 ` Mark Mitchell
  2008-06-27 22:45   ` Andrew Pinski
@ 2008-06-28 18:09   ` Doug Kwan (關振德)
  2008-06-29 18:47     ` Mark Mitchell
  2008-06-29 19:51     ` Andreas Schwab
  1 sibling, 2 replies; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-06-28 18:09 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc-patches

> Why -- and how -- is it different?  Why can't this just be a -mandroid
> switch to the standard ARM EABI target?

There major differences are

1. non-standard libraries and start-up.
2. Some libraries are not built by default.  I can used
--disable-libXXX for most but not libstdc++-v3.
3. -fno-rtti and -fno-exceptions are default.

> We should do
> like every other compiler and support multiple target systems from a single
> compiler build.

I understand that.  How does adding --disable-libstdc++-v3 in config
and using -mandroid instead sound?

-Doug

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-28 18:09   ` Doug Kwan (關振德)
@ 2008-06-29 18:47     ` Mark Mitchell
  2008-06-29 19:36       ` Doug Kwan (關振德)
  2008-06-29 19:51     ` Andreas Schwab
  1 sibling, 1 reply; 30+ messages in thread
From: Mark Mitchell @ 2008-06-29 18:47 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"; +Cc: gcc-patches

Doug Kwan (關振德) wrote:
>> Why -- and how -- is it different?  Why can't this just be a -mandroid
>> switch to the standard ARM EABI target?

> 1. non-standard libraries and start-up.
> 2. Some libraries are not built by default.  I can used
> --disable-libXXX for most but not libstdc++-v3.
> 3. -fno-rtti and -fno-exceptions are default.

I think adding a configure option to disable libstdc++-v3 would be 
better than hard-coding it into the configuration.  I'd assume that in 
the future someone might get libstdc++ working on Android; presumably 
it's not an inherent limitation of the platform that there not be a C++ 
runtime library.  And, it could be useful on other systems too.

>> We should do
>> like every other compiler and support multiple target systems from a single
>> compiler build.
> 
> I understand that.  How does adding --disable-libstdc++-v3 in config
> and using -mandroid instead sound?

That sounds much better to me.

In my ideal world, you'd be able to pass in *all* the things you need 
for -mandroid as configuration options and be able to pass them on the 
command-line as well.  In other words, I'd like to get to a situation 
where "arm-android-gcc" (whether provided with GCC or otherwise)  was 
just a wrapper program around "arm-eabi-gcc", that passed along the 
right options (like "-fno-rtti").  Right now, we're baking 
configurations into the compiler because we don't have enough 
flexibility to put them elsewhere, and that's unfortunate.

However, I don't think we yet have enough knobs to make it practical to 
completely eliminate the need for -mandroid.  So, as long as we have it 
as a run-time option in an arm-none-eabi compiler, I think that's 
reasonable.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-29 18:47     ` Mark Mitchell
@ 2008-06-29 19:36       ` Doug Kwan (關振德)
  2008-06-29 19:46         ` Mark Mitchell
  0 siblings, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-06-29 19:36 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc-patches

Hi,

2008/6/29 Mark Mitchell <mark@codesourcery.com>:

> I think adding a configure option to disable libstdc++-v3 would be better
> than hard-coding it into the configuration.  I'd assume that in the future
> someone might get libstdc++ working on Android; presumably it's not an
> inherent limitation of the platform that there not be a C++ runtime library.
>  And, it could be useful on other systems too.

Yes, I am talking about adding a --disable-libstdc++-v3, just like
other libraries.  There are platforms that have their own C and C++
libraries and do not use the ones from FSF :)

>> I understand that.  How does adding --disable-libstdc++-v3 in config
>> and using -mandroid instead sound?
>
> That sounds much better to me.
>
> In my ideal world, you'd be able to pass in *all* the things you need for
> -mandroid as configuration options and be able to pass them on the
> command-line as well.

Currently, all things that -mandroid will pass are passed in command
line now and that places too much burden on the user to know all the
options and implementation details like name of the start-up files,
name of the dynamic-linker and etc.

In my ideal world, I expect the tool "just works". In other words,

arm-android-eabi-gcc hello.c

should produce a ready-to-run ARM executable a.out on a host just like
running "gcc hello.c" on the host.

That said, I am still happy to use -mandroid. One single switch still
beats a long list of options. And "-mandroid" is easier for users to
remember as well.  Using "-mandroid" is less error-prone than the
current practice.

> In other words, I'd like to get to a situation where
> "arm-android-gcc" (whether provided with GCC or otherwise)  was just a
> wrapper program around "arm-eabi-gcc", that passed along the right options
> (like "-fno-rtti").  Right now, we're baking configurations into the
> compiler because we don't have enough flexibility to put them elsewhere, and
> that's unfortunate.

A gcc configuration file selectable at command line would be nice.

-Doug

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-29 19:36       ` Doug Kwan (關振德)
@ 2008-06-29 19:46         ` Mark Mitchell
       [not found]           ` <498552560806301522l721a55d6qc31cf0e929f7e825@mail.gmail.com>
  0 siblings, 1 reply; 30+ messages in thread
From: Mark Mitchell @ 2008-06-29 19:46 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"; +Cc: gcc-patches

Doug Kwan (關振德) wrote:

> In my ideal world, I expect the tool "just works". In other words,
> 
> arm-android-eabi-gcc hello.c
> 
> should produce a ready-to-run ARM executable a.out on a host just like
> running "gcc hello.c" on the host.

Right.  What I was trying to say is that I would like to get to the 
point where arm-android-eabi-gcc could just be a wrapper script, like:

   arm-none-eabi-gcc -fno-rtti -fno-exceptions "$@"

But, we don't have enough flexibility to make that practical at this time.

> That said, I am still happy to use -mandroid. One single switch still
> beats a long list of options. And "-mandroid" is easier for users to
> remember as well.  Using "-mandroid" is less error-prone than the
> current practice.

Great, we agree.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-28 18:09   ` Doug Kwan (關振德)
  2008-06-29 18:47     ` Mark Mitchell
@ 2008-06-29 19:51     ` Andreas Schwab
  2008-06-29 20:53       ` Doug Kwan (關振德)
  1 sibling, 1 reply; 30+ messages in thread
From: Andreas Schwab @ 2008-06-29 19:51 UTC (permalink / raw)
  To:  Doug Kwan ; +Cc: Mark Mitchell, gcc-patches

""Doug Kwan (關振德)"" <dougkwan@google.com> writes:

> 2. Some libraries are not built by default.  I can used
> --disable-libXXX for most but not libstdc++-v3.

--disable-libstdc__-v3 alread exists.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-06-29 19:51     ` Andreas Schwab
@ 2008-06-29 20:53       ` Doug Kwan (關振德)
  0 siblings, 0 replies; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-06-29 20:53 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Mark Mitchell, gcc-patches

Great. Thanks.

-Doug

2008/6/29 Andreas Schwab <schwab@suse.de>:

> --disable-libstdc__-v3 alread exists.
>
> Andreas.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
       [not found]           ` <498552560806301522l721a55d6qc31cf0e929f7e825@mail.gmail.com>
@ 2008-07-01  5:01             ` Mark Mitchell
  2008-07-01  6:38               ` Doug Kwan (關振德)
  2008-07-07 22:33               ` Doug Kwan (關振德)
  2008-07-09  1:50             ` Mark Mitchell
  2008-07-09 17:37             ` Joseph S. Myers
  2 siblings, 2 replies; 30+ messages in thread
From: Mark Mitchell @ 2008-07-01  5:01 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"; +Cc: gcc-patches

Doug Kwan (關振德) wrote:

> 2008-06-30  Doug Kwan  <dougkwan@google.com>
> 
>         * config/arm/arm.opt (mandroid): New option.
>         * config/arm/bpabi.h (ANDROID_LINK_SPEC): New macro.
>         (LINK_SPEC): Enable Android specific behaviour when -mandroid is used.
>         (CC1_SPEC): Same.
>         (CC1PLUS_SPEC): Same.
>         (LIB_SPEC): Same.
>         (STARTFILE_SPEC): Same.
>         (ENDFILE_SPEC): Same.
>         (TARGET_BPABI_CPP_BUILTINS): Define __ANDROID__ when -mandroid is
>         used.

This version looks reasonable to me.  But, I want to allow the ARM 
backend maintainers a chance to comment.  If you don't hear anything in 
a week, please ping me.

> Is it acceptable to add code in arm's backend to recognize
> "*-android-*" in DEFAULT_TARGET_MACHINE and turn on -mandroid
> automatically?

I don't know.  Do we do that in any other backend?  In my ideal world, 
there'd be a "--with-options=" option to configure that would cause the 
driver to assume those options appeared on every command-line.  Then, 
you could just configure with that.  For example:

   configure --with-options="-mandroid -meb"

would be a way of saying that:

   gcc -c foo.c

should be treated as equivalent to:

   gcc -mandroid -meb -c foo.c

Maybe the string passed in could be a specs string which would allow a 
bit more power, potentially.

Thoughts?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-01  5:01             ` Mark Mitchell
@ 2008-07-01  6:38               ` Doug Kwan (關振德)
  2008-07-07 22:57                 ` Daniel Jacobowitz
  2008-07-07 22:33               ` Doug Kwan (關振德)
  1 sibling, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-01  6:38 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc-patches

2008/6/30 Mark Mitchell <mark@codesourcery.com>:


> This version looks reasonable to me.  But, I want to allow the ARM backend
> maintainers a chance to comment.  If you don't hear anything in a week,
> please ping me.

Thanks. I will wait for a week then.

> I don't know.  Do we do that in any other backend?  In my ideal world,
> there'd be a "--with-options=" option to configure that would cause the
> driver to assume those options appeared on every command-line.  Then, you
> could just configure with that.

I don't think we do that in any backend. My proposal is quite a hack.
I like your idea better. It is sufficient for my purpose but I don't
think a single option is sufficient in general. We may need a family
of options for different front-end to pass front-end depended options.
Passing specs will be even better IMHO.

-Doug

> For example:
>
>  configure --with-options="-mandroid -meb"
>
> would be a way of saying that:
>
>  gcc -c foo.c
>
> should be treated as equivalent to:
>
>  gcc -mandroid -meb -c foo.c
>
> Maybe the string passed in could be a specs string which would allow a bit
> more power, potentially.
>
> Thoughts?
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-01  5:01             ` Mark Mitchell
  2008-07-01  6:38               ` Doug Kwan (關振德)
@ 2008-07-07 22:33               ` Doug Kwan (關振德)
  1 sibling, 0 replies; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-07 22:33 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: gcc-patches

Ping.  None of the ARM backend maintainers responded.

-Doug

2008/6/30 Mark Mitchell <mark@codesourcery.com>:

> This version looks reasonable to me.  But, I want to allow the ARM backend
> maintainers a chance to comment.  If you don't hear anything in a week,
> please ping me.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-01  6:38               ` Doug Kwan (關振德)
@ 2008-07-07 22:57                 ` Daniel Jacobowitz
  0 siblings, 0 replies; 30+ messages in thread
From: Daniel Jacobowitz @ 2008-07-07 22:57 UTC (permalink / raw)
  To: gcc-patches

On Mon, Jun 30, 2008 at 10:49:10PM -0700, Doug Kwan (關振德) wrote:
> > I don't know.  Do we do that in any other backend?  In my ideal world,
> > there'd be a "--with-options=" option to configure that would cause the
> > driver to assume those options appeared on every command-line.  Then, you
> > could just configure with that.
> 
> I don't think we do that in any backend. My proposal is quite a hack.
> I like your idea better. It is sufficient for my purpose but I don't
> think a single option is sufficient in general. We may need a family
> of options for different front-end to pass front-end depended options.
> Passing specs will be even better IMHO.

Most backends accomplish your goal with tm_defines.  You could use it
to set DRIVER_SELF_SPECS, for instance.

-- 
Daniel Jacobowitz
CodeSourcery

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
       [not found]           ` <498552560806301522l721a55d6qc31cf0e929f7e825@mail.gmail.com>
  2008-07-01  5:01             ` Mark Mitchell
@ 2008-07-09  1:50             ` Mark Mitchell
  2008-07-09 17:37             ` Joseph S. Myers
  2 siblings, 0 replies; 30+ messages in thread
From: Mark Mitchell @ 2008-07-09  1:50 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"; +Cc: gcc-patches

Doug Kwan (關振德) wrote:

> 2008-06-30  Doug Kwan  <dougkwan@google.com>
> 
>         * config/arm/arm.opt (mandroid): New option.
>         * config/arm/bpabi.h (ANDROID_LINK_SPEC): New macro.
>         (LINK_SPEC): Enable Android specific behaviour when -mandroid is used.
>         (CC1_SPEC): Same.
>         (CC1PLUS_SPEC): Same.
>         (LIB_SPEC): Same.
>         (STARTFILE_SPEC): Same.
>         (ENDFILE_SPEC): Same.
>         (TARGET_BPABI_CPP_BUILTINS): Define __ANDROID__ when -mandroid is
>         used.

> +mandroid
> +Target RejectNegative Mask(ANDROID)
> +Generate code of the Android platform.

Grammar: "for", not "of".

And, I think "Android operating system" would be better than "platform", 
which is jargon-ish.  (I know it's not a new  operating system, either, 
but ...)

> +/* Android uses -fno-rtti and -fno-excetpions by default. */

Spelling: "-fno-exceptions"

OK with those changes.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
       [not found]           ` <498552560806301522l721a55d6qc31cf0e929f7e825@mail.gmail.com>
  2008-07-01  5:01             ` Mark Mitchell
  2008-07-09  1:50             ` Mark Mitchell
@ 2008-07-09 17:37             ` Joseph S. Myers
  2008-07-09 17:59               ` Mark Mitchell
  2008-07-09 23:20               ` Doug Kwan (關振德)
  2 siblings, 2 replies; 30+ messages in thread
From: Joseph S. Myers @ 2008-07-09 17:37 UTC (permalink / raw)
  To: Doug Kwan (關振德); +Cc: Mark Mitchell, gcc-patches

This patch has broken the build for arm-*-linux-gnueabi; it's now looking 
for a crt0.o file that's inappropriate for this target.

The patch adds definitions of the macros CC1_SPEC, CC1PLUS_SPEC, LIB_SPEC, 
STARTFILE_SPEC, ENDFILE_SPEC unconditionally to bpabi.h.  However, some 
ARM targets rely on the definitions of these macros provided by previous 
headers (or maybe on the macros not being defined when a subsequent header 
is included - I don't know about that possibility), and the replacements 
are inappropriate for those targets.  In the case of arm-*-linux-gnueabi, 
at least your definition of STARTFILE_SPEC is wrong.

You need to fix GCC so that all targets including bpabi.h (that is 
arm*-*-linux-*eabi, arm*-*-uclinux-*eabi, arm*-*-eabi*, 
arm*-*-symbianelf*) have the same definitions of these macros (after the 
full set of target headers is included) they used to, except for the 
intended Android definitions for the generic arm*-*-eabi* only.  (It's 
probably harmless for the other targets to handle -mandroid, but also 
unnecessary.)  Note that the definitions may depend on how the compiler 
was configured in some cases (the STARTFILE_SPEC definition in 
config/linux.h does).  One possibility would be that these new definitions 
go in a separate header only included for the generic arm*-*-eabi* target 
(note that I have not checked that these new definitions are the same as 
the old ones for that target unless you use -mandroid).

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-09 17:37             ` Joseph S. Myers
@ 2008-07-09 17:59               ` Mark Mitchell
  2008-07-09 22:46                 ` Doug Kwan (關振德)
  2008-07-09 23:06                 ` Doug Kwan (關振德)
  2008-07-09 23:20               ` Doug Kwan (關振德)
  1 sibling, 2 replies; 30+ messages in thread
From: Mark Mitchell @ 2008-07-09 17:59 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: "Doug Kwan (???)", gcc-patches

Joseph S. Myers wrote:
> This patch has broken the build for arm-*-linux-gnueabi; it's now looking 
> for a crt0.o file that's inappropriate for this target.

Oh, dear.

Doug, please revert the patch until we get this sorted out.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-09 17:59               ` Mark Mitchell
@ 2008-07-09 22:46                 ` Doug Kwan (關振德)
  2008-07-09 23:06                 ` Doug Kwan (關振德)
  1 sibling, 0 replies; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-09 22:46 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

I was out of office this morning and am going to do this now.

-Doug

2008/7/9 Mark Mitchell <mark@codesourcery.com>:
> Joseph S. Myers wrote:
>>
>> This patch has broken the build for arm-*-linux-gnueabi; it's now looking
>> for a crt0.o file that's inappropriate for this target.
>
> Oh, dear.
>
> Doug, please revert the patch until we get this sorted out.
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-09 17:59               ` Mark Mitchell
  2008-07-09 22:46                 ` Doug Kwan (關振德)
@ 2008-07-09 23:06                 ` Doug Kwan (關振德)
  1 sibling, 0 replies; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-09 23:06 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

Patch was reverted.

-Doug

2008/7/9 Mark Mitchell <mark@codesourcery.com>:
> Joseph S. Myers wrote:
>>
>> This patch has broken the build for arm-*-linux-gnueabi; it's now looking
>> for a crt0.o file that's inappropriate for this target.
>
> Oh, dear.
>
> Doug, please revert the patch until we get this sorted out.
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-09 17:37             ` Joseph S. Myers
  2008-07-09 17:59               ` Mark Mitchell
@ 2008-07-09 23:20               ` Doug Kwan (關振德)
  2008-07-10  3:57                 ` Mark Mitchell
  1 sibling, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-09 23:20 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Mark Mitchell, gcc-patches

2008/7/9 Joseph S. Myers <joseph@codesourcery.com>:
> This patch has broken the build for arm-*-linux-gnueabi; it's now looking
> for a crt0.o file that's inappropriate for this target.
>
> The patch adds definitions of the macros CC1_SPEC, CC1PLUS_SPEC, LIB_SPEC,
> STARTFILE_SPEC, ENDFILE_SPEC unconditionally to bpabi.h.  However, some
> ARM targets rely on the definitions of these macros provided by previous
> headers (or maybe on the macros not being defined when a subsequent header
> is included - I don't know about that possibility), and the replacements
> are inappropriate for those targets.  In the case of arm-*-linux-gnueabi,
> at least your definition of STARTFILE_SPEC is wrong.

The patch that got checked in was the second version. In the first
version, I did use a seperate android.h header to override those
macros.  Could that a look at the patch in the first mail this thread
to see if that first version does it right?

> You need to fix GCC so that all targets including bpabi.h (that is
> arm*-*-linux-*eabi, arm*-*-uclinux-*eabi, arm*-*-eabi*,
> arm*-*-symbianelf*) have the same definitions of these macros (after the
> full set of target headers is included) they used to, except for the
> intended Android definitions for the generic arm*-*-eabi* only.  (It's
> probably harmless for the other targets to handle -mandroid, but also
> unnecessary.)  Note that the definitions may depend on how the compiler
> was configured in some cases (the STARTFILE_SPEC definition in
> config/linux.h does).  One possibility would be that these new definitions
> go in a separate header only included for the generic arm*-*-eabi* target
> (note that I have not checked that these new definitions are the same as
> the old ones for that target unless you use -mandroid).
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-09 23:20               ` Doug Kwan (關振德)
@ 2008-07-10  3:57                 ` Mark Mitchell
  2008-07-10  6:12                   ` Doug Kwan (關振德)
  0 siblings, 1 reply; 30+ messages in thread
From: Mark Mitchell @ 2008-07-10  3:57 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"
  Cc: Joseph S. Myers, gcc-patches

Doug Kwan (關振德) wrote:

> The patch that got checked in was the second version. In the first
> version, I did use a seperate android.h header to override those
> macros.  Could that a look at the patch in the first mail this thread
> to see if that first version does it right?

Didn't that patch have the problem that it required that it required a 
different configuration triplet for Android?  It should still be 
possible to have -mandroid; we just need to get the specs organized 
correctly.

Take a look at config/rs6000/sysv4.h to see how this can be done.  That 
header file supports OpenBSD, the GDB simulator, and several other 
platforms.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-10  3:57                 ` Mark Mitchell
@ 2008-07-10  6:12                   ` Doug Kwan (關振德)
  2008-07-12 18:26                     ` Doug Kwan (關振德)
  0 siblings, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-10  6:12 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

I will take a look and see if I can rearrange the specs correctly.

-Doug

2008/7/9 Mark Mitchell <mark@codesourcery.com>:
> Doug Kwan (關振德) wrote:
>
>> The patch that got checked in was the second version. In the first
>> version, I did use a seperate android.h header to override those
>> macros.  Could that a look at the patch in the first mail this thread
>> to see if that first version does it right?
>
> Didn't that patch have the problem that it required that it required a
> different configuration triplet for Android?  It should still be possible to
> have -mandroid; we just need to get the specs organized correctly.
>
> Take a look at config/rs6000/sysv4.h to see how this can be done.  That
> header file supports OpenBSD, the GDB simulator, and several other
> platforms.
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-10  6:12                   ` Doug Kwan (關振德)
@ 2008-07-12 18:26                     ` Doug Kwan (關振德)
  2008-07-13 18:23                       ` Mark Mitchell
  0 siblings, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-12 18:26 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

Here is an updated pach.  The overrides are now in a new header
generic-eabi.h.  I've checked that the specs of arm-*-linux-gnueabi
are not changed.

-Doug

2008-07-11  Doug Kwan  <dougkwan@google.com>

        * config.gcc (arm*-*-eabi*): Include arm/generic-eabi.h.
        * config/arm/generic-eabi.h (File): New header for generic EABI
        targets.
        * config/arm/elf.h (SUBTARGET_EXTRA_SPECS): Add
        SUBSUBTARGET_EXTRA_SPECS.
        (SUBSUBTARGET_EXTRA_SPECS): New macro.
        * config/arm/arm.opt (mandroid): New option.

-Doug

2008/7/9 Doug Kwan (關振德) <dougkwan@google.com>:
> I will take a look and see if I can rearrange the specs correctly.
>
> -Doug
>
> 2008/7/9 Mark Mitchell <mark@codesourcery.com>:
>> Doug Kwan (關振德) wrote:
>>
>>> The patch that got checked in was the second version. In the first
>>> version, I did use a seperate android.h header to override those
>>> macros.  Could that a look at the patch in the first mail this thread
>>> to see if that first version does it right?
>>
>> Didn't that patch have the problem that it required that it required a
>> different configuration triplet for Android?  It should still be possible to
>> have -mandroid; we just need to get the specs organized correctly.
>>
>> Take a look at config/rs6000/sysv4.h to see how this can be done.  That
>> header file supports OpenBSD, the GDB simulator, and several other
>> platforms.
>>
>> Thanks,
>>
>> --
>> Mark Mitchell
>> CodeSourcery
>> mark@codesourcery.com
>> (650) 331-3385 x713
>>
>

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 6505 bytes --]

Index: gcc/gcc/config.gcc
===================================================================
--- gcc/gcc/config.gcc	(revision 137727)
+++ gcc/gcc/config.gcc	(working copy)
@@ -763,6 +763,7 @@ arm*-*-eabi* | arm*-*-symbianelf* )
 	tmake_file="arm/t-arm arm/t-arm-elf"
 	case ${target} in
 	arm*-*-eabi*)
+	  tm_file="$tm_file arm/generic-eabi.h"
 	  tmake_file="${tmake_file} arm/t-bpabi"
 	  ;;
 	arm*-*-symbianelf*)
Index: gcc/gcc/config/arm/elf.h
===================================================================
--- gcc/gcc/config/arm/elf.h	(revision 137727)
+++ gcc/gcc/config/arm/elf.h	(working copy)
@@ -36,7 +36,8 @@
 #ifndef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
   { "subtarget_extra_asm_spec",	SUBTARGET_EXTRA_ASM_SPEC }, \
-  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },
+  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
+  SUBSUBTARGET_EXTRA_SPECS
 #endif
 
 #ifndef SUBTARGET_EXTRA_ASM_SPEC
@@ -48,6 +49,9 @@
 %{mapcs-float:-mfloat}"
 #endif
 
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS
+
 #ifndef ASM_SPEC
 #define ASM_SPEC "\
 %{mbig-endian:-EB} \
Index: gcc/gcc/config/arm/generic-eabi.h
===================================================================
--- gcc/gcc/config/arm/generic-eabi.h	(revision 0)
+++ gcc/gcc/config/arm/generic-eabi.h	(revision 0)
@@ -0,0 +1,143 @@
+/* Configuration file for generic ARM EABI targets.
+   Copyright (C) 2008
+   Free Software Foundation, Inc.
+   Contributed by Doug Kwan (dougkwan@google.com)
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains macro overrides for generic EABI targets.  It also
+   handles the Android operating system specially.  Android specific behaviours
+   are enabled by the -mandroid gcc option.  */
+
+/* Define all builtins as a BPAPI target and also __ANDROID__ if
+   -mandroid is given. */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()			\
+  do							\
+    {							\
+      TARGET_BPABI_CPP_BUILTINS ();			\
+      if (TARGET_ANDROID)				\
+	builtin_define ("__ANDROID__");			\
+    }							\
+  while (false)
+
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS \
+  { "link_android",		LINK_ANDROID_SPEC }, \
+  { "link_default",		LINK_DEFAULT_SPEC }, \
+  { "cc1_android",		CC1_ANDROID_SPEC },		\
+  { "cc1_default",		CC1_DEFAULT_SPEC },		\
+  { "cc1plus_android",		CC1PLUS_ANDROID_SPEC },		\
+  { "cc1plus_default",		CC1PLUS_DEFAULT_SPEC },		\
+  { "lib_android",		LIB_ANDROID_SPEC },		\
+  { "lib_default",		LIB_DEFAULT_SPEC },		\
+  { "startfile_android",	STARTFILE_ANDROID_SPEC },	\
+  { "startfile_default",	STARTFILE_DEFAULT_SPEC },	\
+  { "endfile_android",		ENDFILE_ANDROID_SPEC },		\
+  { "endfile_default",		ENDFILE_DEFAULT_SPEC },		\
+
+#define LINK_ANDROID_SPEC \
+"%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
+"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "	\
+"%{!static:" \
+   "%{shared: -Bsymbolic} " \
+   "%{!shared:" \
+      "%{rdynamic:-export-dynamic} " \
+      "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}} " \
+"-X" SUBTARGET_EXTRA_LINK_SPEC
+
+/* Default LINK_SPEC as in bpabi.h. */
+#undef LINK_DEFAULT_SPEC
+#define LINK_DEFAULT_SPEC \
+"%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
+"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "	\
+"-X" SUBTARGET_EXTRA_LINK_SPEC
+
+/* Override LINK_SPEC in bpabi.h. */
+#undef LINK_SPEC
+#define LINK_SPEC \
+"%{mandroid: %(link_android) ;" \
+"          : %(link_default)}"
+
+/* Android uses -fno-exceptions by default. */
+#undef CC1_ANDROID_SPEC
+#define CC1_ANDROID_SPEC "%{mandroid:%{!fexceptions:-fno-exceptions}}"
+
+/* Default CC1_SPEC as in arm.h. */
+#undef CC1_DEFAULT_SPEC
+#define CC1_DEFAULT_SPEC ""
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+"%{mandroid: %(cc1_android) ;" \
+"          : %(cc1_default)}"
+
+/* Android uses -fno-rtti by default. */
+#undef CC1PLUS_ANDROID_SPEC
+#define CC1PLUS_ANDROID_SPEC "%{!frtti:-fno-rtti}"
+
+/* Default CC1PLUS_SPEC as in gcc.c. */
+#undef CC1PLUS_DEFAULT_SPEC
+#define CC1PLUS_DEFAULT_SPEC ""
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC \
+"%{mandroid: %(cc1plus_android) ;" \
+"          : %(cc1plus_default)}"
+
+#undef LIB_ANDROID_SPEC
+#define LIB_ANDROID_SPEC	"-lc %{!static:-ldl}"
+
+/* Default LIB_SPEC as in gcc.c. */
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC \
+"%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+"%{mandroid: %(lib_android) ;" \
+"          : %(lib_default)}"
+
+#undef STARTFILE_ANDROID_SPEC
+#define STARTFILE_ANDROID_SPEC \
+"%{!shared:" \
+   "%{static: crtbegin_static%O%s ;" \
+   "        : crtbegin_dynamic%O%s}}"
+
+/* Default STARTFILE_SPEC as in unknown-elf.h. */
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC	"crti%O%s crtbegin%O%s crt0%O%s"
+
+/* Override STARTFILE_SPEC in unknown-elf.h. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+"%{mandroid: %(startfile_android) ;" \
+"          : %(startfile_default)}"
+
+#undef ENDFILE_ANDROID_SPEC
+#define ENDFILE_ANDROID_SPEC	"%{!shared:crtend_android%O%s}"
+
+#undef ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC	"crtend%O%s crtn%O%s"
+
+/* Override ENDFILE_SPEC in unknown-elf.h. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+"%{mandroid: %(endfile_android) ;" \
+"          : %(endfile_default)}"
+
Index: gcc/gcc/config/arm/arm.opt
===================================================================
--- gcc/gcc/config/arm/arm.opt	(revision 137727)
+++ gcc/gcc/config/arm/arm.opt	(working copy)
@@ -26,6 +26,10 @@ mabort-on-noreturn
 Target Report Mask(ABORT_NORETURN)
 Generate a call to abort if a noreturn function returns
 
+mandroid
+Target Report RejectNegative Mask(ANDROID)
+Generate code for the Android operating system.
+
 mapcs
 Target RejectNegative Mask(APCS_FRAME) MaskExists Undocumented
 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-12 18:26                     ` Doug Kwan (關振德)
@ 2008-07-13 18:23                       ` Mark Mitchell
  2008-07-13 20:25                         ` Doug Kwan (關振德)
  0 siblings, 1 reply; 30+ messages in thread
From: Mark Mitchell @ 2008-07-13 18:23 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"
  Cc: Joseph S. Myers, gcc-patches

Doug Kwan (關振德) wrote:
> Here is an updated pach.  The overrides are now in a new header
> generic-eabi.h.  I've checked that the specs of arm-*-linux-gnueabi
> are not changed.

This seems better.  However, I still think we can do better.  We're now 
duplicating bits from bpabi.h and unknown-elf.h in generic-eabi.h.  For 
example:

+/* Default STARTFILE_SPEC as in unknown-elf.h. */
+#undef STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC	"crti%O%s crtbegin%O%s crt0%O%s"

and:

+/* Default LINK_SPEC as in bpabi.h. */
+#undef LINK_DEFAULT_SPEC
+#define LINK_DEFAULT_SPEC \

That's code duplication that we don't want.

I thought about suggesting that we move the -mandroid stuff directly 
into bpabi.h, but since that header is also used for GNU/Linux and 
uClinux, that might be odd.  Saying -mandroid to a uClinux compiler -- 
or a SymbianOS compiler! -- doesn't make any sense.  I suppose that's 
also an argument that the option itself ought to go into a separate .opt 
file.  Would you please make that change as well?

So, I do think a new eabi.h header makes sense, though I think it should 
just be "eabi.h"; I'm not sure what the "generic" in "generic-eabi.h" 
adds.  However, I think that we should avoid duplication.  I think the 
most robust may to do that is to have bpabi.h define 
ARM_BPABI_<something> and unknown-elf.h define ARM_ELF_<something>.

Concretely, in unknown-elf.h we do:

   #define ARM_ELF_STARTFILE_SPEC ...
   #define STARTFILE_SPEC ARM_ELF_STARTFILE_SPEC

Then, in eabi.h:

   #define STARTFILE_DEFAULT_SPEC ARM_ELF_STARTFILE_SPEC
   #undef STARTFILE_SPEC
   #define STARTFILE_SPEC \
     "{mandroid...}"

In C++ terms, treat the eabi.h as a "derived class" of the other .h 
files it includes, and override "virtual functions" as appropriate.

Thoughts?

Also, one nit on the comments on eabi.h:

> It also
> +   handles the Android operating system specially.  Android specific behaviours
> +   are enabled by the -mandroid gcc option.  */

This is in appropriate, since the design here is that there might 
eventually be other EABI-based systems incorporated here.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-13 18:23                       ` Mark Mitchell
@ 2008-07-13 20:25                         ` Doug Kwan (關振德)
  2008-07-14  0:44                           ` Mark Mitchell
  0 siblings, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-13 20:25 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

Hi

Thanks for iterating this patch with me so many times :)

2008/7/13 Mark Mitchell <mark@codesourcery.com>:

> I thought about suggesting that we move the -mandroid stuff directly into
> bpabi.h, but since that header is also used for GNU/Linux and uClinux, that
> might be odd.  Saying -mandroid to a uClinux compiler -- or a SymbianOS
> compiler! -- doesn't make any sense.  I suppose that's also an argument that
> the option itself ought to go into a separate .opt file.  Would you please
> make that change as well?

No problem.  I agree that -mandroid on SymbianOS does not make sense.
We can use a eabi.opt I suppose.

> So, I do think a new eabi.h header makes sense, though I think it should
> just be "eabi.h"; I'm not sure what the "generic" in "generic-eabi.h" adds.
>  However, I think that we should avoid duplication.  I think the most robust
> may to do that is to have bpabi.h define ARM_BPABI_<something> and
> unknown-elf.h define ARM_ELF_<something>.

I chose generic-eabi.h instead of eabi.h because there are other BPABI
based targets which do not want the new macros. I can certainly drop
the generic bit.

The other suggestions sounds good, I will do the changes.

> In C++ terms, treat the eabi.h as a "derived class" of the other .h files it
> includes, and override "virtual functions" as appropriate.

In other to do that, we must always define these macros in a manner so
that a derived macro can access the parent macro. So this
does not work

base.h

#define FOO ....
...

derived.h

#undef FOO
#define FOO .. /* something that depends on the base macro */

But this does

base.h

#define BASE_FOO ...
#undef FOO
#define FOO BASE_FOO

derived.h

#define DERIVED_FOO ... /* uses BASE_FOO */
#undef FOO
#define FOO DERIVED_FOO

-Doug

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-13 20:25                         ` Doug Kwan (關振德)
@ 2008-07-14  0:44                           ` Mark Mitchell
  2008-07-14  7:07                             ` Doug Kwan (關振德)
  0 siblings, 1 reply; 30+ messages in thread
From: Mark Mitchell @ 2008-07-14  0:44 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"
  Cc: Joseph S. Myers, gcc-patches

Doug Kwan (關振德) wrote:

> Thanks for iterating this patch with me so many times :)

Sorry to be making lots of work...

> We can use a eabi.opt I suppose.

Right, that sounds good.

> I chose generic-eabi.h instead of eabi.h because there are other BPABI
> based targets which do not want the new macros. I can certainly drop
> the generic bit.

We already have bpabi.h for all ("generic") Base Platform ABI systems 
(which include bare-metal, RTOS, uClinux, SymbianOS, GNU/Linux, etc.). 
So, I think we can use eabi.h for the "bare-metal and RTOS" category. 
It's not a perfect name, but it matches existing practice in the ARM 
toolchain and elsewhere.

> But this does
> 
> base.h
> 
> #define BASE_FOO ...
> #undef FOO
> #define FOO BASE_FOO
> 
> derived.h
> 
> #define DERIVED_FOO ... /* uses BASE_FOO */
> #undef FOO
> #define FOO DERIVED_FOO

Right; that's why I was suggesting BPABI_LINK_SPEC, for example.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-14  0:44                           ` Mark Mitchell
@ 2008-07-14  7:07                             ` Doug Kwan (關振德)
  2008-07-14 19:45                               ` Mark Mitchell
  0 siblings, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-14  7:07 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2570 bytes --]

Here is my updated patch. Things changed since last patch:

- option -mandroid is now in a seperate optiion file eabi.opt, which
is only used in targets arm*-*-eabi*.
- generic-eabi.h is renamed eabi.h
- The "Android specific" comment is removed from eabi.h
- LINK_SPEC, STARTFILE_SPEC and ENDFILE_SPEC use default for
non-Android targets defined in header earlier in the inclusion chain
(bpabi.h and unknown-elf.h)

eabi.h still provides defaults for CC1_SPEC, CC1PLUS_SPEC and LIB_SPEC
for non-Android targets because these are defined later in the the
inclusion chain in the original code (gcc.c and arm.h)

-Doug

2008-07-13  Doug Kwan  <dougkwan@google.com>

	* config.gcc (arm*-*-eabi*): Include arm/eabi.h and use
	additional option file arm/eabi.opt.
	* config/arm/eabi.h (File): New configuration file for EABI targets.
	* config/arm/elf.h (SUBTARGET_EXTRA_SPECS): Add
	SUBSUBTARGET_EXTRA_SPECS.
	(SUBSUBTARGET_EXTRA_SPECS): Provide empty default.
	* config/arm/unknown-elf.h (STARTFILE_UNKNOWN_ELF_SPEC): Renamed
	from STARTFILE_SPEC so that it can be referenced in an override.
	(STARTFILE_SPEC): Use STARTFILE_UNKNOWN_ELF_SPEC.
	(ENDFILE_UNKNOWN_ELF_SPEC): Renamed from ENDFILE_SPEC so that it
	can be referenced in an override.
	(ENDFILE_SPEC): Use ENDFILE_UNKNOWN_ELF_SPEC.
	* config/arm/bpabi.h (LINK_BPABI_SPEC): Renamed from LINK_SPEC
	so that it can be referenced in an override.
	(LINK_SPEC): Use LINK_BPABI_SPEC.
	* config/arm/eabi.opt (File): New.


2008/7/13 Mark Mitchell <mark@codesourcery.com>:
> Doug Kwan (關振德) wrote:
>
>> Thanks for iterating this patch with me so many times :)
>
> Sorry to be making lots of work...
>
>> We can use a eabi.opt I suppose.
>
> Right, that sounds good.
>
>> I chose generic-eabi.h instead of eabi.h because there are other BPABI
>> based targets which do not want the new macros. I can certainly drop
>> the generic bit.
>
> We already have bpabi.h for all ("generic") Base Platform ABI systems (which
> include bare-metal, RTOS, uClinux, SymbianOS, GNU/Linux, etc.). So, I think
> we can use eabi.h for the "bare-metal and RTOS" category. It's not a perfect
> name, but it matches existing practice in the ARM toolchain and elsewhere.
>
>> But this does
>>
>> base.h
>>
>> #define BASE_FOO ...
>> #undef FOO
>> #define FOO BASE_FOO
>>
>> derived.h
>>
>> #define DERIVED_FOO ... /* uses BASE_FOO */
>> #undef FOO
>> #define FOO DERIVED_FOO
>
> Right; that's why I was suggesting BPABI_LINK_SPEC, for example.
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 7933 bytes --]

Index: gcc/gcc/config.gcc
===================================================================
--- gcc/gcc/config.gcc	(revision 137727)
+++ gcc/gcc/config.gcc	(working copy)
@@ -763,7 +763,9 @@ arm*-*-eabi* | arm*-*-symbianelf* )
 	tmake_file="arm/t-arm arm/t-arm-elf"
 	case ${target} in
 	arm*-*-eabi*)
+	  tm_file="$tm_file arm/eabi.h"
 	  tmake_file="${tmake_file} arm/t-bpabi"
+	  extra_options="${extra_options} arm/eabi.opt"
 	  ;;
 	arm*-*-symbianelf*)
 	  tm_file="${tm_file} arm/symbian.h"
Index: gcc/gcc/config/arm/eabi.h
===================================================================
--- gcc/gcc/config/arm/eabi.h	(revision 0)
+++ gcc/gcc/config/arm/eabi.h	(revision 0)
@@ -0,0 +1,124 @@
+/* Configuration file for ARM EABI targets.
+   Copyright (C) 2008
+   Free Software Foundation, Inc.
+   Contributed by Doug Kwan (dougkwan@google.com)
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains macro overrides for EABI targets.  */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()			\
+  do							\
+    {							\
+      TARGET_BPABI_CPP_BUILTINS ();			\
+      if (TARGET_ANDROID)				\
+	builtin_define ("__ANDROID__");			\
+    }							\
+  while (false)
+
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS \
+  { "link_android",		LINK_ANDROID_SPEC },		\
+  { "link_default",		LINK_BPABI_SPEC },		\
+  { "cc1_android",		CC1_ANDROID_SPEC },		\
+  { "cc1_default",		CC1_DEFAULT_SPEC },		\
+  { "cc1plus_android",		CC1PLUS_ANDROID_SPEC },		\
+  { "cc1plus_default",		CC1PLUS_DEFAULT_SPEC },		\
+  { "lib_android",		LIB_ANDROID_SPEC },		\
+  { "lib_default",		LIB_DEFAULT_SPEC },		\
+  { "startfile_android",	STARTFILE_ANDROID_SPEC },	\
+  { "startfile_default",	STARTFILE_UNKNOWN_ELF_SPEC },	\
+  { "endfile_android",		ENDFILE_ANDROID_SPEC },		\
+  { "endfile_default",		ENDFILE_UNKNOWN_ELF_SPEC },	\
+
+#define LINK_ANDROID_SPEC \
+"%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
+"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "	\
+"%{!static:" \
+   "%{shared: -Bsymbolic} " \
+   "%{!shared:" \
+      "%{rdynamic:-export-dynamic} " \
+      "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}} " \
+"-X" SUBTARGET_EXTRA_LINK_SPEC
+
+/* Override LINK_SPEC in bpabi.h. */
+#undef LINK_SPEC
+#define LINK_SPEC \
+"%{mandroid: %(link_android) ;" \
+"          : %(link_default)}"
+
+/* Android uses -fno-exceptions by default. */
+#undef CC1_ANDROID_SPEC
+#define CC1_ANDROID_SPEC "%{!fexceptions:-fno-exceptions}"
+
+/* Default CC1_SPEC as in arm.h. */
+#undef CC1_DEFAULT_SPEC
+#define CC1_DEFAULT_SPEC ""
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+"%{mandroid: %(cc1_android) ;" \
+"          : %(cc1_default)}"
+
+/* Android uses -fno-rtti by default. */
+#undef CC1PLUS_ANDROID_SPEC
+#define CC1PLUS_ANDROID_SPEC "%{!frtti:-fno-rtti}"
+
+/* Default CC1PLUS_SPEC as in gcc.c. */
+#undef CC1PLUS_DEFAULT_SPEC
+#define CC1PLUS_DEFAULT_SPEC ""
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC \
+"%{mandroid: %(cc1plus_android) ;" \
+"          : %(cc1plus_default)}"
+
+#undef LIB_ANDROID_SPEC
+#define LIB_ANDROID_SPEC	"-lc %{!static:-ldl}"
+
+/* Default LIB_SPEC as in gcc.c. */
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC \
+"%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+"%{mandroid: %(lib_android) ;" \
+"          : %(lib_default)}"
+
+#undef STARTFILE_ANDROID_SPEC
+#define STARTFILE_ANDROID_SPEC \
+"%{!shared:" \
+   "%{static: crtbegin_static%O%s ;" \
+   "        : crtbegin_dynamic%O%s}}"
+
+/* Override STARTFILE_SPEC in unknown-elf.h. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+"%{mandroid: %(startfile_android) ;" \
+"          : %(startfile_default)}"
+
+#undef ENDFILE_ANDROID_SPEC
+#define ENDFILE_ANDROID_SPEC	"%{!shared:crtend_android%O%s}"
+
+/* Override ENDFILE_SPEC in unknown-elf.h. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+"%{mandroid: %(endfile_android) ;" \
+"          : %(endfile_default)}"
+
Index: gcc/gcc/config/arm/elf.h
===================================================================
--- gcc/gcc/config/arm/elf.h	(revision 137760)
+++ gcc/gcc/config/arm/elf.h	(working copy)
@@ -36,7 +36,8 @@
 #ifndef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
   { "subtarget_extra_asm_spec",	SUBTARGET_EXTRA_ASM_SPEC }, \
-  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },
+  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
+  SUBSUBTARGET_EXTRA_SPECS
 #endif
 
 #ifndef SUBTARGET_EXTRA_ASM_SPEC
@@ -48,6 +49,9 @@
 %{mapcs-float:-mfloat}"
 #endif
 
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS
+
 #ifndef ASM_SPEC
 #define ASM_SPEC "\
 %{mbig-endian:-EB} \
Index: gcc/gcc/config/arm/unknown-elf.h
===================================================================
--- gcc/gcc/config/arm/unknown-elf.h	(revision 137760)
+++ gcc/gcc/config/arm/unknown-elf.h	(working copy)
@@ -33,11 +33,15 @@
 #endif
 
 /* Now we define the strings used to build the spec file.  */
+#define STARTFILE_UNKNOWN_ELF_SPEC	" crti%O%s crtbegin%O%s crt0%O%s"
+
 #undef  STARTFILE_SPEC
-#define STARTFILE_SPEC	" crti%O%s crtbegin%O%s crt0%O%s"
+#define STARTFILE_SPEC	STARTFILE_UNKNOWN_ELF_SPEC
+
+#define ENDFILE_UNKNOWN_ELF_SPEC	"crtend%O%s crtn%O%s"
 
 #undef  ENDFILE_SPEC
-#define ENDFILE_SPEC	"crtend%O%s crtn%O%s"
+#define ENDFILE_SPEC	ENDFILE_UNKNOWN_ELF_SPEC
 
 /* The __USES_INITFINI__ define is tested in newlib/libc/sys/arm/crt0.S
    to see if it needs to invoked _init() and _fini().  */
Index: gcc/gcc/config/arm/bpabi.h
===================================================================
--- gcc/gcc/config/arm/bpabi.h	(revision 137760)
+++ gcc/gcc/config/arm/bpabi.h	(working copy)
@@ -60,11 +60,14 @@
 #endif
 
 /* The generic link spec in elf.h does not support shared libraries.  */
-#undef  LINK_SPEC
-#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
+#define LINK_BPABI_SPEC \
+  "%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
   "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "	\
   "-X" SUBTARGET_EXTRA_LINK_SPEC
 
+#undef  LINK_SPEC
+#define LINK_SPEC LINK_BPABI_SPEC
+
 #if defined (__thumb__)
 #define RENAME_LIBRARY_SET ".thumb_set"
 #else
Index: gcc/gcc/config/arm/eabi.opt
===================================================================
--- gcc/gcc/config/arm/eabi.opt	(revision 0)
+++ gcc/gcc/config/arm/eabi.opt	(revision 0)
@@ -0,0 +1,23 @@
+; EABI specific options for ARM port of the compiler.
+
+; Copyright (C) 2008 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3.  If not see
+; <http://www.gnu.org/licenses/>.
+
+mandroid
+Target Report RejectNegative Mask(ANDROID)
+Generate code for the Android operating system.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-14  7:07                             ` Doug Kwan (關振德)
@ 2008-07-14 19:45                               ` Mark Mitchell
  2008-07-14 20:19                                 ` Doug Kwan (關振德)
  0 siblings, 1 reply; 30+ messages in thread
From: Mark Mitchell @ 2008-07-14 19:45 UTC (permalink / raw)
  To: "Doug Kwan (關振德)"
  Cc: Joseph S. Myers, gcc-patches

Doug Kwan (關振德) wrote:

> - LINK_SPEC, STARTFILE_SPEC and ENDFILE_SPEC use default for
> non-Android targets defined in header earlier in the inclusion chain
> (bpabi.h and unknown-elf.h)

Great.  I think this is OK.  However, I would prefer the spelling 
BPABI_LINK_SPEC to LINK_BPBAI_SPEC, as I suggested earlier.  (And, 
similarly for the UNKNOWN_ELF specs.)  That's more like English ("the 
BPBABI link specification") and more like OO notation 
("BPABI::LINK_SPEC" or "BPABI.LINK_SPEC").

Please make that change, and check it in again...

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-14 19:45                               ` Mark Mitchell
@ 2008-07-14 20:19                                 ` Doug Kwan (關振德)
  2008-07-14 21:38                                   ` Doug Kwan (關振德)
  0 siblings, 1 reply; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-14 20:19 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

Thanks for approving.  I picked the naming convention from the rs6000
port you pointed to me earlier but I have no perference one way or
another.

-Doug

2008/7/14 Mark Mitchell <mark@codesourcery.com>:
> Doug Kwan (關振德) wrote:
>
>> - LINK_SPEC, STARTFILE_SPEC and ENDFILE_SPEC use default for
>> non-Android targets defined in header earlier in the inclusion chain
>> (bpabi.h and unknown-elf.h)
>
> Great.  I think this is OK.  However, I would prefer the spelling
> BPABI_LINK_SPEC to LINK_BPBAI_SPEC, as I suggested earlier.  (And, similarly
> for the UNKNOWN_ELF specs.)  That's more like English ("the BPBABI link
> specification") and more like OO notation ("BPABI::LINK_SPEC" or
> "BPABI.LINK_SPEC").
>
> Please make that change, and check it in again...
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH][ARM] Support arm-android-eabi
  2008-07-14 20:19                                 ` Doug Kwan (關振德)
@ 2008-07-14 21:38                                   ` Doug Kwan (關振德)
  0 siblings, 0 replies; 30+ messages in thread
From: Doug Kwan (關振德) @ 2008-07-14 21:38 UTC (permalink / raw)
  To: Mark Mitchell; +Cc: Joseph S. Myers, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]

This is the version that got checked in.  I renamed the macros so
according to Mark's suggestion and I did the same to the Android spec
marcos.

-Doug

2008-07-14  Doug Kwan  <dougkwan@google.com>

	* config.gcc (arm*-*-eabi*): Include arm/eabi.h and use
	additional option file arm/eabi.opt.
	* config/arm/eabi.h (File): New configuration file for EABI targets.
	* config/arm/elf.h (SUBTARGET_EXTRA_SPECS): Add
	SUBSUBTARGET_EXTRA_SPECS.
	(SUBSUBTARGET_EXTRA_SPECS): Provide empty default.
	* config/arm/unknown-elf.h (UNKNOWN_ELF_STARTFILE_SPEC): Renamed
	from STARTFILE_SPEC so that it can be referenced in an override.
	(STARTFILE_SPEC): Use UNKNOWN_ELF_STARTFILE_SPEC.
	(UNKNOWN_ELF_ENDFILE_SPEC): Renamed from ENDFILE_SPEC so that it
	can be referenced in an override.
	(ENDFILE_SPEC): Use UNKNOWN_ELF_ENDFILE_SPEC.
	* config/arm/bpabi.h (BPABI_LINK_SPEC): Renamed from LINK_SPEC
	so that it can be referenced in an override.
	(LINK_SPEC): Use BPABI_LINK_SPEC.
	* config/arm/eabi.opt (File): New.


2008/7/14 Doug Kwan (關振德) <dougkwan@google.com>:
> Thanks for approving.  I picked the naming convention from the rs6000
> port you pointed to me earlier but I have no perference one way or
> another.
>
> -Doug
>
> 2008/7/14 Mark Mitchell <mark@codesourcery.com>:
>> Doug Kwan (關振德) wrote:
>>
>>> - LINK_SPEC, STARTFILE_SPEC and ENDFILE_SPEC use default for
>>> non-Android targets defined in header earlier in the inclusion chain
>>> (bpabi.h and unknown-elf.h)
>>
>> Great.  I think this is OK.  However, I would prefer the spelling
>> BPABI_LINK_SPEC to LINK_BPBAI_SPEC, as I suggested earlier.  (And, similarly
>> for the UNKNOWN_ELF specs.)  That's more like English ("the BPBABI link
>> specification") and more like OO notation ("BPABI::LINK_SPEC" or
>> "BPABI.LINK_SPEC").
>>
>> Please make that change, and check it in again...
>>
>> Thanks,
>>
>> --
>> Mark Mitchell
>> CodeSourcery
>> mark@codesourcery.com
>> (650) 331-3385 x713
>>
>

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 7959 bytes --]

Index: gcc/gcc/config.gcc
===================================================================
--- gcc/gcc/config.gcc	(revision 137794)
+++ gcc/gcc/config.gcc	(working copy)
@@ -763,7 +763,9 @@ arm*-*-eabi* | arm*-*-symbianelf* )
 	tmake_file="arm/t-arm arm/t-arm-elf"
 	case ${target} in
 	arm*-*-eabi*)
+	  tm_file="$tm_file arm/eabi.h"
 	  tmake_file="${tmake_file} arm/t-bpabi"
+	  extra_options="${extra_options} arm/eabi.opt"
 	  ;;
 	arm*-*-symbianelf*)
 	  tm_file="${tm_file} arm/symbian.h"
Index: gcc/gcc/config/arm/eabi.h
===================================================================
--- gcc/gcc/config/arm/eabi.h	(revision 0)
+++ gcc/gcc/config/arm/eabi.h	(revision 0)
@@ -0,0 +1,125 @@
+/* Configuration file for ARM EABI targets.
+   Copyright (C) 2008
+   Free Software Foundation, Inc.
+   Contributed by Doug Kwan (dougkwan@google.com)
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3, or (at your
+   option) any later version.
+
+   GCC is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   <http://www.gnu.org/licenses/>.  */
+
+/* This file contains macro overrides for EABI targets.  */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()			\
+  do							\
+    {							\
+      TARGET_BPABI_CPP_BUILTINS ();			\
+      if (TARGET_ANDROID)				\
+	builtin_define ("__ANDROID__");			\
+    }							\
+  while (false)
+
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS \
+  { "link_android",		ANDROID_LINK_SPEC },		\
+  { "link_default",		BPABI_LINK_SPEC },		\
+  { "cc1_android",		ANDROID_CC1_SPEC },		\
+  { "cc1_default",		CC1_DEFAULT_SPEC },		\
+  { "cc1plus_android",		ANDROID_CC1PLUS_SPEC },		\
+  { "cc1plus_default",		CC1PLUS_DEFAULT_SPEC },		\
+  { "lib_android",		ANDROID_LIB_SPEC },		\
+  { "lib_default",		LIB_DEFAULT_SPEC },		\
+  { "startfile_android",	ANDROID_STARTFILE_SPEC },	\
+  { "startfile_default",	UNKNOWN_ELF_STARTFILE_SPEC },	\
+  { "endfile_android",		ANDROID_ENDFILE_SPEC },		\
+  { "endfile_default",		UNKNOWN_ELF_ENDFILE_SPEC },	\
+
+#undef ANDROID_LINK_SPEC
+#define ANDROID_LINK_SPEC \
+"%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
+"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "	\
+"%{!static:" \
+   "%{shared: -Bsymbolic} " \
+   "%{!shared:" \
+      "%{rdynamic:-export-dynamic} " \
+      "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}} " \
+"-X" SUBTARGET_EXTRA_LINK_SPEC
+
+/* Override LINK_SPEC in bpabi.h. */
+#undef LINK_SPEC
+#define LINK_SPEC \
+"%{mandroid: %(link_android) ;" \
+"          : %(link_default)}"
+
+/* Android uses -fno-exceptions by default. */
+#undef ANDROID_CC1_SPEC
+#define ANDROID_CC1_SPEC "%{!fexceptions:-fno-exceptions}"
+
+/* Default CC1_SPEC as in arm.h. */
+#undef CC1_DEFAULT_SPEC
+#define CC1_DEFAULT_SPEC ""
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+"%{mandroid: %(cc1_android) ;" \
+"          : %(cc1_default)}"
+
+/* Android uses -fno-rtti by default. */
+#undef ANDROID_CC1PLUS_SPEC
+#define ANDROID_CC1PLUS_SPEC "%{!frtti:-fno-rtti}"
+
+/* Default CC1PLUS_SPEC as in gcc.c. */
+#undef CC1PLUS_DEFAULT_SPEC
+#define CC1PLUS_DEFAULT_SPEC ""
+
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC \
+"%{mandroid: %(cc1plus_android) ;" \
+"          : %(cc1plus_default)}"
+
+#undef ANDROID_LIB_SPEC
+#define ANDROID_LIB_SPEC	"-lc %{!static:-ldl}"
+
+/* Default LIB_SPEC as in gcc.c. */
+#undef LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC \
+"%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+"%{mandroid: %(lib_android) ;" \
+"          : %(lib_default)}"
+
+#undef ANDROID_STARTFILE_SPEC
+#define ANDROID_STARTFILE_SPEC \
+"%{!shared:" \
+   "%{static: crtbegin_static%O%s ;" \
+   "        : crtbegin_dynamic%O%s}}"
+
+/* Override STARTFILE_SPEC in unknown-elf.h. */
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+"%{mandroid: %(startfile_android) ;" \
+"          : %(startfile_default)}"
+
+#undef ANDROID_ENDFILE_SPEC
+#define ANDROID_ENDFILE_SPEC	"%{!shared:crtend_android%O%s}"
+
+/* Override ENDFILE_SPEC in unknown-elf.h. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+"%{mandroid: %(endfile_android) ;" \
+"          : %(endfile_default)}"
+
Index: gcc/gcc/config/arm/elf.h
===================================================================
--- gcc/gcc/config/arm/elf.h	(revision 137794)
+++ gcc/gcc/config/arm/elf.h	(working copy)
@@ -36,7 +36,8 @@
 #ifndef SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
   { "subtarget_extra_asm_spec",	SUBTARGET_EXTRA_ASM_SPEC }, \
-  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC },
+  { "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
+  SUBSUBTARGET_EXTRA_SPECS
 #endif
 
 #ifndef SUBTARGET_EXTRA_ASM_SPEC
@@ -48,6 +49,9 @@
 %{mapcs-float:-mfloat}"
 #endif
 
+#undef SUBSUBTARGET_EXTRA_SPECS
+#define SUBSUBTARGET_EXTRA_SPECS
+
 #ifndef ASM_SPEC
 #define ASM_SPEC "\
 %{mbig-endian:-EB} \
Index: gcc/gcc/config/arm/unknown-elf.h
===================================================================
--- gcc/gcc/config/arm/unknown-elf.h	(revision 137794)
+++ gcc/gcc/config/arm/unknown-elf.h	(working copy)
@@ -33,11 +33,15 @@
 #endif
 
 /* Now we define the strings used to build the spec file.  */
+#define UNKNOWN_ELF_STARTFILE_SPEC	" crti%O%s crtbegin%O%s crt0%O%s"
+
 #undef  STARTFILE_SPEC
-#define STARTFILE_SPEC	" crti%O%s crtbegin%O%s crt0%O%s"
+#define STARTFILE_SPEC	UNKNOWN_ELF_STARTFILE_SPEC
+
+#define UNKNOWN_ELF_ENDFILE_SPEC	"crtend%O%s crtn%O%s"
 
 #undef  ENDFILE_SPEC
-#define ENDFILE_SPEC	"crtend%O%s crtn%O%s"
+#define ENDFILE_SPEC	UNKNOWN_ELF_ENDFILE_SPEC
 
 /* The __USES_INITFINI__ define is tested in newlib/libc/sys/arm/crt0.S
    to see if it needs to invoked _init() and _fini().  */
Index: gcc/gcc/config/arm/bpabi.h
===================================================================
--- gcc/gcc/config/arm/bpabi.h	(revision 137794)
+++ gcc/gcc/config/arm/bpabi.h	(working copy)
@@ -60,11 +60,14 @@
 #endif
 
 /* The generic link spec in elf.h does not support shared libraries.  */
-#undef  LINK_SPEC
-#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
+#define BPABI_LINK_SPEC \
+  "%{mbig-endian:-EB} %{mlittle-endian:-EL} "		\
   "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} "	\
   "-X" SUBTARGET_EXTRA_LINK_SPEC
 
+#undef  LINK_SPEC
+#define LINK_SPEC BPABI_LINK_SPEC
+
 #if defined (__thumb__)
 #define RENAME_LIBRARY_SET ".thumb_set"
 #else
Index: gcc/gcc/config/arm/eabi.opt
===================================================================
--- gcc/gcc/config/arm/eabi.opt	(revision 0)
+++ gcc/gcc/config/arm/eabi.opt	(revision 0)
@@ -0,0 +1,23 @@
+; EABI specific options for ARM port of the compiler.
+
+; Copyright (C) 2008 Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3.  If not see
+; <http://www.gnu.org/licenses/>.
+
+mandroid
+Target Report RejectNegative Mask(ANDROID)
+Generate code for the Android operating system.

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2008-07-14 21:09 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-27 18:22 [PATCH][ARM] Support arm-android-eabi Doug Kwan (關振德)
2008-06-27 22:38 ` Mark Mitchell
2008-06-27 22:45   ` Andrew Pinski
2008-06-27 23:05     ` Mark Mitchell
2008-06-28 18:09   ` Doug Kwan (關振德)
2008-06-29 18:47     ` Mark Mitchell
2008-06-29 19:36       ` Doug Kwan (關振德)
2008-06-29 19:46         ` Mark Mitchell
     [not found]           ` <498552560806301522l721a55d6qc31cf0e929f7e825@mail.gmail.com>
2008-07-01  5:01             ` Mark Mitchell
2008-07-01  6:38               ` Doug Kwan (關振德)
2008-07-07 22:57                 ` Daniel Jacobowitz
2008-07-07 22:33               ` Doug Kwan (關振德)
2008-07-09  1:50             ` Mark Mitchell
2008-07-09 17:37             ` Joseph S. Myers
2008-07-09 17:59               ` Mark Mitchell
2008-07-09 22:46                 ` Doug Kwan (關振德)
2008-07-09 23:06                 ` Doug Kwan (關振德)
2008-07-09 23:20               ` Doug Kwan (關振德)
2008-07-10  3:57                 ` Mark Mitchell
2008-07-10  6:12                   ` Doug Kwan (關振德)
2008-07-12 18:26                     ` Doug Kwan (關振德)
2008-07-13 18:23                       ` Mark Mitchell
2008-07-13 20:25                         ` Doug Kwan (關振德)
2008-07-14  0:44                           ` Mark Mitchell
2008-07-14  7:07                             ` Doug Kwan (關振德)
2008-07-14 19:45                               ` Mark Mitchell
2008-07-14 20:19                                 ` Doug Kwan (關振德)
2008-07-14 21:38                                   ` Doug Kwan (關振德)
2008-06-29 19:51     ` Andreas Schwab
2008-06-29 20:53       ` Doug Kwan (關振德)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).