<ol dir="auto">
<li>What version of Go are you using (<code class="notranslate">go version</code>)?</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# go version
go version go1.6.1 linux/amd64"><pre class="notranslate"><code class="notranslate"># go version
go version go1.6.1 linux/amd64
</code></pre></div>
<ol dir="auto">
<li>What operating system and processor architecture are you using (<code class="notranslate">go env</code>)?</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# go env
GOARCH=&quot;amd64&quot;
GOBIN=&quot;&quot;
GOEXE=&quot;&quot;
GOHOSTARCH=&quot;amd64&quot;
GOHOSTOS=&quot;linux&quot;
GOOS=&quot;linux&quot;
GOPATH=&quot;/root/hyperbuild&quot;
GORACE=&quot;&quot;
GOROOT=&quot;/usr/lib/go&quot;
GOTOOLDIR=&quot;/usr/lib/go/pkg/tool/linux_amd64&quot;
GO15VENDOREXPERIMENT=&quot;1&quot;
CC=&quot;gcc&quot;
GOGCCFLAGS=&quot;-fPIC -m64 -pthread -fmessage-length=0&quot;
CXX=&quot;g++&quot;
CGO_ENABLED=&quot;1&quot;"><pre class="notranslate"><code class="notranslate"># go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/hyperbuild"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
</code></pre></div>
<ol dir="auto">
<li>What did you do?</li>
</ol>
<p dir="auto">Tried to build an compile <a href="https://github.com/hyperhq/hyperd.git">https://github.com/hyperhq/hyperd.git</a></p>
<blockquote>
<p dir="auto">mkdir -p ${GOPATH}/src/github.com/hyperhq<br>
cd ${GOPATH}/src/github.com/hyperhq<br>
git clone <a href="https://github.com/hyperhq/runv.git">https://github.com/hyperhq/runv.git</a> runv<br>
git clone <a href="https://github.com/hyperhq/hyperd.git">https://github.com/hyperhq/hyperd.git</a> hyperd<br>
git clone <a href="https://github.com/hyperhq/hyperstart.git">https://github.com/hyperhq/hyperstart.git</a> hyperstart<br>
cd hyperd<br>
./autogen.sh<br>
./configure<br>
make</p>
</blockquote>
<ol dir="auto">
<li>What did you expect to see?</li>
</ol>
<p dir="auto">Two go binaries <code class="notranslate">hyperd</code> and <code class="notranslate">hyperctl</code>to be built succesfully like it happens in Ubuntu/debian.</p>
<ol dir="auto">
<li>What did you see instead?</li>
</ol>
<p dir="auto">During make, the error thrown was:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# make
make[1]: Entering directory '/root/hyperbuild/src/github.com/hyperhq/hyperd'
go build -tags &quot;static_build   libdm_no_deferred_remove exclude_graphdriver_btrfs&quot; -ldflags &quot;-X github.com/hyperhq/hyperd/utils.VERSION 0.5.0&quot; hyperd.go
# command-line-arguments
link: warning: option -X github.com/hyperhq/hyperd/utils.VERSION 0.5.0 may not work in future releases; use -X github.com/hyperhq/hyperd/utils.VERSION=0.5.0
**/usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1**
/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /tmp/go-link-108672170/000004.o: unrecognized relocation (0x2a) in section `.text'
/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Makefile:785: recipe for target 'build-hyperd' failed
make[1]: *** [build-hyperd] Error 2
make[1]: Leaving directory '/root/hyperbuild/src/github.com/hyperhq/hyperd'
Makefile:359: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1"><pre class="notranslate"><code class="notranslate"># make
make[1]: Entering directory '/root/hyperbuild/src/github.com/hyperhq/hyperd'
go build -tags "static_build   libdm_no_deferred_remove exclude_graphdriver_btrfs" -ldflags "-X github.com/hyperhq/hyperd/utils.VERSION 0.5.0" hyperd.go
# command-line-arguments
link: warning: option -X github.com/hyperhq/hyperd/utils.VERSION 0.5.0 may not work in future releases; use -X github.com/hyperhq/hyperd/utils.VERSION=0.5.0
**/usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1**
/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /tmp/go-link-108672170/000004.o: unrecognized relocation (0x2a) in section `.text'
/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Makefile:785: recipe for target 'build-hyperd' failed
make[1]: *** [build-hyperd] Error 2
make[1]: Leaving directory '/root/hyperbuild/src/github.com/hyperhq/hyperd'
Makefile:359: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
</code></pre></div>
<p dir="auto">Posted Makefile with the error above at: <a href="http://hastebin.com/evikapojav.mel" rel="nofollow">http://hastebin.com/evikapojav.mel</a></p>
<p dir="auto">Thanks in advance!</p>
<p dir="auto">by <strong>qeed.quan</strong>:</p>
<pre class="notranslate">Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull", "hg update default", rebuild, and
retry
what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. run test.go with the sdl bindings i attached, sdl version i used is 1.2.14

What is the expected output?
should print "test" periodically if all works ok.

What do you see instead?

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Slackware Linux 64 bit version

Which revision are you using?  (hg identify)
43cf9b39b647 weekly/weekly.2012-02-14
using go amd64


Please provide any additional information below.

I think this is a threading problem, since using pthreads also leads to segfault. when I
try to do stuff like pthread_join on a c thread that calls a go function.

I've attached my SDL bindings for SDL 1.2.14 and 
a sample go code that receives signal 11</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/3068/0/sdl.tar.gz" rel="nofollow">sdl.tar.gz</a> (7419 bytes)</li>
<li><a href="https://storage.googleapis.com/go-attachment/3068/0/test.go" rel="nofollow">test.go</a> (406 bytes)</li>
</ol>