1/* Target macros for mips*-mti-linux* targets.
2   Copyright (C) 2012-2015 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3.  If not see
18<http://www.gnu.org/licenses/>.  */
19
20/* This target is a multilib target, specify the sysroot paths.  */
21#undef SYSROOT_SUFFIX_SPEC
22#if MIPS_ISA_DEFAULT == 33 /* mips32r2 is the default */
23#define SYSROOT_SUFFIX_SPEC \
24    "%{mips32:/mips32}%{mips64:/mips64}%{mips64r2:/mips64r2}%{mips32r6:/mips32r6}%{mips64r6:/mips64r6}%{mips16:/mips16}%{mmicromips:/micromips}%{mabi=64:/64}%{mel|EL:/el}%{msoft-float:/sof}%{!mips32r6:%{!mips64r6:%{mnan=2008:/nan2008}}}"
25#elif MIPS_ISA_DEFAULT == 37 /* mips32r6 is the default */
26#define SYSROOT_SUFFIX_SPEC \
27    "%{mips32:/mips32}%{mips64:/mips64}%{mips32r2:/mips32r2}%{mips64r2:/mips64r2}%{mips64r6:/mips64r6}%{mips16:/mips16}%{mmicromips:/micromips}%{mabi=64:/64}%{mel|EL:/el}%{msoft-float:/sof}%{!mips32r6:%{!mips64r6:%{mnan=2008:/nan2008}}}"
28#else /* Unexpected default ISA.  */
29#error No SYSROOT_SUFFIX_SPEC exists for this default ISA
30#endif
31
32#undef DRIVER_SELF_SPECS
33#define DRIVER_SELF_SPECS						\
34  /* Set the ISA for the default multilib.  */				\
35  MIPS_DEFAULT_ISA_LEVEL_SPEC,						\
36									\
37  /* Make sure a -mips option is present.  This helps us to pick	\
38     the right multilib, and also makes the later specs easier		\
39     to write.  */							\
40  MIPS_ISA_LEVEL_SPEC,							\
41									\
42  /* Infer the default float setting from -march.  */			\
43  MIPS_ARCH_FLOAT_SPEC,							\
44									\
45  /* Infer the -msynci setting from -march if not explicitly set.  */	\
46  MIPS_ISA_SYNCI_SPEC,							\
47									\
48  /* If no ABI option is specified, infer one from the ISA level	\
49     or -mgp setting.  */						\
50  "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}",	\
51									\
52  /* If no FP ABI option is specified, infer one from the		\
53     ABI/ISA level.  */							\
54  "%{!msoft-float: %{!msingle-float: %{!mfp*: %{mabi=32: %{"		\
55  MIPS_FPXX_OPTION_SPEC ": -mfpxx}}}}}",				\
56									\
57  /* Base SPECs.  */							\
58  BASE_DRIVER_SELF_SPECS						\
59									\
60  /* Use the standard linux specs for everything else.  */		\
61  LINUX_DRIVER_SELF_SPECS
62