<p dir="auto">by <strong>beoran</strong>:</p>
<pre class="notranslate">What steps will reproduce the problem?
1. Unpack the attached testcase and cd to that directory. 
2. $ ./makelib.bash
3. $ make install
4. $ gotest 

What is the expected output? 
SUCCESS

What do you see instead?
FAIL

What is your $GOOS?  $GOARCH?
linux 386


Which revision are you using?  (hg identify)
8d9692dbc21b+ tip


Please provide any additional information below.

As the title said cgo doesn't seem to handle (taking addresses of) global
struct values corectly. It generates a pointer to the type but that pointer
is never filleed in, and always ends up nil. I thinks this should be
corected somehow.</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/828/0/ges.tar.gz" rel="nofollow">ges.tar.gz</a> (860 bytes)</li>
</ol>
<p dir="auto">In Go 1.3.x, it was possible to statically link a program which imports the net package. This is important when building programs for cut-down environments, for example busybox.</p>
<p dir="auto">The problem can be reproduced on Ubuntu as <a href="https://groups.google.com/forum/#!msg/golang-nuts/S2WDcm47bhA/W243-l49WDsJ" rel="nofollow">reported</a> by Vasiliy Tolstov:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="package main 
import &quot;net&quot; 
func main() { 
        _, _ = net.ResolveIPAddr(&quot;ip&quot;, &quot;google.com&quot;) 
} "><pre class="notranslate"><code class="notranslate">package main 
import "net" 
func main() { 
        _, _ = net.ResolveIPAddr("ip", "google.com") 
} 
</code></pre></div>
<p dir="auto">It is possible to statically link this program in Go 1.3.x by issuing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CGO_ENABLED=0 go build -a -x"><pre class="notranslate"><code class="notranslate">CGO_ENABLED=0 go build -a -x
</code></pre></div>
<p dir="auto">but with Go 1.4, the same technique creates the following runtime dependencies:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="linux-vdso.so.1 (0x00007fff603fe000) 
libpthread.so.0 =&gt; /lib64/libpthread.so.0 (0x00007f3bd0608000) 
libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f3bd0260000) 
/lib64/ld-linux-x86-64.so.2 (0x00007f3bd0825000) "><pre class="notranslate"><code class="notranslate">linux-vdso.so.1 (0x00007fff603fe000) 
libpthread.so.0 =&gt; /lib64/libpthread.so.0 (0x00007f3bd0608000) 
libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f3bd0260000) 
/lib64/ld-linux-x86-64.so.2 (0x00007f3bd0825000) 
</code></pre></div>