aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/fuchsia.h
diff options
context:
space:
mode:
authorJoshua Conner <joshconner@google.com>2017-01-10 18:00:43 +0000
committerJosh Conner <jconner@gcc.gnu.org>2017-01-10 18:00:43 +0000
commit491b3c5f229565df2e58ddfbf732eef82f9ad0ab (patch)
tree4cdc16db25e5598a25a3df3c7223d2b6cf43b5ef /gcc/config/fuchsia.h
parent904112f6bbb64776936b04c7b6513ffbe7260433 (diff)
downloadgcc-491b3c5f229565df2e58ddfbf732eef82f9ad0ab.zip
gcc-491b3c5f229565df2e58ddfbf732eef82f9ad0ab.tar.gz
gcc-491b3c5f229565df2e58ddfbf732eef82f9ad0ab.tar.bz2
fuchsia-elf.h: New file.
2017-01-10 Joshua Conner <joshconner@google.com> * config/arm/fuchsia-elf.h: New file. * config/fuchsia.h: New file. * config.gcc (*-*-fuchsia*): Set native_system_header_dir. (aarch64*-*-fuchsia*, arm*-*-fuchsia*, x86_64-*-fuchsia*): Add to targets. * config.host: (aarch64*-*-fuchsia*, arm*-*-fuchsia*): Add to hosts. From-SVN: r244281
Diffstat (limited to 'gcc/config/fuchsia.h')
-rw-r--r--gcc/config/fuchsia.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/gcc/config/fuchsia.h b/gcc/config/fuchsia.h
new file mode 100644
index 0000000..5b3e186
--- /dev/null
+++ b/gcc/config/fuchsia.h
@@ -0,0 +1,68 @@
+/* Base configuration file for all Fuchsia targets.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+ Contributed by Google.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Common Fuchsia configuration. */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{!shared: crt1%O%s} crtbegin%O%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend%O%s"
+
+/* When neither pic nor pie has been specified, use PIE. */
+#undef CC1_SPEC
+#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC:" \
+ "%{!fno-pie:%{!fno-PIE:%{!fpie:%{!fPIE: -fPIE}}}}}}}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "--start-group" \
+ " -lmxio -lmagenta -lc -llaunchpad" \
+ "%{!static: -lgcc_s}" \
+ " --end-group"
+
+#undef LINK_SPEC
+#define LINK_SPEC "-z max-page-size=4096" \
+ " -z combreloc" \
+ " -z relro" \
+ " -z now" \
+ " -z text" \
+ "%{!hash-style: --hash-style=gnu}" \
+ "%{!no-eh-frame-hdr: --eh-frame-hdr}" \
+ "%{!no-build-id: --build-id}" \
+ "%{shared: -shared}" \
+ "%{!shared:%{!static:%{!dynamic-linker: -dynamic-linker=ld.so.1}}}"
+
+/* We are using MUSL as our libc. */
+#undef OPTION_MUSL
+#define OPTION_MUSL 1
+
+#ifndef TARGET_SUB_OS_CPP_BUILTINS
+#define TARGET_SUB_OS_CPP_BUILTINS()
+#endif
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__fuchsia__"); \
+ TARGET_SUB_OS_CPP_BUILTINS(); \
+ } \
+ while (false)
+