public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386, Android] Add Android support for i386 target
@ 2012-04-16 15:34 Ilya Enkovich
  2012-04-16 15:38 ` H.J. Lu
  0 siblings, 1 reply; 12+ messages in thread
From: Ilya Enkovich @ 2012-04-16 15:34 UTC (permalink / raw)
  To: gcc-patches, Maxim Kuvyrkov

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

Hello,

Here is patch for i386 Android support. It is the second part of
previously splitted patch
(http://gcc.gnu.org/ml/gcc-patches/2012-04/msg00127.html). The first
part has been committed
(http://gcc.gnu.org/ml/gcc-cvs/2012-04/msg00378.html). Bootstrapped
and checked on linux-x86_64. OK for trunk?

Thanks,
Ilya
---
2012-04-16  Enkovich Ilya  <ilya.enkovich@intel.com>

	* config/i386/linux-common.h: New.

	* config.gcc: Add i386/linux-common.h before
	all i386/linux.h and i386/linux64.h usages.

	* config/i386/gnu-user.h (GNU_USER_TARGET_LINK_SPEC): New.
	(LINK_SPEC): Use GNU_USER_TARGET_LINK_SPEC.
	* config/i386/gnu-user64.h: Likewise.

	* config/i386/gnu-user.common.h (GNU_USER_TARGET_CC1_SPEC): New.
	(CC1_SPEC): Use GNU_USER_TARGET_CC1_SPEC.
	(GNU_USER_TARGET_MATHFILE_SPEC): New.
	(ENDFILE_SPEC): Use GNU_USER_TARGET_MATHFILE_SPEC.

[-- Attachment #2: mandroid.patch --]
[-- Type: application/octet-stream, Size: 6656 bytes --]

diff --git a/gcc/config.gcc b/gcc/config.gcc
index bf3b2c3..63d6612 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1228,7 +1228,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
 		# Assume modern glibc
 		default_gnu_indirect_function=yes
 		if test x$enable_targets = xall; then
-			tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux64.h"
+			tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
 			tm_defines="${tm_defines} TARGET_BI_ARCH=1"
 			tmake_file="${tmake_file} i386/t-linux64"
 			x86_multilibs="${with_multilib_list}"
@@ -1263,7 +1263,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i
 				;;
 			esac
 		else
-			tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux.h"
+			tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
 		fi
 		;;
 	i[34567]86-*-knetbsd*-gnu)
@@ -1285,7 +1285,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
 		 i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
 	case ${target} in
 	x86_64-*-linux*)
-		tm_file="${tm_file} linux.h i386/linux64.h"
+		tm_file="${tm_file} linux.h i386/linux-common.h i386/linux64.h"
 		# Assume modern glibc
 		default_gnu_indirect_function=yes
 	  	;;
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index 6ca954d..5554936 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -39,17 +39,23 @@ along with GCC; see the file COPYING3.  If not see
 #undef CPP_SPEC
 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
 
+#undef GNU_USER_TARGET_CC1_SPEC
+#define GNU_USER_TARGET_CC1_SPEC "%(cc1_cpu) %{profile:-p}"
+
 #undef CC1_SPEC
-#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
+#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC
 
 /* Similar to standard GNU userspace, but adding -ffast-math support.  */
-#undef  ENDFILE_SPEC
-#define ENDFILE_SPEC \
+#define GNU_USER_TARGET_MATHFILE_SPEC \
   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
    %{mpc32:crtprec32.o%s} \
    %{mpc64:crtprec64.o%s} \
-   %{mpc80:crtprec80.o%s} \
-   %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+   %{mpc80:crtprec80.o%s}"
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  GNU_USER_TARGET_MATHFILE_SPEC " " \
+  GNU_USER_TARGET_ENDFILE_SPEC
 
 /* Put all *tf routines in libgcc.  */
 #undef LIBGCC2_HAS_TF_MODE
diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
index 3b48b00..9020be9 100644
--- a/gcc/config/i386/gnu-user.h
+++ b/gcc/config/i386/gnu-user.h
@@ -75,14 +75,16 @@ along with GCC; see the file COPYING3.  If not see
   { "link_emulation", GNU_USER_LINK_EMULATION },\
   { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
 
-#undef	LINK_SPEC
-#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
+#define GNU_USER_TARGET_LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
       -dynamic-linker %(dynamic_linker)} \
       %{static:-static}}"
 
+#undef	LINK_SPEC
+#define LINK_SPEC GNU_USER_TARGET_LINK_SPEC
+
 /* A C statement (sans semicolon) to output to the stdio stream
    FILE the assembler definition of uninitialized global DECL named
    NAME whose size is SIZE bytes and alignment is ALIGN bytes.
diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
index 1ec5e20..0e66d26 100644
--- a/gcc/config/i386/gnu-user64.h
+++ b/gcc/config/i386/gnu-user64.h
@@ -53,8 +53,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
  %{" SPEC_X32 ":--x32} \
  %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
 
-#undef	LINK_SPEC
-#define LINK_SPEC "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
+#define GNU_USER_TARGET_LINK_SPEC				   \
+                  "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
                    %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
                    %{" SPEC_X32 ":-m " GNU_USER_LINK_EMULATIONX32 "} \
   %{shared:-shared} \
@@ -66,6 +66,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
       %{" SPEC_X32 ":-dynamic-linker " GNU_USER_DYNAMIC_LINKERX32 "}} \
     %{static:-static}}"
 
+#undef	LINK_SPEC
+#define LINK_SPEC GNU_USER_TARGET_LINK_SPEC
+
 #if TARGET_64BIT_DEFAULT
 #if TARGET_BI_ARCH == 2
 #define MULTILIB_DEFAULTS { "mx32" }
diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
new file mode 100644
index 0000000..fd53b32
--- /dev/null
+++ b/gcc/config/i386/linux-common.h
@@ -0,0 +1,55 @@
+/* Definitions for Intel 386 running Linux-based GNU systems with ELF format.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+   Contributed by Ilya Enkovich.
+
+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/>.  */
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      GNU_USER_TARGET_OS_CPP_BUILTINS();       \
+      ANDROID_TARGET_OS_CPP_BUILTINS();	       \
+    }                                          \
+  while (0)
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+  LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+		       GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
+
+#undef	LINK_SPEC
+#define LINK_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LINK_SPEC, \
+		       GNU_USER_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
+#undef  LIB_SPEC
+#define LIB_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
+		       GNU_USER_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC)
+
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, \
+		       ANDROID_STARTFILE_SPEC)
+
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC \
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_MATHFILE_SPEC " " \
+		       GNU_USER_TARGET_ENDFILE_SPEC,	 \
+		       GNU_USER_TARGET_MATHFILE_SPEC " " \
+		       ANDROID_ENDFILE_SPEC)

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

end of thread, other threads:[~2012-04-18  8:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 15:34 [PATCH, i386, Android] Add Android support for i386 target Ilya Enkovich
2012-04-16 15:38 ` H.J. Lu
2012-04-16 16:01   ` Ilya Enkovich
2012-04-16 16:06     ` H.J. Lu
2012-04-16 16:08       ` Ilya Enkovich
2012-04-16 16:15         ` H.J. Lu
2012-04-17 10:16           ` Ilya Enkovich
2012-04-17 13:16             ` Uros Bizjak
2012-04-17 13:22               ` Uros Bizjak
2012-04-17 14:32                 ` Ilya Enkovich
2012-04-17 19:49                   ` Maxim Kuvyrkov
2012-04-18  8:33                     ` Kirill Yukhin

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).