annotate gcc/config/mips/gnu-user.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Definitions for MIPS systems using GNU userspace.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 1998-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
9 any later version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
14 GNU General Public License for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #undef WCHAR_TYPE
kono
parents:
diff changeset
21 #define WCHAR_TYPE "int"
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 #undef WCHAR_TYPE_SIZE
kono
parents:
diff changeset
24 #define WCHAR_TYPE_SIZE 32
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 #undef ASM_DECLARE_OBJECT_NAME
kono
parents:
diff changeset
27 #define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 /* If we don't set MASK_ABICALLS, we can't default to PIC. */
kono
parents:
diff changeset
30 #undef TARGET_DEFAULT
kono
parents:
diff changeset
31 #define TARGET_DEFAULT MASK_ABICALLS
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 #define TARGET_OS_CPP_BUILTINS() \
kono
parents:
diff changeset
34 do { \
kono
parents:
diff changeset
35 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
kono
parents:
diff changeset
36 /* The GNU C++ standard library requires this. */ \
kono
parents:
diff changeset
37 if (c_dialect_cxx ()) \
kono
parents:
diff changeset
38 builtin_define ("_GNU_SOURCE"); \
kono
parents:
diff changeset
39 } while (0)
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 #undef SUBTARGET_CPP_SPEC
kono
parents:
diff changeset
42 #define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 /* A standard GNU/Linux mapping. On most targets, it is included in
kono
parents:
diff changeset
45 CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
kono
parents:
diff changeset
46 and provides this hook instead. */
kono
parents:
diff changeset
47 #undef SUBTARGET_CC1_SPEC
kono
parents:
diff changeset
48 #define SUBTARGET_CC1_SPEC GNU_USER_TARGET_CC1_SPEC
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 /* -G is incompatible with -KPIC which is the default, so only allow objects
kono
parents:
diff changeset
51 in the small data section if the user explicitly asks for it. */
kono
parents:
diff changeset
52 #undef MIPS_DEFAULT_GVALUE
kono
parents:
diff changeset
53 #define MIPS_DEFAULT_GVALUE 0
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 #undef GNU_USER_TARGET_LINK_SPEC
kono
parents:
diff changeset
56 #define GNU_USER_TARGET_LINK_SPEC "\
kono
parents:
diff changeset
57 %{G*} %{EB} %{EL} %{mips*} %{shared} \
kono
parents:
diff changeset
58 %{!shared: \
kono
parents:
diff changeset
59 %{!static: \
kono
parents:
diff changeset
60 %{rdynamic:-export-dynamic} \
kono
parents:
diff changeset
61 %{mabi=n32: -dynamic-linker " GNU_USER_DYNAMIC_LINKERN32 "} \
kono
parents:
diff changeset
62 %{mabi=64: -dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "} \
kono
parents:
diff changeset
63 %{mabi=32: -dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "}} \
kono
parents:
diff changeset
64 %{static}} \
kono
parents:
diff changeset
65 %{mabi=n32:-m" GNU_USER_LINK_EMULATIONN32 "} \
kono
parents:
diff changeset
66 %{mabi=64:-m" GNU_USER_LINK_EMULATION64 "} \
kono
parents:
diff changeset
67 %{mabi=32:-m" GNU_USER_LINK_EMULATION32 "}"
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 #undef LINK_SPEC
kono
parents:
diff changeset
70 #define LINK_SPEC GNU_USER_TARGET_LINK_SPEC
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 #undef SUBTARGET_ASM_SPEC
kono
parents:
diff changeset
73 #define SUBTARGET_ASM_SPEC \
kono
parents:
diff changeset
74 "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}"
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 /* The MIPS assembler has different syntax for .set. We set it to
kono
parents:
diff changeset
77 .dummy to trap any errors. */
kono
parents:
diff changeset
78 #undef SET_ASM_OP
kono
parents:
diff changeset
79 #define SET_ASM_OP "\t.dummy\t"
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 #undef ASM_OUTPUT_DEF
kono
parents:
diff changeset
82 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
kono
parents:
diff changeset
83 do { \
kono
parents:
diff changeset
84 fputc ( '\t', FILE); \
kono
parents:
diff changeset
85 assemble_name (FILE, LABEL1); \
kono
parents:
diff changeset
86 fputs ( " = ", FILE); \
kono
parents:
diff changeset
87 assemble_name (FILE, LABEL2); \
kono
parents:
diff changeset
88 fputc ( '\n', FILE); \
kono
parents:
diff changeset
89 } while (0)
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 /* The glibc _mcount stub will save $v0 for us. Don't mess with saving
kono
parents:
diff changeset
92 it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
kono
parents:
diff changeset
93 presence of $gp-relative calls. */
kono
parents:
diff changeset
94 #undef ASM_OUTPUT_REG_PUSH
kono
parents:
diff changeset
95 #undef ASM_OUTPUT_REG_POP
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 #undef LIB_SPEC
kono
parents:
diff changeset
98 #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 #ifdef HAVE_AS_NO_SHARED
kono
parents:
diff changeset
101 /* Default to -mno-shared for non-PIC. */
kono
parents:
diff changeset
102 # define NO_SHARED_SPECS \
kono
parents:
diff changeset
103 " %{mshared|mno-shared:;:%{" NO_FPIE_AND_FPIC_SPEC ":-mno-shared}}"
kono
parents:
diff changeset
104 #else
kono
parents:
diff changeset
105 # define NO_SHARED_SPECS ""
kono
parents:
diff changeset
106 #endif
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108 /* -march=native handling only makes sense with compiler running on
kono
parents:
diff changeset
109 a MIPS chip. */
kono
parents:
diff changeset
110 #if defined(__mips__)
kono
parents:
diff changeset
111 extern const char *host_detect_local_cpu (int argc, const char **argv);
kono
parents:
diff changeset
112 # define EXTRA_SPEC_FUNCTIONS \
kono
parents:
diff changeset
113 { "local_cpu_detect", host_detect_local_cpu },
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 # define MARCH_MTUNE_NATIVE_SPECS \
kono
parents:
diff changeset
116 " %{march=native:%<march=native %:local_cpu_detect(arch)}" \
kono
parents:
diff changeset
117 " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
kono
parents:
diff changeset
118 #else
kono
parents:
diff changeset
119 # define MARCH_MTUNE_NATIVE_SPECS ""
kono
parents:
diff changeset
120 #endif
kono
parents:
diff changeset
121
kono
parents:
diff changeset
122 #define LINUX_DRIVER_SELF_SPECS \
kono
parents:
diff changeset
123 NO_SHARED_SPECS \
kono
parents:
diff changeset
124 MARCH_MTUNE_NATIVE_SPECS, \
kono
parents:
diff changeset
125 /* -mplt has no effect without -mno-shared. Simplify later \
kono
parents:
diff changeset
126 specs handling by removing a redundant option. */ \
kono
parents:
diff changeset
127 "%{!mno-shared:%<mplt}", \
kono
parents:
diff changeset
128 /* -mplt likewise has no effect for -mabi=64 without -msym32. */ \
kono
parents:
diff changeset
129 "%{mabi=64:%{!msym32:%<mplt}}", \
kono
parents:
diff changeset
130 "%{!EB:%{!EL:%(endian_spec)}}", \
kono
parents:
diff changeset
131 "%{!mabi=*: -" MULTILIB_ABI_DEFAULT "}"
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133 #undef DRIVER_SELF_SPECS
kono
parents:
diff changeset
134 #define DRIVER_SELF_SPECS \
kono
parents:
diff changeset
135 MIPS_ISA_LEVEL_SPEC, \
kono
parents:
diff changeset
136 BASE_DRIVER_SELF_SPECS, \
kono
parents:
diff changeset
137 LINUX_DRIVER_SELF_SPECS
kono
parents:
diff changeset
138
kono
parents:
diff changeset
139 /* Similar to standard Linux, but adding -ffast-math support. */
kono
parents:
diff changeset
140 #undef GNU_USER_TARGET_MATHFILE_SPEC
kono
parents:
diff changeset
141 #define GNU_USER_TARGET_MATHFILE_SPEC \
kono
parents:
diff changeset
142 "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
kono
parents:
diff changeset
143 #undef ENDFILE_SPEC
kono
parents:
diff changeset
144 #define ENDFILE_SPEC \
kono
parents:
diff changeset
145 GNU_USER_TARGET_MATHFILE_SPEC " " \
kono
parents:
diff changeset
146 GNU_USER_TARGET_ENDFILE_SPEC
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 #undef LOCAL_LABEL_PREFIX
kono
parents:
diff changeset
149 #define LOCAL_LABEL_PREFIX (TARGET_OLDABI ? "$" : ".")