1 |
12 |
jlechner |
/* Target macros for the FRV Linux port of GCC.
|
2 |
|
|
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
|
3 |
|
|
Free Software Foundation, Inc.
|
4 |
|
|
Contributed by Red Hat Inc.
|
5 |
|
|
|
6 |
|
|
This file is part of GCC.
|
7 |
|
|
|
8 |
|
|
GCC is free software; you can redistribute it and/or modify it
|
9 |
|
|
under the terms of the GNU General Public License as published
|
10 |
|
|
by the Free Software Foundation; either version 2, or (at your
|
11 |
|
|
option) any later version.
|
12 |
|
|
|
13 |
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT
|
14 |
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
15 |
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
16 |
|
|
License for more details.
|
17 |
|
|
|
18 |
|
|
You should have received a copy of the GNU General Public License
|
19 |
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
20 |
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
21 |
|
|
02110-1301, USA. */
|
22 |
|
|
|
23 |
|
|
#ifndef __FRV_LINUX_H__
|
24 |
|
|
#define __FRV_LINUX_H__
|
25 |
|
|
|
26 |
|
|
#undef SUBTARGET_DRIVER_SELF_SPECS
|
27 |
|
|
#define SUBTARGET_DRIVER_SELF_SPECS \
|
28 |
|
|
"%{!mno-fdpic:-mfdpic}",
|
29 |
|
|
|
30 |
|
|
#undef STARTFILE_SPEC
|
31 |
|
|
#define STARTFILE_SPEC \
|
32 |
|
|
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
|
33 |
|
|
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
|
34 |
|
|
|
35 |
|
|
#undef ENDFILE_SPEC
|
36 |
|
|
#define ENDFILE_SPEC \
|
37 |
|
|
"%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
|
38 |
|
|
|
39 |
|
|
#undef LINK_SPEC
|
40 |
|
|
#define LINK_SPEC "\
|
41 |
|
|
%{mfdpic: -m elf32frvfd -z text} %{shared} %{pie} \
|
42 |
|
|
%{!shared: %{!static: \
|
43 |
|
|
%{rdynamic:-export-dynamic} \
|
44 |
|
|
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
|
45 |
|
|
%{static}}"
|
46 |
|
|
|
47 |
|
|
/* Support for compile-time default CPU. */
|
48 |
|
|
#define OPTION_DEFAULT_SPECS \
|
49 |
|
|
{"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }
|
50 |
|
|
|
51 |
|
|
/* Define OS-specific predefined preprocessor macros. */
|
52 |
|
|
#define TARGET_OS_CPP_BUILTINS() \
|
53 |
|
|
do { \
|
54 |
|
|
builtin_define ("__gnu_linux__"); \
|
55 |
|
|
builtin_define_std ("linux"); \
|
56 |
|
|
builtin_define_std ("unix"); \
|
57 |
|
|
builtin_assert ("system=linux"); \
|
58 |
|
|
} while (0)
|
59 |
|
|
|
60 |
|
|
#define HAS_INIT_SECTION 1
|
61 |
|
|
#define INIT_SECTION_ASM_OP "\t.section .init,\"ax\""
|
62 |
|
|
#define FINI_SECTION_ASM_OP "\t.section .fini,\"ax\""
|
63 |
|
|
|
64 |
|
|
#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
|
65 |
|
|
asm (SECTION_OP); \
|
66 |
|
|
asm ("ldi.p @(fp,4), gr15 ! call " #FUNC); \
|
67 |
|
|
asm (TEXT_SECTION_ASM_OP);
|
68 |
|
|
|
69 |
|
|
#undef INVOKE__main
|
70 |
|
|
|
71 |
|
|
#undef Twrite
|
72 |
|
|
#define Twrite __write
|
73 |
|
|
|
74 |
|
|
/* uClibc doesn't support many of the C90-reserved C99-defined math
|
75 |
|
|
functions. Make sure we don't implicitly generate them unless C99
|
76 |
|
|
support is explicitly requested. This will affect both frv-linux
|
77 |
|
|
and frv-uclinux. Even though the glibc, the primary library for
|
78 |
|
|
frv-linux, would enable better code to be generated with
|
79 |
|
|
TARGET_C99_FUNCTIONS defined to 1, uClinux can be used as the
|
80 |
|
|
library for frv-linux as well, and we'd better have that work
|
81 |
|
|
correctly. Maybe we move this to a uclibc.h header in the future,
|
82 |
|
|
and use that for frv-uclinux and frv-linux-uclibc? Define it here
|
83 |
|
|
for now, such that we can still get exactly the same code out of
|
84 |
|
|
both frv-linux-gcc and frv-uclinux-gcc, when feeding them the same
|
85 |
|
|
preprocessed sources. */
|
86 |
|
|
#undef TARGET_C99_FUNCTIONS
|
87 |
|
|
#define TARGET_C99_FUNCTIONS 0
|
88 |
|
|
|
89 |
|
|
#endif /* __FRV_LINUX_H__ */
|