linux-eabi.h revision 169690
1193850Strasz/* Configuration file for ARM GNU/Linux EABI targets.
2216413Strasz   Copyright (C) 2004, 2005, 2006
3193850Strasz   Free Software Foundation, Inc.
4193850Strasz   Contributed by CodeSourcery, LLC
5193850Strasz
6193850Strasz   This file is part of GCC.
7193850Strasz
8193850Strasz   GCC is free software; you can redistribute it and/or modify it
9193850Strasz   under the terms of the GNU General Public License as published
10193850Strasz   by the Free Software Foundation; either version 2, or (at your
11193850Strasz   option) any later version.
12193850Strasz
13193850Strasz   GCC is distributed in the hope that it will be useful, but WITHOUT
14193850Strasz   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15193850Strasz   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16193850Strasz   License for more details.
17193850Strasz
18193850Strasz   You should have received a copy of the GNU General Public License
19193850Strasz   along with GCC; see the file COPYING.  If not, write to
20193850Strasz   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21193850Strasz   Boston, MA 02110-1301, USA.  */
22193850Strasz
23193850Strasz/* On EABI GNU/Linux, we want both the BPABI builtins and the
24193850Strasz   GNU/Linux builtins.  */
25193850Strasz#undef TARGET_OS_CPP_BUILTINS
26193850Strasz#define TARGET_OS_CPP_BUILTINS() 		\
27193850Strasz  do 						\
28193850Strasz    {						\
29193850Strasz      TARGET_BPABI_CPP_BUILTINS();		\
30193850Strasz      LINUX_TARGET_OS_CPP_BUILTINS();		\
31193850Strasz    }						\
32193850Strasz  while (false)
33193850Strasz
34193850Strasz/* We default to a soft-float ABI so that binaries can run on all
35193850Strasz   target hardware.  */
36193850Strasz#undef TARGET_DEFAULT_FLOAT_ABI
37193850Strasz#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
38232936Sadrian
39232936Sadrian/* We default to the "aapcs-linux" ABI so that enums are int-sized by
40193850Strasz   default.  */
41193850Strasz#undef ARM_DEFAULT_ABI
42193850Strasz#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
43193850Strasz
44193850Strasz/* Default to armv5t so that thumb shared libraries work.
45193850Strasz   The ARM10TDMI core is the default for armv5t, so set
46216413Strasz   SUBTARGET_CPU_DEFAULT to achieve this.  */
47193850Strasz#undef SUBTARGET_CPU_DEFAULT
48193850Strasz#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
49193850Strasz
50193850Strasz#undef SUBTARGET_EXTRA_LINK_SPEC
51193850Strasz#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
52193850Strasz
53193850Strasz/* Use ld-linux.so.3 so that it will be possible to run "classic"
54193850Strasz   GNU/Linux binaries on an EABI system.  */
55193850Strasz#undef GLIBC_DYNAMIC_LINKER
56216413Strasz#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
57216413Strasz
58219878Strasz/* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
59219878Strasz   use the GNU/Linux version, not the generic BPABI version.  */
60219878Strasz#undef LINK_SPEC
61219878Strasz#define LINK_SPEC LINUX_TARGET_LINK_SPEC
62219880Strasz
63216413Strasz/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
64216413Strasz   do not use -lfloat.  */
65219880Strasz#undef LIBGCC_SPEC
66216413Strasz
67197405Strasz/* Use the AAPCS type for wchar_t, or the previous Linux default for
68197405Strasz   non-AAPCS.  */
69197405Strasz#undef WCHAR_TYPE
70197405Strasz#define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int")
71197405Strasz
72197405Strasz/* Clear the instruction cache from `beg' to `end'.  This makes an
73197405Strasz   inline system call to SYS_cacheflush.  It is modified to work with
74197405Strasz   both the original and EABI-only syscall interfaces.  */
75197405Strasz#undef CLEAR_INSN_CACHE
76197405Strasz#define CLEAR_INSN_CACHE(BEG, END)					\
77197405Strasz{									\
78197405Strasz  register unsigned long _beg __asm ("a1") = (unsigned long) (BEG);	\
79197405Strasz  register unsigned long _end __asm ("a2") = (unsigned long) (END);	\
80197405Strasz  register unsigned long _flg __asm ("a3") = 0;				\
81197405Strasz  register unsigned long _scno __asm ("r7") = 0xf0002;			\
82197405Strasz  __asm __volatile ("swi 0x9f0002		@ sys_cacheflush"	\
83197405Strasz		    : "=r" (_beg)					\
84197405Strasz		    : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno));	\
85197405Strasz}
86193850Strasz