xref: /openbsd/gnu/gcc/gcc/config/frv/linux.h (revision 404b540a)
1*404b540aSrobert /* Target macros for the FRV Linux port of GCC.
2*404b540aSrobert    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006
3*404b540aSrobert    Free Software Foundation, Inc.
4*404b540aSrobert    Contributed by Red Hat Inc.
5*404b540aSrobert 
6*404b540aSrobert    This file is part of GCC.
7*404b540aSrobert 
8*404b540aSrobert    GCC is free software; you can redistribute it and/or modify it
9*404b540aSrobert    under the terms of the GNU General Public License as published
10*404b540aSrobert    by the Free Software Foundation; either version 2, or (at your
11*404b540aSrobert    option) any later version.
12*404b540aSrobert 
13*404b540aSrobert    GCC is distributed in the hope that it will be useful, but WITHOUT
14*404b540aSrobert    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15*404b540aSrobert    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
16*404b540aSrobert    License for more details.
17*404b540aSrobert 
18*404b540aSrobert    You should have received a copy of the GNU General Public License
19*404b540aSrobert    along with GCC; see the file COPYING.  If not, write to the Free
20*404b540aSrobert    Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
21*404b540aSrobert    02110-1301, USA.  */
22*404b540aSrobert 
23*404b540aSrobert #ifndef __FRV_LINUX_H__
24*404b540aSrobert #define __FRV_LINUX_H__
25*404b540aSrobert 
26*404b540aSrobert #undef SUBTARGET_DRIVER_SELF_SPECS
27*404b540aSrobert #define SUBTARGET_DRIVER_SELF_SPECS \
28*404b540aSrobert   "%{!mno-fdpic:-mfdpic}",
29*404b540aSrobert 
30*404b540aSrobert #undef STARTFILE_SPEC
31*404b540aSrobert #define STARTFILE_SPEC \
32*404b540aSrobert   "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
33*404b540aSrobert    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
34*404b540aSrobert 
35*404b540aSrobert #undef ENDFILE_SPEC
36*404b540aSrobert #define ENDFILE_SPEC \
37*404b540aSrobert   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
38*404b540aSrobert 
39*404b540aSrobert #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
40*404b540aSrobert 
41*404b540aSrobert #undef LINK_SPEC
42*404b540aSrobert #define LINK_SPEC "\
43*404b540aSrobert   %{mfdpic: -m elf32frvfd -z text} %{shared} %{pie} \
44*404b540aSrobert   %{!shared: %{!static: \
45*404b540aSrobert    %{rdynamic:-export-dynamic} \
46*404b540aSrobert    %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
47*404b540aSrobert    %{static}}"
48*404b540aSrobert 
49*404b540aSrobert /* Support for compile-time default CPU.  */
50*404b540aSrobert #define OPTION_DEFAULT_SPECS \
51*404b540aSrobert   {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }
52*404b540aSrobert 
53*404b540aSrobert /* Define OS-specific predefined preprocessor macros.  */
54*404b540aSrobert #define TARGET_OS_CPP_BUILTINS()	\
55*404b540aSrobert   do {					\
56*404b540aSrobert     builtin_define ("__gnu_linux__");	\
57*404b540aSrobert     builtin_define_std ("linux");	\
58*404b540aSrobert     builtin_define_std ("unix");	\
59*404b540aSrobert     builtin_assert ("system=linux");	\
60*404b540aSrobert   } while (0)
61*404b540aSrobert 
62*404b540aSrobert #define HAS_INIT_SECTION 1
63*404b540aSrobert #define INIT_SECTION_ASM_OP	"\t.section .init,\"ax\""
64*404b540aSrobert #define FINI_SECTION_ASM_OP	"\t.section .fini,\"ax\""
65*404b540aSrobert 
66*404b540aSrobert #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)	\
67*404b540aSrobert asm (SECTION_OP); \
68*404b540aSrobert asm ("ldi.p @(fp,4), gr15 ! call " #FUNC); \
69*404b540aSrobert asm (TEXT_SECTION_ASM_OP);
70*404b540aSrobert 
71*404b540aSrobert #undef INVOKE__main
72*404b540aSrobert 
73*404b540aSrobert #undef Twrite
74*404b540aSrobert #define Twrite __write
75*404b540aSrobert 
76*404b540aSrobert #endif /* __FRV_LINUX_H__ */
77