1169689Skan/* Configuration file for ARM GNU/Linux EABI targets.
2169689Skan   Copyright (C) 2004, 2005, 2006
3169689Skan   Free Software Foundation, Inc.
4169689Skan   Contributed by CodeSourcery, LLC
5169689Skan
6169689Skan   This file is part of GCC.
7169689Skan
8169689Skan   GCC is free software; you can redistribute it and/or modify it
9169689Skan   under the terms of the GNU General Public License as published
10169689Skan   by the Free Software Foundation; either version 2, or (at your
11169689Skan   option) any later version.
12169689Skan
13169689Skan   GCC is distributed in the hope that it will be useful, but WITHOUT
14169689Skan   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15169689Skan   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16169689Skan   License for more details.
17169689Skan
18169689Skan   You should have received a copy of the GNU General Public License
19169689Skan   along with GCC; see the file COPYING.  If not, write to
20169689Skan   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21169689Skan   Boston, MA 02110-1301, USA.  */
22169689Skan
23169689Skan/* On EABI GNU/Linux, we want both the BPABI builtins and the
24169689Skan   GNU/Linux builtins.  */
25169689Skan#undef TARGET_OS_CPP_BUILTINS
26169689Skan#define TARGET_OS_CPP_BUILTINS() 		\
27169689Skan  do 						\
28169689Skan    {						\
29169689Skan      TARGET_BPABI_CPP_BUILTINS();		\
30169689Skan      LINUX_TARGET_OS_CPP_BUILTINS();		\
31169689Skan    }						\
32169689Skan  while (false)
33169689Skan
34169689Skan/* We default to a soft-float ABI so that binaries can run on all
35169689Skan   target hardware.  */
36169689Skan#undef TARGET_DEFAULT_FLOAT_ABI
37169689Skan#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
38169689Skan
39169689Skan/* We default to the "aapcs-linux" ABI so that enums are int-sized by
40169689Skan   default.  */
41169689Skan#undef ARM_DEFAULT_ABI
42169689Skan#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
43169689Skan
44169689Skan/* Default to armv5t so that thumb shared libraries work.
45169689Skan   The ARM10TDMI core is the default for armv5t, so set
46169689Skan   SUBTARGET_CPU_DEFAULT to achieve this.  */
47169689Skan#undef SUBTARGET_CPU_DEFAULT
48169689Skan#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
49169689Skan
50169689Skan#undef SUBTARGET_EXTRA_LINK_SPEC
51169689Skan#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
52169689Skan
53169689Skan/* Use ld-linux.so.3 so that it will be possible to run "classic"
54169689Skan   GNU/Linux binaries on an EABI system.  */
55169689Skan#undef GLIBC_DYNAMIC_LINKER
56169689Skan#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
57169689Skan
58169689Skan/* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
59169689Skan   use the GNU/Linux version, not the generic BPABI version.  */
60169689Skan#undef LINK_SPEC
61169689Skan#define LINK_SPEC LINUX_TARGET_LINK_SPEC
62169689Skan
63169689Skan/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
64169689Skan   do not use -lfloat.  */
65169689Skan#undef LIBGCC_SPEC
66169689Skan
67169689Skan/* Use the AAPCS type for wchar_t, or the previous Linux default for
68169689Skan   non-AAPCS.  */
69169689Skan#undef WCHAR_TYPE
70169689Skan#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int")
71169689Skan
72169689Skan/* Clear the instruction cache from `beg' to `end'.  This makes an
73169689Skan   inline system call to SYS_cacheflush.  It is modified to work with
74169689Skan   both the original and EABI-only syscall interfaces.  */
75169689Skan#undef CLEAR_INSN_CACHE
76169689Skan#define CLEAR_INSN_CACHE(BEG, END)					\
77169689Skan{									\
78169689Skan  register unsigned long _beg __asm ("a1") = (unsigned long) (BEG);	\
79169689Skan  register unsigned long _end __asm ("a2") = (unsigned long) (END);	\
80169689Skan  register unsigned long _flg __asm ("a3") = 0;				\
81169689Skan  register unsigned long _scno __asm ("r7") = 0xf0002;			\
82169689Skan  __asm __volatile ("swi 0x9f0002		@ sys_cacheflush"	\
83169689Skan		    : "=r" (_beg)					\
84169689Skan		    : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno));	\
85169689Skan}
86