Home | History | Annotate | Download | only in doc

Lines Matching full:code

14 does not cover code generated by gccgo).
18 Note that gccgo is not the <code>gc</code> compiler; see
55 <h2 id="Source_code">Source code</h2>
60 the gccgo source code is accessible via Subversion. The
63 GCC source code</a>. The gccgo source code is included. As a
65 a branch of the main GCC code
66 repository: <code>svn://gcc.gnu.org/svn/gcc/branches/gccgo</code>.
71 Note that although <code>gcc.gnu.org</code> is the most convenient way
72 to get the source code for the Go frontend, it is not where the master
85 site</a>. When you run <code>configure</code>, add the
86 option <code>--enable-languages=c,c++,go</code> (along with other
90 using the <code>configure</code> option <code>--with-arch=i586</code>
93 the <code>-m32</code> option, then use the <code>configure</code>
94 option <code>--with-arch-32=i586</code>.
110 using <code>--enable-gold=default</code> when you run
111 the <code>configure</code> script. Before building, you must install
113 this (you can replace <code>/opt/gold</code> with any directory to
131 option <code>--with-ld=<var>GOLD_BINARY</var></code>.
141 running the gcc <code>configure</code> script.
143 script <code>contrib/download_prerequisites</code> in the GCC sources.
150 the <code>--with-ld</code> option if you are using the gold linker as
184 installation also includes a version of the <code>go</code> command,
190 To compile a file without using the <code>go</code> command:
198 That produces <code>file.o</code>. To link files together to form an
214 Set the <code>LD_LIBRARY_PATH</code> environment variable:
225 Here <code>${prefix}</code> is the <code>--prefix</code> option used
227 normally <code>/usr</code>. Whether to use <code>lib</code>
228 or <code>lib64</code> depends on the target.
229 Typically <code>lib64</code> is correct for x86_64 systems,
230 and <code>lib</code> is correct for other systems. The idea is to
231 name the directory where <code>libgo.so</code> is found.
238 Passing a <code>-Wl,-R</code> option when you link (replace lib with
251 Use the <code>-static-libgo</code> option to link statically against
258 Use the <code>-static</code> option to do a fully static link (the
259 default for the <code>gc</code> compiler).
268 that are language independent, notably the <code>-O</code>
269 and <code>-g</code> options.
273 The <code>-fgo-pkgpath=PKGPATH</code> option may be used to set a
280 The <code>PKGPATH</code> may be any string; a good choice for the
285 The <code>-I</code> and <code>-L</code> options, which are synonyms
307 <li><code><var>FILE</var>.gox</code>
308 <li><code>lib<var>FILE</var>.so</code>
309 <li><code>lib<var>FILE</var>.a</code>
310 <li><code><var>FILE</var>.o</code>
314 <code><var>FILE</var>.gox</code>, when used, will typically contain
316 <code><var>FILE</var>.o</code> via
326 may pass the <code>-I</code> or <code>-L</code> option to
328 <code>-L</code> option is also passed to the linker.
347 If you use the <code>-g</code> option when you compile, you can run
348 <code>gdb</code> on your executable. The debugger has only limited
361 or with C++ code compiled using <code>extern "C"</code>.
367 Basic types map directly: an <code>int</code> in Go is an <code>int</code>
368 in C, an <code>int32</code> is an <code>int32_t</code>,
369 etc. Go <code>byte</code> is equivalent to C <code>unsigned
370 char</code>.
371 Pointers in Go are pointers in C. A Go <code>struct</code> is the same as C
372 <code>struct</code> with the same fields and types.
376 The Go <code>string</code> type is currently defined as a two-element
391 For example, Go <code>*[10]int</code> is equivalent to C <code>int*</code>,
411 struct points to the code of the function, which will be equivalent to
427 Go <code>interface</code>, <code>channel</code>, and <code>map</code>
428 types have no corresponding C type (<code>interface</code> is a
429 two-element struct and <code>channel</code> and <code>map</code> are
431 <code>enum</code> types correspond to some integer type, but precisely
432 which one is difficult to predict in general; use a cast. C <code>union</code>
433 types have no corresponding Go type. C <code>struct</code> types containing
434 bitfields have no corresponding Go type. C++ <code>class</code> types have
453 Go code can call C functions directly using a Go extension implemented
455 <code>//extern NAME</code>. For example, here is how the C function
456 <code>open</code> can be declared in Go:
467 <code>byte</code> with a terminating zero byte. So a sample call
468 from Go would look like (after importing the <code>syscall</code> package):
478 <code>os.Open</code> function instead).
483 to <code>read</code>, calling the C function may block the Go program.
486 the <code>gc</code> compiler.
492 <code>prefix.package.Functionname</code>. The prefix is set by
493 the <code>-fgo-prefix</code> option used when the package is compiled;
494 if the option is not used, the default is <code>go</code>.
504 Automatic generation of Go declarations from C source code</h3>
508 Go declarations from C code. The facility is rather awkward, and most
510 the <code>-gccgo</code> option instead.
514 Compile your C code as usual, and add the option
515 <code>-fdump-go-spec=<var>FILENAME</var></code>. This will create the
516 file <code><var>FILENAME</var></code> as a side effect of the
518 variables and functions declared in the C code. C types that can not
519 code. The
520 generated file will not have a <code>package</code> declaration, but
527 starting point for real Go code than as a regular procedure.
533 <code>RTEMS</code></a>. <code>RTEMS</code> is a real-time executive
538 architectures supported by <code>RTEMS</code></a>. For more information on the port,
540 <a href="http://www.rtems.org/wiki/index.php/GCCGoRTEMS"><code>RTEMS</code> Wiki page</a>.