]> gcc.gnu.org Git - gcc.git/commitdiff
config.gcc: Add arm*-*-uclinux-*eabi.
authorPaul Brook <paul@codesourcery.com>
Wed, 14 Feb 2007 00:29:52 +0000 (00:29 +0000)
committerPaul Brook <pbrook@gcc.gnu.org>
Wed, 14 Feb 2007 00:29:52 +0000 (00:29 +0000)
2007-02-13  Paul Brook  <paul@codesourcery.com>

gcc/
* config.gcc: Add arm*-*-uclinux-*eabi.
* config/arm/uclinux-elf.h (TARGET_OS_CPP_BUILTINS): Define.
(SUBTARGET_EXTRA_LINK_SPEC): Define.
(STARTFILE_SPEC, ENDFILE_SPEC): Remove broken -shared handling.
(LINK_GCC_C_SEQUENCE_SPEC): Undef.
(LINK_SPEC): Define.
(LIB_SPEC): Define.
* config/arm/arm.c (arm_override_options): Use r9 as EABI PIC
register.
* config/arm/uclinux-eabi.h: New file.
* config/arm/linux-eabi.h (WCHAR_TYPE): Remove.
* config/arm/linux-gas.h (WCHAR_TYPE): Use unsigned long on AAPCS
based targets.

From-SVN: r121902

gcc/ChangeLog
gcc/config.gcc
gcc/config/arm/arm.c
gcc/config/arm/linux-eabi.h
gcc/config/arm/linux-gas.h
gcc/config/arm/uclinux-eabi.h [new file with mode: 0644]
gcc/config/arm/uclinux-elf.h

index 4c6f08466c6ac4233b8db461a21e175e15e07ba7..647cff1daf76dfe6dd3637000a2e3a1daed1fe70 100644 (file)
@@ -1,3 +1,19 @@
+2007-02-13  Paul Brook  <paul@codesourcery.com>
+
+       * config.gcc: Add arm*-*-uclinux-*eabi.
+       * config/arm/uclinux-elf.h (TARGET_OS_CPP_BUILTINS): Define.
+       (SUBTARGET_EXTRA_LINK_SPEC): Define.
+       (STARTFILE_SPEC, ENDFILE_SPEC): Remove broken -shared handling.
+       (LINK_GCC_C_SEQUENCE_SPEC): Undef.
+       (LINK_SPEC): Define.
+       (LIB_SPEC): Define.
+       * config/arm/arm.c (arm_override_options): Use r9 as EABI PIC
+       register.
+       * config/arm/uclinux-eabi.h: New file.
+       * config/arm/linux-eabi.h (WCHAR_TYPE): Remove.
+       * config/arm/linux-gas.h (WCHAR_TYPE): Use unsigned long on AAPCS
+       based targets.
+
 2007-02-13  Ian Lance Taylor  <iant@google.com>
 
        * common.opt: Add Wstrict-overflow and Wstrict-overflow=.
index de39b9edeabc68b1f65574f6e22f227c90eeb21d..877d25c18428a0433334746725253b5f3fb9ef33 100644 (file)
@@ -731,8 +731,20 @@ arm*-*-linux*)                     # ARM GNU/Linux with ELF
        tm_file="$tm_file arm/aout.h arm/arm.h"
        ;;
 arm*-*-uclinux*)               # ARM ucLinux
-       tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h arm/uclinux-elf.h"
+       tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h arm/uclinux-elf.h"
        tmake_file="arm/t-arm arm/t-arm-elf"
+       case ${target} in
+       arm*-*-uclinux-*eabi)
+           tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h"
+           tmake_file="$tmake_file arm/t-bpabi"
+           # The BPABI long long divmod functions return a 128-bit value in
+           # registers r0-r3.  Correctly modeling that requires the use of
+           # TImode.
+           need_64bit_hwint=yes
+           # The EABI requires the use of __cxa_atexit.
+           default_use_cxa_atexit=yes
+       esac
+       tm_file="$tm_file arm/aout.h arm/arm.h"
        ;;
 arm*-*-ecos-elf)
        tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/ecos-elf.h"
index c342f2fdac2811973b581c9a5be950118b6d6bd3..78f6d729803b7265064212b89d35f10b64036959 100644 (file)
@@ -1145,11 +1145,6 @@ arm_override_options (void)
       && (TARGET_DEFAULT & MASK_APCS_FRAME))
     warning (0, "-g with -mno-apcs-frame may not give sensible debugging");
 
-  /* If stack checking is disabled, we can use r10 as the PIC register,
-     which keeps r9 available.  */
-  if (flag_pic && TARGET_SINGLE_PIC_BASE)
-    arm_pic_register = TARGET_APCS_STACK ? 9 : 10;
-
   if (TARGET_APCS_FLOAT)
     warning (0, "passing floating point arguments in fp regs not yet supported");
 
@@ -1343,6 +1338,11 @@ arm_override_options (void)
                 ARM_DOUBLEWORD_ALIGN ? "8, 32 or 64": "8 or 32");
     }
 
+  /* If stack checking is disabled, we can use r10 as the PIC register,
+     which keeps r9 available.  The EABI specifies r9 as the PIC register.  */
+  if (flag_pic && TARGET_SINGLE_PIC_BASE)
+    arm_pic_register = (TARGET_APCS_STACK || TARGET_AAPCS_BASED) ? 9 : 10;
+
   if (arm_pic_register_string != NULL)
     {
       int pic_register = decode_reg_name (arm_pic_register_string);
index 6612f742bf86510aa55e0bcd13adf65af6e9b3de..7215c0e94041ce54e31c8a0da07bd0eb42bd6677 100644 (file)
    do not use -lfloat.  */
 #undef LIBGCC_SPEC
 
-/* Use the AAPCS type for wchar_t, or the previous Linux default for
-   non-AAPCS.  */
-#undef WCHAR_TYPE
-#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int")
-
 /* Clear the instruction cache from `beg' to `end'.  This makes an
    inline system call to SYS_cacheflush.  It is modified to work with
    both the original and EABI-only syscall interfaces.  */
index 0544eb0418710c2368d1481b3f9fce021cca0c6d..715d2a575a3fce715fb02398bbd25e69d0190c15 100644 (file)
 #undef  PTRDIFF_TYPE
 #define PTRDIFF_TYPE "int"
 
-#undef  WCHAR_TYPE
-#define WCHAR_TYPE "long int"
+/* Use the AAPCS type for wchar_t, or the previous Linux default for
+   non-AAPCS.  */
+#undef WCHAR_TYPE
+#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int")
 
 #undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE BITS_PER_WORD
diff --git a/gcc/config/arm/uclinux-eabi.h b/gcc/config/arm/uclinux-eabi.h
new file mode 100644 (file)
index 0000000..3806bf9
--- /dev/null
@@ -0,0 +1,66 @@
+/* Definitions for ARM EABI ucLinux
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   Contributed by Paul Brook <paul@codesourcery.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 2, 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 this program; see the file COPYING.  If not, write to
+   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* Override settings that are different to the uclinux-elf or
+   bpabi defaults.  */
+
+#undef  TARGET_DEFAULT
+#define TARGET_DEFAULT (MASK_SINGLE_PIC_BASE | MASK_INTERWORK)
+
+/* On EABI GNU/Linux, we want both the BPABI builtins and the
+   GNU/Linux builtins.  */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      TARGET_BPABI_CPP_BUILTINS();             \
+      builtin_define ("__uClinux__");          \
+      builtin_define ("__gnu_linux__");         \
+      builtin_define_std ("linux");             \
+      builtin_define_std ("unix");              \
+      builtin_assert ("system=linux");          \
+      builtin_assert ("system=unix");           \
+      builtin_assert ("system=posix");          \
+    }                                          \
+  while (false)
+
+#undef SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
+
+/* We default to the "aapcs-linux" ABI so that enums are int-sized by
+   default.  */
+#undef ARM_DEFAULT_ABI
+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
+
+/* Clear the instruction cache from `beg' to `end'.  This makes an
+   inline system call to SYS_cacheflush.  */
+#undef CLEAR_INSN_CACHE
+#define CLEAR_INSN_CACHE(BEG, END)                                     \
+{                                                                      \
+  register unsigned long _beg __asm ("a1") = (unsigned long) (BEG);    \
+  register unsigned long _end __asm ("a2") = (unsigned long) (END);    \
+  register unsigned long _flg __asm ("a3") = 0;                                \
+  register unsigned long _scno __asm ("r7") = 0xf0002;                 \
+  __asm __volatile ("swi 0x0           @ sys_cacheflush"               \
+                   : "=r" (_beg)                                       \
+                   : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno)); \
+}
+
index 9f112cddaa28c62ea0b9664ea9ba640ea5398247..d6dc4f60bdfbd5eff7edf56409dd2df874d3dc87 100644 (file)
 /* NOTE: The remaining definitions in this file are needed because uclinux
    does not use config/linux.h.  */
 
+/* Add GNU/Linux builtins.  */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      builtin_define ("__uClinux__");          \
+      builtin_define ("__gnu_linux__");         \
+      builtin_define_std ("linux");             \
+      builtin_define_std ("unix");              \
+      builtin_assert ("system=linux");          \
+      builtin_assert ("system=unix");           \
+      builtin_assert ("system=posix");          \
+    }                                          \
+  while (false)
+
 /* Do not assume anything about header files.  */
 #define NO_IMPLICIT_EXTERN_C
 
 #undef CPLUSPLUS_CPP_SPEC
 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
 
-/* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
-   the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
-   provides part of the support for getting C++ file-scope static
-   object constructed before entering `main'.  */
+#undef SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux"
 
+/* Now we define the strings used to build the spec file.  */
 #undef  STARTFILE_SPEC
-#define STARTFILE_SPEC \
-  "%{!shared: \
-     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-                      %{!p:%{profile:gcrt1.o%s} \
-                        %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
-   the GNU/Linux magical crtend.o file (see crtstuff.c) which
-   provides part of the support for getting C++ file-scope static
-   object constructed before entering `main', followed by a normal
-   GNU/Linux "finalizer" file, `crtn.o'.  */
+#define STARTFILE_SPEC "crt1%O%s crti%O%s crtbegin%O%s"
 
 #undef  ENDFILE_SPEC
-#define ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+#define ENDFILE_SPEC   "crtend%O%s crtn%O%s"
 
 #undef  CC1_SPEC
 #define CC1_SPEC "%{profile:-p}"
 
+#undef LINK_GCC_C_SEQUENCE_SPEC
 #define LINK_GCC_C_SEQUENCE_SPEC \
   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
 
 #ifdef HAVE_LD_AS_NEEDED
 #define USE_LD_AS_NEEDED 1
 #endif
+
+#undef LINK_SPEC
+#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X -elf2flt"
+
+#undef  LIB_SPEC
+#define LIB_SPEC \
+  "%{pthread:-lpthread} \
+   %{shared:-lc} \
+   %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
This page took 0.109564 seconds and 5 git commands to generate.