]> Cypherpunks repositories - gostls13.git/commitdiff
doc: add notes about cgo to go1.8.html
authorIan Lance Taylor <iant@golang.org>
Tue, 29 Nov 2016 22:17:35 +0000 (14:17 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 29 Nov 2016 22:18:38 +0000 (22:18 +0000)
TBR=See https://golang.org/cl/33244

Updates #17929

Change-Id: I0215a7873977be81f2f84374f0b628abaf0e57c1
Reviewed-on: https://go-review.googlesource.com/33667
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go1.8.html
doc/go1.8.txt

index 534b287de8de4bba97371233e3c529006275ddde..f5851e30e18aae56a53e0ab2befe5fa6d72b69b5 100644 (file)
@@ -244,7 +244,36 @@ see improvements closer to the 32-bit ARM numbers.
 
 <h3 id="cmd_cgo">Cgo</h3>
 
-<p>TODO</p>
+<p> <!-- CL 29991 -->
+The environment variable <code>PKG_CONFIG</code> may now be used to
+set the program to run to handle <code>#cgo pkg-config</code>
+directives.  The default is <code>pkg-config</code>, the program
+always used by earlier releases.  This is intended to make it easier
+to cross-compile
+<a href="/cmd/cgo/">cgo</a> code.
+</p>
+
+<p> <!-- CL 32354 -->
+The <a href="/cmd/cgo/">cgo</a> tool now supports a <code>-srcdir</code>
+option, which is used by the <a href="/cmd/go/">go</a> command.
+</p>
+
+<p> <!-- CL 31768, 31811 -->
+If <a href="/cmd/cgo/">cgo</a> code calls <code>C.malloc</code>, and
+<code>malloc</code> returns <code>NULL</code>, the program will now
+crash with an out of memory error.
+<code>C.malloc</code> will never return <code>nil</code>.
+Unlike most C functions, <code>C.malloc</code> may not be used in a
+two-result form returning an errno value.
+</p>
+
+<p> <!-- CL 33237 -->
+If <a href="/cmd/cgo/">cgo</a> is used to call a C function passing a
+pointer to a C union, and if the C union can contain any pointer
+values, and if <a href="/cmd/cgo/#hdr-Passing_pointers">cgo pointer
+checking</a> is enabled (as it is by default), the union value is now
+checked for Go pointers.
+</p>
 
 <h3 id="gccgo">Gccgo</h3>
 
index 93aa31c12d274461024c4610c7d12241b8de1741..95cc5b60dc4c0c7e8881880adce52589e0fb4334 100644 (file)
@@ -13,12 +13,6 @@ go: can set secure/insecure GIT schemes using GIT_ALLOW_PROTOCOL env var (CL 301
 
 API additions and behavior changes:
 
-cmd/cgo: add #line directives to avoid printing bogus references to Go source files (CL 32613)
-cmd/cgo: add -srcdir option (CL 32354)
-cmd/cgo: don't ignore qualifiers, don't cast to void* (CL 33097)
-cmd/cgo: fix line info in _cgo_gotypes.go (CL 29713)
-cmd/cgo: throw if C.malloc returns nil (CL 31768)
-
 cmd/compile, runtime, etc: get rid of constant FP registers (CL 28095)
 cmd/compile, runtime: add go:yeswritebarrierrec pragma (CL 30938)
 cmd/compile/internal/gc: add runtime/trace support (CL 25354)
@@ -50,7 +44,6 @@ cmd/go: make bug subcommand open the browser (CL 29210)
 cmd/go: make go test -i -o x.test actually write x.test (CL 31352)
 cmd/go: print more env variables in "go env" (CL 31330)
 cmd/go: referee another vendor vs symlink fight (CL 31665)
-cmd/go: use cgo -srcdir when using SWIG (CL 32485)
 
 cmd/internal/obj, cmd/link: darwin dynlink support (CL 29393)
 cmd/internal/objfile: add ppc64/ppc64le disassembler support (CL 9682)