fuchsia-elf.h: New file.
authorJoshua Conner <joshconner@google.com>
Tue, 10 Jan 2017 18:00:43 +0000 (18:00 +0000)
committerJosh Conner <jconner@gcc.gnu.org>
Tue, 10 Jan 2017 18:00:43 +0000 (18:00 +0000)
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

gcc/ChangeLog
gcc/config.gcc
gcc/config.host
gcc/config/arm/fuchsia-elf.h [new file with mode: 0644]
gcc/config/fuchsia.h [new file with mode: 0644]

index 5fdb85cc6dfc46ce35b1c2744ab1625a24471dfe..fb4314154027ca36bc380c6986fdfd0edf76ca3d 100644 (file)
@@ -1,3 +1,12 @@
+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. 
+
 2016-01-10  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/79034
index bb25d54e8adbe05bdb10eafe16a4ddabfe898f55..5413246e33c9d76c7e897083c1b487fc2495326c 100644 (file)
@@ -708,6 +708,9 @@ case ${target} in
   esac
   use_gcc_stdint=wrap
   ;;
+*-*-fuchsia*)
+  native_system_header_dir=/include
+  ;;
 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
   extra_options="$extra_options gnu-user.opt"
   gas=yes
@@ -910,7 +913,7 @@ case ${target} in
 esac
 
 case ${target} in
-aarch64*-*-elf | aarch64*-*-rtems*)
+aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
        tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
        tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
        tmake_file="${tmake_file} aarch64/t-aarch64"
@@ -918,6 +921,9 @@ aarch64*-*-elf | aarch64*-*-rtems*)
        aarch64-*-elf*)
                use_gcc_stdint=wrap
                ;;
+        aarch64-*-fuchsia*)
+                tm_file="${tm_file} fuchsia.h"
+                ;;
        aarch64-*-rtems*)
                tm_file="${tm_file} rtems.h aarch64/rtems.h"
                ;;
@@ -1121,7 +1127,7 @@ arm*-*-phoenix*)
        tmake_file="${tmake_file} arm/t-arm arm/t-bpabi arm/t-phoenix"
        target_cpu_cname="arm7tdmi"
        ;;
-arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*)
+arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
        case ${target} in
        arm*eb-*-eabi*)
          tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
@@ -1136,6 +1142,11 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*)
          tmake_file="${tmake_file} arm/t-bpabi"
          use_gcc_stdint=wrap
          ;;
+       arm*-*-fuchsia*)
+         tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
+         tmake_file="${tmake_file} arm/t-bpabi"
+         target_cpu_cname="genericv7a"
+         ;;
        arm*-*-rtems*)
          tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
          tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems"
@@ -1779,6 +1790,10 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
                        ;;
        esac
        ;;
+x86_64-*-fuchsia*)
+       tmake_file="${tmake_file} i386/t-x86_64-elf"
+       tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h fuchsia.h"
+       ;;
 ia64*-*-elf*)
        tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h ia64/sysv4.h ia64/elf.h"
        tmake_file="ia64/t-ia64"
index 60e740530dc6b9b3857c9d6d6f952529cf4f4600..6b28f3033ef92f1f0e09cc41f3a90be05c5e1e43 100644 (file)
@@ -99,7 +99,7 @@ case ${host} in
 esac
 
 case ${host} in
-  aarch64*-*-freebsd* | aarch64*-*-linux*)
+  aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia*)
     case ${target} in
       aarch64*-*-*)
        host_extra_gcc_objs="driver-aarch64.o"
@@ -107,7 +107,7 @@ case ${host} in
        ;;
     esac
     ;;
-  arm*-*-freebsd* | arm*-*-linux*)
+  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
     case ${target} in
       arm*-*-*)
        host_extra_gcc_objs="driver-arm.o"
diff --git a/gcc/config/arm/fuchsia-elf.h b/gcc/config/arm/fuchsia-elf.h
new file mode 100644 (file)
index 0000000..d4e69ea
--- /dev/null
@@ -0,0 +1,31 @@
+/* Configuration file for ARM Fuchsia ELF 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/>.  */
+
+/* Use the BPABI builtins and the generic OS builtins.  */
+#undef  TARGET_SUB_OS_CPP_BUILTINS
+#define TARGET_SUB_OS_CPP_BUILTINS()           \
+  TARGET_BPABI_CPP_BUILTINS()
+
+/* Use the AAPCS ABI by default.  */
+#undef ARM_DEFAULT_ABI
+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS
+
+#define ARM_TARGET2_DWARF_FORMAT (DW_EH_PE_pcrel | DW_EH_PE_indirect)
+
diff --git a/gcc/config/fuchsia.h b/gcc/config/fuchsia.h
new file mode 100644 (file)
index 0000000..5b3e186
--- /dev/null
@@ -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)
+