From ea73649343b5d199d7f3d8525399e7a07a608543 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 24 Jan 2017 09:32:29 -0800 Subject: [PATCH] doc: update gccgo docs Update docs on correspondence between Go releases and GCC releases. Update C type that corresponds to Go type `int`. Drop out of date comments about Ubuntu and RTEMS. Change-Id: Ic1b5ce9f242789af23ec3b7e7a64c9d257d6913e Reviewed-on: https://go-review.googlesource.com/35631 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- doc/gccgo_install.html | 63 +++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/doc/gccgo_install.html b/doc/gccgo_install.html index ef27fd1818..4f6a911541 100644 --- a/doc/gccgo_install.html +++ b/doc/gccgo_install.html @@ -52,6 +52,19 @@ user libraries. The Go 1.4 runtime is not fully merged, but that should not be visible to Go programs.

+

+The GCC 6 releases include a complete implementation of the Go 1.6.1 +user libraries. The Go 1.6 runtime is not fully merged, but that +should not be visible to Go programs. +

+ +

+The GCC 7 releases are expected to include a complete implementation +of the Go 1.8 user libraries. As with earlier releases, the Go 1.8 +runtime is not fully merged, but that should not be visible to Go +programs. +

+

Source code

@@ -160,23 +173,6 @@ make make install -

A note on Ubuntu

- -

-Current versions of Ubuntu and versions of GCC before 4.8 disagree on -where system libraries and header files are found. This is not a -gccgo issue. When building older versions of GCC, setting these -environment variables while configuring and building gccgo may fix the -problem. -

- -
-LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
-C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
-CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
-export LIBRARY_PATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH
-
-

Using gccgo

@@ -364,12 +360,15 @@ or with C++ code compiled using extern "C".

Types

-Basic types map directly: an int in Go is an int -in C, an int32 is an int32_t, -etc. Go byte is equivalent to C unsigned -char. -Pointers in Go are pointers in C. A Go struct is the same as C -struct with the same fields and types. +Basic types map directly: an int32 in Go is +an int32_t in C, an int64 is +an int64_t, etc. +The Go type int is an integer that is the same size as a +pointer, and as such corresponds to the C type intptr_t. +Go byte is equivalent to C unsigned char. +Pointers in Go are pointers in C. +A Go struct is the same as C struct with the +same fields and types.

@@ -380,7 +379,7 @@ structure (this is subject to change):

 struct __go_string {
   const unsigned char *__data;
-  int __length;
+  intptr_t __length;
 };
 
@@ -400,8 +399,8 @@ A slice in Go is a structure. The current definition is
 struct __go_slice {
   void *__values;
-  int __count;
-  int __capacity;
+  intptr_t __count;
+  intptr_t __capacity;
 };
 
@@ -526,15 +525,3 @@ This procedure is full of unstated caveats and restrictions and we make no guarantee that it will not change in the future. It is more useful as a starting point for real Go code than as a regular procedure.

- -

RTEMS Port

-

-The gccgo compiler has been ported to -RTEMS. RTEMS is a real-time executive -that provides a high performance environment for embedded applications -on a range of processors and embedded hardware. The current gccgo -port is for x86. The goal is to extend the port to most of the - -architectures supported by RTEMS. For more information on the port, -as well as instructions on how to install it, please see this -RTEMS Wiki page.