1 /* Base configuration file for all Fuchsia targets.
2    Copyright (C) 2017-2020 Free Software Foundation, Inc.
3    Contributed by Google.
4 
5 This file is part of GCC.
6 
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11 
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public 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 /* Common Fuchsia configuration.  */
22 
23 #undef  STARTFILE_SPEC
24 #define STARTFILE_SPEC "%{!shared: crt1%O%s} crtbegin%O%s"
25 
26 #undef  ENDFILE_SPEC
27 #define ENDFILE_SPEC "crtend%O%s"
28 
29 /* When neither pic nor pie has been specified, use PIE.  */
30 #undef  CC1_SPEC
31 #define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC:" \
32                    "%{!fno-pie:%{!fno-PIE:%{!fpie:%{!fPIE: -fPIE}}}}}}}}"
33 
34 #undef  LIB_SPEC
35 #define LIB_SPEC "--start-group" \
36 		 " -lmxio -lmagenta -lc -llaunchpad" \
37 		 "%{!static: -lgcc_s}" \
38 		 " --end-group"
39 
40 #undef  LINK_SPEC
41 #define LINK_SPEC "-z max-page-size=4096" \
42 		  " -z combreloc" \
43 		  " -z relro" \
44 		  " -z now" \
45 		  " -z text" \
46 		  "%{!hash-style: --hash-style=gnu}" \
47 		  "%{!no-eh-frame-hdr: --eh-frame-hdr}" \
48 		  "%{!no-build-id: --build-id}" \
49 		  "%{shared: -shared}" \
50 		  "%{!shared:%{!static:%{!dynamic-linker: -dynamic-linker=ld.so.1}}}"
51 
52 /* We are using MUSL as our libc.  */
53 #undef  OPTION_MUSL
54 #define OPTION_MUSL 1
55 
56 #ifndef TARGET_SUB_OS_CPP_BUILTINS
57 #define TARGET_SUB_OS_CPP_BUILTINS()
58 #endif
59 
60 #undef  TARGET_OS_CPP_BUILTINS
61 #define TARGET_OS_CPP_BUILTINS()		\
62   do						\
63     {						\
64       builtin_define ("__fuchsia__");		\
65       TARGET_SUB_OS_CPP_BUILTINS();		\
66     }						\
67   while (false)
68 
69