xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/tilegx/linux.h (revision 75f6d617e282811cb173c2ccfbf5df0dd71f7045)
1 /* Definitions for TILE-Gx running Linux-based GNU systems with ELF.
2    Copyright (C) 2011-2013 Free Software Foundation, Inc.
3    Contributed by Walter Lee (walt@tilera.com)
4 
5    This file is part of GCC.
6 
7    GCC is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published
9    by the Free Software Foundation; either version 3, or (at your
10    option) any later version.
11 
12    GCC is distributed in the hope that it will be useful, but WITHOUT
13    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15    License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with GCC; see the file COPYING3.  If not see
19    <http://www.gnu.org/licenses/>.  */
20 
21 #undef CPP_SPEC
22 #define CPP_SPEC "%{pthread:-D_REENTRANT}"
23 
24 #undef ASM_SPEC
25 #define ASM_SPEC "%{m32:--32} %{m64:--64}"
26 
27 #undef	LINK_SPEC
28 #define LINK_SPEC "%{m64:-m elf64tilegx} %{m32:-m elf32tilegx} \
29   %{shared:-shared} \
30   %{!shared: \
31     %{!static: \
32       %{rdynamic:-export-dynamic} \
33       -dynamic-linker \
34         %{ m32: /lib32/ld.so.1} \
35         %{!m32: /lib/ld.so.1}} \
36     %{static:-static}}"
37 
38 #define MULTILIB_DEFAULTS { "m64" }
39 
40 #define NO_PROFILE_COUNTERS	1
41 
42 #undef MCOUNT_NAME
43 #define MCOUNT_NAME "__mcount"
44 
45 #undef NEED_INDICATE_EXEC_STACK
46 #define NEED_INDICATE_EXEC_STACK 1
47 
48 #ifdef TARGET_LIBC_PROVIDES_SSP
49 /* TILE-Gx glibc provides __stack_chk_guard two pointer-size words before
50    tp. */
51 #define TARGET_THREAD_SSP_OFFSET (-2 * GET_MODE_SIZE (ptr_mode))
52 #endif
53 
54 /* For __clear_cache in libgcc2.c.  */
55 #ifdef IN_LIBGCC2
56 
57 #include <arch/icache.h>
58 
59 /* Use the minimum page size of 4K.  Alternatively we can call
60    getpagesize() but it introduces a libc dependence.  */
61 #undef CLEAR_INSN_CACHE
62 #define CLEAR_INSN_CACHE(beg, end) invalidate_icache (beg, end - beg, 4096)
63 
64 #else
65 
66 /* define CLEAR_INSN_CACHE so that gcc knows to expand __builtin__clear_cache
67    to the libraray call.  */
68 #undef CLEAR_INSN_CACHE
69 #define CLEAR_INSN_CACHE 1
70 
71 #endif
72