@@ -46,6 +46,12 @@ <h2 id="Releases">Releases</h2>
46
46
The GCC 4.9 releases include a complete Go 1.2 implementation.
47
47
</ p >
48
48
49
+ < p >
50
+ The GCC 5 releases include a complete implementation of the Go 1.4
51
+ user libraries. The Go 1.4 runtime is not fully merged, but that
52
+ should not be visible to Go programs.
53
+ </ p >
54
+
49
55
< h2 id ="Source_code "> Source code</ h2 >
50
56
51
57
< p >
@@ -174,13 +180,10 @@ <h3 id="Ubuntu">A note on Ubuntu</h3>
174
180
< h2 id ="Using_gccgo "> Using gccgo</ h2 >
175
181
176
182
< p >
177
- The gccgo compiler works like other gcc frontends. The gccgo
178
- installation does not currently include a version of
179
- the < code > go</ code > command. However if you have the < code > go</ code >
180
- command from an installation of the < code > gc</ code > compiler, you can
181
- use it with gccgo by passing the option < code > -compiler gccgo</ code >
182
- to < code > go build</ code > or < code > go install</ code > or < code > go
183
- test</ code > .
183
+ The gccgo compiler works like other gcc frontends. As of GCC 5 the gccgo
184
+ installation also includes a version of the < code > go</ code > command,
185
+ which may be used to build Go programs as described at
186
+ < a href ="http://golang.org/cmd/go "> http://golang.org/cmd/go</ a > .
184
187
</ p >
185
188
186
189
< p >
@@ -232,13 +235,14 @@ <h2 id="Using_gccgo">Using gccgo</h2>
232
235
233
236
< li >
234
237
< p >
235
- Passing a < code > -Wl,-R</ code > option when you link:
238
+ Passing a < code > -Wl,-R</ code > option when you link (replace lib with
239
+ lib64 if appropriate for your system):
236
240
</ p >
237
241
238
242
< pre >
239
- gccgo -o file file.o -Wl,-R,${prefix}/lib/gcc/MACHINE/VERSION
243
+ go build -gccgoflags -Wl,-R,${prefix}/lib/gcc/MACHINE/VERSION
240
244
[or]
241
- gccgo -o file file.o -Wl,-R,${prefix}/lib64 /gcc/MACHINE/VERSION
245
+ gccgo -o file file.o -Wl,-R,${prefix}/lib /gcc/MACHINE/VERSION
242
246
</ pre >
243
247
</ li >
244
248
@@ -266,27 +270,33 @@ <h2 id="Options">Options</h2>
266
270
</ p >
267
271
268
272
< p >
269
- The < code > -fgo-prefix=PREFIX</ code > option may be used to set a unique
270
- prefix for the package being compiled. This option is intended for
271
- use with large programs that contain many packages, in order to allow
272
- multiple packages to use the same identifier as the package name.
273
- The < code > PREFIX</ code > may be any string; a good choice for the
274
- string is the directory where the package will be installed.
273
+ The < code > -fgo-pkgpath=PKGPATH</ code > option may be used to set a
274
+ unique prefix for the package being compiled.
275
+ This option is automatically used by the go command, but you may want
276
+ to use it if you invoke gccgo directly.
277
+ This option is intended for use with large
278
+ programs that contain many packages, in order to allow multiple
279
+ packages to use the same identifier as the package name.
280
+ The < code > PKGPATH</ code > may be any string; a good choice for the
281
+ string is the path used to import the package.
275
282
</ p >
276
283
277
284
< p >
278
285
The < code > -I</ code > and < code > -L</ code > options, which are synonyms
279
286
for the compiler, may be used to set the search path for finding
280
287
imports.
288
+ These options are not needed if you build with the go command.
281
289
</ p >
282
290
283
291
< h2 id ="Imports "> Imports</ h2 >
284
292
285
293
< p >
286
294
When you compile a file that exports something, the export
287
- information will be stored directly in the object file. When
288
- you import a package, you must tell gccgo how to
289
- find the file.
295
+ information will be stored directly in the object file.
296
+ If you build with gccgo directly, rather than with the go command,
297
+ then when you import a package, you must tell gccgo how to find the
298
+ file.
299
+ </ p >
290
300
291
301
< p >
292
302
When you import the package < var > FILE</ var > with gccgo,
@@ -319,9 +329,10 @@ <h2 id="Imports">Imports</h2>
319
329
</ p >
320
330
321
331
< p >
322
- The gccgo compiler does not currently (2013 -06-20 ) record
332
+ The gccgo compiler does not currently (2015 -06-15 ) record
323
333
the file name of imported packages in the object file. You must
324
334
arrange for the imported data to be linked into the program.
335
+ Again, this is not necessary when building with the go command.
325
336
</ p >
326
337
327
338
< pre >
0 commit comments