public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add support for Fuchsia (OS)
@ 2016-12-08 22:55 Josh Conner
  2016-12-09  8:26 ` Andrew Pinski
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Josh Conner @ 2016-12-08 22:55 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

This patch adds support to gcc for the Fuchsia OS 
(https://fuchsia.googlesource.com/).

OK for mainline?

Thanks -

Josh


2016-12-08  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.



[-- Attachment #2: gcc-fuchsia-support.patch --]
[-- Type: text/plain, Size: 6111 bytes --]

Index: gcc/config/arm/fuchsia-elf.h
===================================================================
--- gcc/config/arm/fuchsia-elf.h	(revision 0)
+++ gcc/config/arm/fuchsia-elf.h	(working copy)
@@ -0,0 +1,31 @@
+/* Configuration file for ARM Fuchsia ELF targets.
+   Copyright (C) 2016 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)
+
Index: gcc/config/fuchsia.h
===================================================================
--- gcc/config/fuchsia.h	(revision 0)
+++ gcc/config/fuchsia.h	(working copy)
@@ -0,0 +1,64 @@
+/* Base configuration file for all Fuchsia targets.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+
+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"
+
+/* Build with PIC by default.  */
+#undef  CC1_SPEC
+#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
+
+#undef  LIB_SPEC
+#define LIB_SPEC "-lmxio -lmagenta -lc -llaunchpad" \
+		 "%{!static: -lgcc_s}"
+
+#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)
+
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 243452)
+++ gcc/config.gcc	(working copy)
@@ -706,6 +706,9 @@
   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
@@ -908,7 +911,7 @@
 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"
@@ -916,6 +919,9 @@
 	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"
 		;;
@@ -1119,7 +1125,7 @@
 	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"
@@ -1134,6 +1140,10 @@
 	  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"
+	  ;;
 	arm*-*-rtems*)
 	  tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
 	  tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems"
@@ -1777,6 +1787,10 @@
 			;;
 	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: gcc/config.host
===================================================================
--- gcc/config.host	(revision 243452)
+++ gcc/config.host	(working copy)
@@ -99,7 +99,7 @@
 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 @@
 	;;
     esac
     ;;
-  arm*-*-freebsd* | arm*-*-linux*)
+  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
     case ${target} in
       arm*-*-*)
 	host_extra_gcc_objs="driver-arm.o"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-08 22:55 [PATCH] Add support for Fuchsia (OS) Josh Conner
@ 2016-12-09  8:26 ` Andrew Pinski
  2016-12-09 19:33   ` Josh Conner
  2016-12-10 11:26 ` Richard Earnshaw
  2016-12-11 15:25 ` Gerald Pfeifer
  2 siblings, 1 reply; 15+ messages in thread
From: Andrew Pinski @ 2016-12-09  8:26 UTC (permalink / raw)
  To: Josh Conner; +Cc: gcc-patches

On Thu, Dec 8, 2016 at 2:55 PM, Josh Conner <joshconner@google.com> wrote:
> This patch adds support to gcc for the Fuchsia OS
> (https://fuchsia.googlesource.com/).
>
> OK for mainline?

A few comments:
> +/* Build with PIC by default.  */
> +#undef  CC1_SPEC
> +#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"

Is it PIC by default or really PIE by default?
Also how does this interact with the -fpie/-fPIE options?

Thanks,
Andrew


>
> Thanks -
>
> Josh
>
>
> 2016-12-08  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.
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-09  8:26 ` Andrew Pinski
@ 2016-12-09 19:33   ` Josh Conner
  2016-12-09 19:43     ` Josh Conner
  0 siblings, 1 reply; 15+ messages in thread
From: Josh Conner @ 2016-12-09 19:33 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc-patches

On 12/9/16 12:26 AM, Andrew Pinski wrote:
> On Thu, Dec 8, 2016 at 2:55 PM, Josh Conner <joshconner@google.com> wrote:
>> This patch adds support to gcc for the Fuchsia OS
>> (https://fuchsia.googlesource.com/).
>>
>> OK for mainline?
> A few comments:
>> +/* Build with PIC by default.  */
>> +#undef  CC1_SPEC
>> +#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
> Is it PIC by default or really PIE by default?
> Also how does this interact with the -fpie/-fPIE options?

The intent was to make it PIE by default - I was mistakenly under the impression that this meant
building with -fpic/PIC, a la the android builds. Does this seem more reasonable:

#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC:" \
                    "%{!fno-pie:%{!fno-PIE:%{!fpie:%{!fPIE: -fPIC}}}}}}}}"

?

Thanks -

Josh


> Thanks,
> Andrew
>
>
>> Thanks -
>>
>> Josh
>>
>>
>> 2016-12-08  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.
>>
>>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-09 19:33   ` Josh Conner
@ 2016-12-09 19:43     ` Josh Conner
  0 siblings, 0 replies; 15+ messages in thread
From: Josh Conner @ 2016-12-09 19:43 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc-patches

Sorry, that should have been:

#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC:" \
                   "%{!fno-pie:%{!fno-PIE:%{!fpie:%{!fPIE: -fPIE}}}}}}}}"

(default to PIE, not PIC)

On Fri, Dec 9, 2016 at 11:33 AM, Josh Conner <joshconner@google.com> wrote:
> On 12/9/16 12:26 AM, Andrew Pinski wrote:
>>
>> On Thu, Dec 8, 2016 at 2:55 PM, Josh Conner <joshconner@google.com> wrote:
>>>
>>> This patch adds support to gcc for the Fuchsia OS
>>> (https://fuchsia.googlesource.com/).
>>>
>>> OK for mainline?
>>
>> A few comments:
>>>
>>> +/* Build with PIC by default.  */
>>> +#undef  CC1_SPEC
>>> +#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
>>
>> Is it PIC by default or really PIE by default?
>> Also how does this interact with the -fpie/-fPIE options?
>
>
> The intent was to make it PIE by default - I was mistakenly under the
> impression that this meant
> building with -fpic/PIC, a la the android builds. Does this seem more
> reasonable:
>
> #define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC:" \
>                    "%{!fno-pie:%{!fno-PIE:%{!fpie:%{!fPIE: -fPIC}}}}}}}}"
>
> ?
>
> Thanks -
>
> Josh
>
>
>
>> Thanks,
>> Andrew
>>
>>
>>> Thanks -
>>>
>>> Josh
>>>
>>>
>>> 2016-12-08  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.
>>>
>>>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-08 22:55 [PATCH] Add support for Fuchsia (OS) Josh Conner
  2016-12-09  8:26 ` Andrew Pinski
@ 2016-12-10 11:26 ` Richard Earnshaw
  2016-12-12 21:31   ` Josh Conner via gcc-patches
  2016-12-11 15:25 ` Gerald Pfeifer
  2 siblings, 1 reply; 15+ messages in thread
From: Richard Earnshaw @ 2016-12-10 11:26 UTC (permalink / raw)
  To: Josh Conner, gcc-patches

On 08/12/16 22:55, Josh Conner wrote:
> +	arm*-*-fuchsia*)
> +	  tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
> +	  tmake_file="${tmake_file} arm/t-bpabi"
> +	  ;;


This will leave the default cpu as arm7tdmi.  Is that what you want?
It's fine if it is, but if not, you should consider setting
target_cpu_cname here as well.

R.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-08 22:55 [PATCH] Add support for Fuchsia (OS) Josh Conner
  2016-12-09  8:26 ` Andrew Pinski
  2016-12-10 11:26 ` Richard Earnshaw
@ 2016-12-11 15:25 ` Gerald Pfeifer
  2016-12-12 21:53   ` Josh Conner via gcc-patches
  2017-01-17 21:49   ` Josh Conner via gcc-patches
  2 siblings, 2 replies; 15+ messages in thread
From: Gerald Pfeifer @ 2016-12-11 15:25 UTC (permalink / raw)
  To: Josh Conner; +Cc: gcc-patches

On Thu, 8 Dec 2016, Josh Conner wrote:
> This patch adds support to gcc for the Fuchsia OS
> (https://fuchsia.googlesource.com/).

Once this is in, can you please suggest a news item for our
main page?

(You could cook a patch following https://gcc.gnu.org/about.html
or suggest wording or an HTML snippet, and I'll take it from there.)

Similarly, would be good to add this to gcc-7/changes.html.

Gerald

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-10 11:26 ` Richard Earnshaw
@ 2016-12-12 21:31   ` Josh Conner via gcc-patches
  2016-12-19 18:07     ` Josh Conner via gcc-patches
  2017-01-10 15:54     ` Richard Earnshaw (lists)
  0 siblings, 2 replies; 15+ messages in thread
From: Josh Conner via gcc-patches @ 2016-12-12 21:31 UTC (permalink / raw)
  To: Richard Earnshaw, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

On 12/10/16 3:26 AM, Richard Earnshaw wrote:
> On 08/12/16 22:55, Josh Conner wrote:
>> +	arm*-*-fuchsia*)
>> +	  tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
>> +	  tmake_file="${tmake_file} arm/t-bpabi"
>> +	  ;;
>
> This will leave the default cpu as arm7tdmi.  Is that what you want?
> It's fine if it is, but if not, you should consider setting
> target_cpu_cname here as well.

Mmm, probably not. Thanks for pointing that out.
I've attached an updated patch addressing all of the concerns so far.

OK for mainline?

Thanks -

Josh


2016-12-08  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.


[-- Attachment #2: gcc-fuchsia-support-v2.patch --]
[-- Type: text/plain, Size: 6262 bytes --]

Index: config/arm/fuchsia-elf.h
===================================================================
--- config/arm/fuchsia-elf.h	(revision 0)
+++ config/arm/fuchsia-elf.h	(working copy)
@@ -0,0 +1,31 @@
+/* Configuration file for ARM Fuchsia ELF targets.
+   Copyright (C) 2016 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)
+
Index: config/fuchsia.h
===================================================================
--- config/fuchsia.h	(revision 0)
+++ config/fuchsia.h	(working copy)
@@ -0,0 +1,68 @@
+/* Base configuration file for all Fuchsia targets.
+   Copyright (C) 2016 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)
+
Index: config.gcc
===================================================================
--- config.gcc	(revision 243566)
+++ config.gcc	(working copy)
@@ -706,6 +706,9 @@
   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
@@ -908,7 +911,7 @@
 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"
@@ -916,6 +919,9 @@
 	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"
 		;;
@@ -1119,7 +1125,7 @@
 	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"
@@ -1134,6 +1140,11 @@
 	  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"
@@ -1777,6 +1788,10 @@
 			;;
 	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: config.host
===================================================================
--- config.host	(revision 243566)
+++ config.host	(working copy)
@@ -99,7 +99,7 @@
 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 @@
 	;;
     esac
     ;;
-  arm*-*-freebsd* | arm*-*-linux*)
+  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
     case ${target} in
       arm*-*-*)
 	host_extra_gcc_objs="driver-arm.o"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-11 15:25 ` Gerald Pfeifer
@ 2016-12-12 21:53   ` Josh Conner via gcc-patches
  2017-01-17 21:49   ` Josh Conner via gcc-patches
  1 sibling, 0 replies; 15+ messages in thread
From: Josh Conner via gcc-patches @ 2016-12-12 21:53 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches

On 12/11/16 7:24 AM, Gerald Pfeifer wrote:
> On Thu, 8 Dec 2016, Josh Conner wrote:
>> This patch adds support to gcc for the Fuchsia OS
>> (https://fuchsia.googlesource.com/).
>
> Once this is in, can you please suggest a news item for our
> main page?
>
> (You could cook a patch following https://gcc.gnu.org/about.html
> or suggest wording or an HTML snippet, and I'll take it from there.)
>
> Similarly, would be good to add this to gcc-7/changes.html.

Sure thing -- I'll submit patches for wwwdocs once my gcc changes
go in.

- Josh


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] Add support for Fuchsia (OS)
  2016-12-12 21:31   ` Josh Conner via gcc-patches
@ 2016-12-19 18:07     ` Josh Conner via gcc-patches
  2016-12-27 20:46       ` Josh Conner via gcc-patches
  2017-01-10 15:54     ` Richard Earnshaw (lists)
  1 sibling, 1 reply; 15+ messages in thread
From: Josh Conner via gcc-patches @ 2016-12-19 18:07 UTC (permalink / raw)
  To: Richard Earnshaw, gcc-patches

Ping?


On 12/12/16 1:31 PM, Josh Conner wrote:
> On 12/10/16 3:26 AM, Richard Earnshaw wrote:
>> On 08/12/16 22:55, Josh Conner wrote:
>>> +    arm*-*-fuchsia*)
>>> +      tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
>>> +      tmake_file="${tmake_file} arm/t-bpabi"
>>> +      ;;
>>
>> This will leave the default cpu as arm7tdmi.  Is that what you want?
>> It's fine if it is, but if not, you should consider setting
>> target_cpu_cname here as well.
>
> Mmm, probably not. Thanks for pointing that out.
> I've attached an updated patch addressing all of the concerns so far.
>
> OK for mainline?
>
> Thanks -
>
> Josh
>
>
> 2016-12-08  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.
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-19 18:07     ` Josh Conner via gcc-patches
@ 2016-12-27 20:46       ` Josh Conner via gcc-patches
  0 siblings, 0 replies; 15+ messages in thread
From: Josh Conner via gcc-patches @ 2016-12-27 20:46 UTC (permalink / raw)
  To: Richard Earnshaw, gcc-patches

Ping^2?


On 12/19/16 10:05 AM, Josh Conner wrote:
> Ping?
>
>
> On 12/12/16 1:31 PM, Josh Conner wrote:
>> On 12/10/16 3:26 AM, Richard Earnshaw wrote:
>>> On 08/12/16 22:55, Josh Conner wrote:
>>>> +    arm*-*-fuchsia*)
>>>> +      tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
>>>> +      tmake_file="${tmake_file} arm/t-bpabi"
>>>> +      ;;
>>>
>>> This will leave the default cpu as arm7tdmi.  Is that what you want?
>>> It's fine if it is, but if not, you should consider setting
>>> target_cpu_cname here as well.
>>
>> Mmm, probably not. Thanks for pointing that out.
>> I've attached an updated patch addressing all of the concerns so far.
>>
>> OK for mainline?
>>
>> Thanks -
>>
>> Josh
>>
>>
>> 2016-12-08  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.
>>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-12 21:31   ` Josh Conner via gcc-patches
  2016-12-19 18:07     ` Josh Conner via gcc-patches
@ 2017-01-10 15:54     ` Richard Earnshaw (lists)
  2017-01-10 18:02       ` Josh Conner via gcc-patches
  1 sibling, 1 reply; 15+ messages in thread
From: Richard Earnshaw (lists) @ 2017-01-10 15:54 UTC (permalink / raw)
  To: Josh Conner, gcc-patches

On 12/12/16 21:31, Josh Conner via gcc-patches wrote:
> On 12/10/16 3:26 AM, Richard Earnshaw wrote:
>> On 08/12/16 22:55, Josh Conner wrote:
>>> +    arm*-*-fuchsia*)
>>> +      tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
>>> +      tmake_file="${tmake_file} arm/t-bpabi"
>>> +      ;;
>>
>> This will leave the default cpu as arm7tdmi.  Is that what you want?
>> It's fine if it is, but if not, you should consider setting
>> target_cpu_cname here as well.
> 
> Mmm, probably not. Thanks for pointing that out.
> I've attached an updated patch addressing all of the concerns so far.
> 
> OK for mainline?
> 
> Thanks -
> 
> Josh
> 
> 
> 2016-12-08  Joshua Conner<joshconner@google.com>

Two spaces between your name and email address.

> 
>     * 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.
> 

This is OK, but please update the copyright years on the new files to
include 2017.

R.

> 
> gcc-fuchsia-support-v2.patch
> 
> 
> Index: config/arm/fuchsia-elf.h
> ===================================================================
> --- config/arm/fuchsia-elf.h	(revision 0)
> +++ config/arm/fuchsia-elf.h	(working copy)
> @@ -0,0 +1,31 @@
> +/* Configuration file for ARM Fuchsia ELF targets.
> +   Copyright (C) 2016 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)
> +
> Index: config/fuchsia.h
> ===================================================================
> --- config/fuchsia.h	(revision 0)
> +++ config/fuchsia.h	(working copy)
> @@ -0,0 +1,68 @@
> +/* Base configuration file for all Fuchsia targets.
> +   Copyright (C) 2016 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)
> +
> Index: config.gcc
> ===================================================================
> --- config.gcc	(revision 243566)
> +++ config.gcc	(working copy)
> @@ -706,6 +706,9 @@
>    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
> @@ -908,7 +911,7 @@
>  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"
> @@ -916,6 +919,9 @@
>  	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"
>  		;;
> @@ -1119,7 +1125,7 @@
>  	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"
> @@ -1134,6 +1140,11 @@
>  	  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"
> @@ -1777,6 +1788,10 @@
>  			;;
>  	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: config.host
> ===================================================================
> --- config.host	(revision 243566)
> +++ config.host	(working copy)
> @@ -99,7 +99,7 @@
>  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 @@
>  	;;
>      esac
>      ;;
> -  arm*-*-freebsd* | arm*-*-linux*)
> +  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
>      case ${target} in
>        arm*-*-*)
>  	host_extra_gcc_objs="driver-arm.o"
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2017-01-10 15:54     ` Richard Earnshaw (lists)
@ 2017-01-10 18:02       ` Josh Conner via gcc-patches
  0 siblings, 0 replies; 15+ messages in thread
From: Josh Conner via gcc-patches @ 2017-01-10 18:02 UTC (permalink / raw)
  To: Richard Earnshaw (lists), gcc-patches


On 1/10/17 7:54 AM, Richard Earnshaw (lists) wrote:
> On 12/12/16 21:31, Josh Conner via gcc-patches wrote:
>> On 12/10/16 3:26 AM, Richard Earnshaw wrote:
>>> On 08/12/16 22:55, Josh Conner wrote:
>>>> +    arm*-*-fuchsia*)
>>>> +      tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
>>>> +      tmake_file="${tmake_file} arm/t-bpabi"
>>>> +      ;;
>>> This will leave the default cpu as arm7tdmi.  Is that what you want?
>>> It's fine if it is, but if not, you should consider setting
>>> target_cpu_cname here as well.
>> Mmm, probably not. Thanks for pointing that out.
>> I've attached an updated patch addressing all of the concerns so far.
>>
>> OK for mainline?
>>
>> Thanks -
>>
>> Josh
>>
>>
>> 2016-12-08  Joshua Conner<joshconner@google.com>
> Two spaces between your name and email address.
>
>>      * 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.
>>
> This is OK, but please update the copyright years on the new files to
> include 2017.

Applied with those changes, thanks.

- Josh
>
> R.
>
>> gcc-fuchsia-support-v2.patch
>>
>>
>> Index: config/arm/fuchsia-elf.h
>> ===================================================================
>> --- config/arm/fuchsia-elf.h	(revision 0)
>> +++ config/arm/fuchsia-elf.h	(working copy)
>> @@ -0,0 +1,31 @@
>> +/* Configuration file for ARM Fuchsia ELF targets.
>> +   Copyright (C) 2016 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)
>> +
>> Index: config/fuchsia.h
>> ===================================================================
>> --- config/fuchsia.h	(revision 0)
>> +++ config/fuchsia.h	(working copy)
>> @@ -0,0 +1,68 @@
>> +/* Base configuration file for all Fuchsia targets.
>> +   Copyright (C) 2016 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)
>> +
>> Index: config.gcc
>> ===================================================================
>> --- config.gcc	(revision 243566)
>> +++ config.gcc	(working copy)
>> @@ -706,6 +706,9 @@
>>     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
>> @@ -908,7 +911,7 @@
>>   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"
>> @@ -916,6 +919,9 @@
>>   	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"
>>   		;;
>> @@ -1119,7 +1125,7 @@
>>   	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"
>> @@ -1134,6 +1140,11 @@
>>   	  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"
>> @@ -1777,6 +1788,10 @@
>>   			;;
>>   	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: config.host
>> ===================================================================
>> --- config.host	(revision 243566)
>> +++ config.host	(working copy)
>> @@ -99,7 +99,7 @@
>>   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 @@
>>   	;;
>>       esac
>>       ;;
>> -  arm*-*-freebsd* | arm*-*-linux*)
>> +  arm*-*-freebsd* | arm*-*-linux* | arm*-*-fuchsia*)
>>       case ${target} in
>>         arm*-*-*)
>>   	host_extra_gcc_objs="driver-arm.o"
>>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2016-12-11 15:25 ` Gerald Pfeifer
  2016-12-12 21:53   ` Josh Conner via gcc-patches
@ 2017-01-17 21:49   ` Josh Conner via gcc-patches
  2017-02-01 23:29     ` Gerald Pfeifer
  1 sibling, 1 reply; 15+ messages in thread
From: Josh Conner via gcc-patches @ 2017-01-17 21:49 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

Gerald -

Attached is my recommended patch for changes to the web docs describing Fuchsia support. Please let
me know if there's anything else I can do.

Thanks!

- Josh

On 12/11/16 7:24 AM, Gerald Pfeifer wrote:

> On Thu, 8 Dec 2016, Josh Conner wrote:
>> This patch adds support to gcc for the Fuchsia OS
>> (https://fuchsia.googlesource.com/).
> Once this is in, can you please suggest a news item for our
> main page?
> (You could cook a patch following https://gcc.gnu.org/about.html
> or suggest wording or an HTML snippet, and I'll take it from there.)
> Similarly, would be good to add this to gcc-7/changes.html.
> Gerald
>


[-- Attachment #2: fuchsia-wwwdocs.patch --]
[-- Type: text/plain, Size: 800 bytes --]

Index: index.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/index.html,v
retrieving revision 1.1037
diff -r1.1037 index.html
48a49,53
> <dt><span>Fuchsia OS support</span>
>      <span class="date">[2017-10-01]</span></dt>
>      <dd><a href="https://fuchsia.googlesource.com/"> Fuchsia OS</a>
>      support was added to GCC, contributed by Google.</dd>
> 
Index: gcc-7/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-7/changes.html,v
retrieving revision 1.39
diff -r1.39 changes.html
533a534,539
> <h3 id="fuchsia">Fuchsia</h3>
>    <ul>
>      <li>Support has been added for the
>      <a href="https://fuchsia.googlesource.com/"> Fuchsia OS</a>.</li>
>    </ul>
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2017-01-17 21:49   ` Josh Conner via gcc-patches
@ 2017-02-01 23:29     ` Gerald Pfeifer
  2017-02-02 19:16       ` Josh Conner via gcc-patches
  0 siblings, 1 reply; 15+ messages in thread
From: Gerald Pfeifer @ 2017-02-01 23:29 UTC (permalink / raw)
  To: Josh Conner; +Cc: gcc-patches

On Tue, 17 Jan 2017, Josh Conner via gcc-patches wrote:
> Attached is my recommended patch for changes to the web docs describing
> Fuchsia support. Please let me know if there's anything else I can do.

This looks fine (just remove the blank before "Fuchsia"); and
sorry for the delay getting back to this!

Gerald

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] Add support for Fuchsia (OS)
  2017-02-01 23:29     ` Gerald Pfeifer
@ 2017-02-02 19:16       ` Josh Conner via gcc-patches
  0 siblings, 0 replies; 15+ messages in thread
From: Josh Conner via gcc-patches @ 2017-02-02 19:16 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches

On 2/1/17 3:29 PM, Gerald Pfeifer wrote:

> On Tue, 17 Jan 2017, Josh Conner via gcc-patches wrote:
>> Attached is my recommended patch for changes to the web docs describing
>> Fuchsia support. Please let me know if there's anything else I can do.
> This looks fine (just remove the blank before "Fuchsia"); and
> sorry for the delay getting back to this!

Done. Thanks!

- Josh

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-02-02 19:16 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08 22:55 [PATCH] Add support for Fuchsia (OS) Josh Conner
2016-12-09  8:26 ` Andrew Pinski
2016-12-09 19:33   ` Josh Conner
2016-12-09 19:43     ` Josh Conner
2016-12-10 11:26 ` Richard Earnshaw
2016-12-12 21:31   ` Josh Conner via gcc-patches
2016-12-19 18:07     ` Josh Conner via gcc-patches
2016-12-27 20:46       ` Josh Conner via gcc-patches
2017-01-10 15:54     ` Richard Earnshaw (lists)
2017-01-10 18:02       ` Josh Conner via gcc-patches
2016-12-11 15:25 ` Gerald Pfeifer
2016-12-12 21:53   ` Josh Conner via gcc-patches
2017-01-17 21:49   ` Josh Conner via gcc-patches
2017-02-01 23:29     ` Gerald Pfeifer
2017-02-02 19:16       ` Josh Conner via gcc-patches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).