1/* Definitions for Renesas M32R running Linux-based GNU systems using ELF.
2   Copyright (C) 2003-2020 Free Software Foundation, Inc.
3
4   This file is part of GCC.
5
6   GCC is free software; you can redistribute it and/or modify it
7   under the terms of the GNU General Public License as published
8   by the Free Software Foundation; either version 3, or (at your
9   option) any later version.
10
11   GCC is distributed in the hope that it will be useful, but WITHOUT
12   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14   License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with GCC; see the file COPYING3.  If not see
18   <http://www.gnu.org/licenses/>.  */
19
20#undef  SIZE_TYPE
21#define SIZE_TYPE "unsigned int"
22
23#undef  PTRDIFF_TYPE
24#define PTRDIFF_TYPE "int"
25
26#undef  WCHAR_TYPE
27#define WCHAR_TYPE "long int"
28
29#undef  WCHAR_TYPE_SIZE
30#define WCHAR_TYPE_SIZE BITS_PER_WORD
31
32/* Provide a LINK_SPEC appropriate for Linux.  Here we provide support
33   for the special GCC options -static and -shared, which allow us to
34   link things in one of these three modes by applying the appropriate
35   combinations of options at link-time.
36
37   When the -shared link option is used a final link is not being
38   done.  */
39
40#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
41
42#undef	LINK_SPEC
43#if TARGET_LITTLE_ENDIAN
44#define LINK_SPEC "%(link_cpu) -m m32rlelf_linux %{shared:-shared} \
45  %{!shared: \
46    %{!static: \
47      %{rdynamic:-export-dynamic} \
48      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
49      %{static:-static}}"
50#else
51#define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \
52  %{!shared: \
53    %{!static: \
54      %{rdynamic:-export-dynamic} \
55      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
56      %{static:-static}}"
57#endif
58
59#undef	LIB_SPEC
60#define LIB_SPEC \
61  "%{pthread:-lpthread} \
62   %{shared: -lc} \
63   %{!shared: \
64       %{mieee-fp:-lieee} \
65       %{profile:-lc_p} %{!profile: -lc}}"
66
67#undef  STARTFILE_SPEC
68#if defined HAVE_LD_PIE
69#define STARTFILE_SPEC \
70  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
71   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
72#else
73#define STARTFILE_SPEC \
74  "%{!shared: \
75     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
76   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
77#endif
78
79#undef  ENDFILE_SPEC
80#define ENDFILE_SPEC \
81  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
82
83#undef  SUBTARGET_CPP_SPEC
84#define SUBTARGET_CPP_SPEC "\
85   %{posix:-D_POSIX_SOURCE} \
86   %{pthread:-D_REENTRANT -D_PTHREADS} \
87"
88
89#define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
90
91#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
92