Skip to content

cmd/gc: "unexpected GOT reloc" error calling Go functions from C #6661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gopherbot opened this issue Oct 25, 2013 · 13 comments
Closed

cmd/gc: "unexpected GOT reloc" error calling Go functions from C #6661

gopherbot opened this issue Oct 25, 2013 · 13 comments

Comments

@gopherbot
Copy link
Contributor

by manoj.dayaram@moovweb.com:

What steps will reproduce the problem?

Unfortunately, I have not been able to create a simple example for this.  Instead, I can
only offer the information on this github issue: 
moovweb/gokogiri#51

To reproduce the error (hopefully!) perform these steps in a Darwin machine:
1) go get -u github.com/moovweb/gokogiri
2) cd $GOPATH/src/github.com/moovweb/gokogiri/xpath
3) go test .

For most Darwin machines, the error should show up, but there's been a couple where the
tests run successfully.

The gist of the problem is we have a Go function that we're exporting, then in embedded
c code in a different file on the same package, we try to declare the header for that
function and use it, however, when we do, we get the below listed compile time error.

The odd thing is that we're doing this with a bunch of different functions, but the only
one that complains is exec_xpath_function.  Commenting only the usage of that functions
makes the compiler happy.

What is the expected output?
To compile normally.

What do you see instead?
gokogiri/xpath(__TEXT/__text): unexpected GOT reloc for non-dynamic symbol
exec_xpath_function

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

Which operating system are you using?
Darwin

Which version are you using?  (run 'go version')
Fails in all go versions tried, go1.0.3, go1.1, go1.2rc2

There's a lot more info in the github issue.  Basically this only seems to happen on
certain Darwin systems, not all.

Here are the specs for a Darwin system where the error is found:

$ clang --version
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.8.0
Thread model: posix

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: Mac OS X Server 10.6.8 (10K549)
      Server Configuration: Advanced
      Kernel Version: Darwin 10.8.0
      Boot Volume: Server HD
      Boot Mode: Normal
      Computer Name: computer
      User Name: user (user)
      Secure Virtual Memory: Not Enabled
      64-bit Kernel and Extensions: Yes
      Time since boot: 34 days 3:36


And the specs for a system where the error does NOT appear (aka, compiles normally):

$ clang --version
Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: Mac OS X 10.7.5 (11G63)
      Kernel Version: Darwin 11.4.2
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: computer
      User Name: user (user)
      Secure Virtual Memory: Enabled
      64-bit Kernel and Extensions: Yes
      Time since boot: 2 days 16:08
@gopherbot
Copy link
Contributor Author

Comment 1 by manoj.dayaram@moovweb.com:

Additional attempt: Tried using -ldflags=-hostobj however still got the same error.

@adg
Copy link
Contributor

adg commented Oct 25, 2013

Comment 2:

I don't think that clang is supported under 10.6. The tool chain should use gcc on those
systems.
Are you building Go from source or using a binary distribution?

@gopherbot
Copy link
Contributor Author

Comment 3 by manoj.dayaram@moovweb.com:

Building Go from source.  Using gvm to version control Go: https://github.com/moovweb/gvm

@gopherbot
Copy link
Contributor Author

Comment 4 by manoj.dayaram@moovweb.com:

Although, I've seen the error in Darwin machines 10.7+ where Go has both been built from
source and also installed via Homebrew.

@gopherbot
Copy link
Contributor Author

Comment 5 by manoj.dayaram@moovweb.com:

Here's some more information when trying to run the tests:
$  go test -x -ldflags
-extldflags=-L/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/clibs/lib
.
WORK=/tmp/go-build533157375
mkdir -p $WORK/gokogiri/xpath/_test/gokogiri/
mkdir -p $WORK/gokogiri/util/_obj/
mkdir -p $WORK/gokogiri/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/util/_obj/_go_.6 -p gokogiri/util -complete -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
-I $WORK ./util.go
mkdir -p $WORK/gokogiri/help/_obj/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/help/_obj/ -- -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 help.go
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/util.a $WORK/gokogiri/util/_obj/_go_.6
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/help/_obj/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/help/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/help/_obj/_cgo_defun.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -print-libgcc-file-name
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/_cgo_main.o -c
$WORK/gokogiri/help/_obj/_cgo_main.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/_cgo_export.o -c
$WORK/gokogiri/help/_obj/_cgo_export.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/help.cgo2.o -c
$WORK/gokogiri/help/_obj/help.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/help/_obj/_cgo_.o
$WORK/gokogiri/help/_obj/_cgo_main.o $WORK/gokogiri/help/_obj/_cgo_export.o
$WORK/gokogiri/help/_obj/help.cgo2.o -lxml2 -L../../../clibs/lib
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/help/_obj/ -dynimport $WORK/gokogiri/help/_obj/_cgo_.o -dynout
$WORK/gokogiri/help/_obj/_cgo_import.c
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/help/_obj/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/help/_obj/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/help/_obj/_cgo_import.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/help/_obj/_all.o
$WORK/gokogiri/help/_obj/_cgo_export.o $WORK/gokogiri/help/_obj/help.cgo2.o
-L../../../clibs/lib -Wl,-r -nostdlib
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/x86_64/libgcc.a
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/help/_obj/_go_.6 -p gokogiri/help -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
-I $WORK $WORK/gokogiri/help/_obj/_cgo_gotypes.go $WORK/gokogiri/help/_obj/help.cgo1.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/help.a $WORK/gokogiri/help/_obj/_go_.6
$WORK/gokogiri/help/_obj/_cgo_import.6 $WORK/gokogiri/help/_obj/_cgo_defun.6
$WORK/gokogiri/help/_obj/_all.o
mkdir -p $WORK/gokogiri/xpath/_test/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/xpath
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/xpath/_test/ -- -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 expression.go util.go
xpath.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/xpath/_test/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/xpath/_test/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/xpath/_test/_cgo_defun.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/_cgo_main.o -c $WORK/gokogiri/xpath/_test/_cgo_main.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/_cgo_export.o -c $WORK/gokogiri/xpath/_test/_cgo_export.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/expression.cgo2.o -c
$WORK/gokogiri/xpath/_test/expression.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/util.cgo2.o -c $WORK/gokogiri/xpath/_test/util.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/xpath.cgo2.o -c $WORK/gokogiri/xpath/_test/xpath.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/xpath/_test/_cgo_.o
$WORK/gokogiri/xpath/_test/_cgo_main.o $WORK/gokogiri/xpath/_test/_cgo_export.o
$WORK/gokogiri/xpath/_test/expression.cgo2.o $WORK/gokogiri/xpath/_test/util.cgo2.o
$WORK/gokogiri/xpath/_test/xpath.cgo2.o -lxml2 -L../../../clibs/lib -lxml2
-L../../../clibs/lib
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/xpath/_test/ -dynimport $WORK/gokogiri/xpath/_test/_cgo_.o -dynout
$WORK/gokogiri/xpath/_test/_cgo_import.c
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/xpath/_test/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/xpath/_test/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/xpath/_test/_cgo_import.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/xpath/_test/_all.o
$WORK/gokogiri/xpath/_test/_cgo_export.o $WORK/gokogiri/xpath/_test/expression.cgo2.o
$WORK/gokogiri/xpath/_test/util.cgo2.o $WORK/gokogiri/xpath/_test/xpath.cgo2.o
-L../../../clibs/lib -L../../../clibs/lib -Wl,-r -nostdlib
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/x86_64/libgcc.a
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/xpath/_test/_go_.6 -p gokogiri/xpath -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/xpath
-I $WORK -I
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/pkg/darwin_amd64
./util_test.go ./xpath_test.go $WORK/gokogiri/xpath/_test/_cgo_gotypes.go
$WORK/gokogiri/xpath/_test/expression.cgo1.go $WORK/gokogiri/xpath/_test/util.cgo1.go
$WORK/gokogiri/xpath/_test/xpath.cgo1.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/xpath/_test/gokogiri/xpath.a $WORK/gokogiri/xpath/_test/_go_.6
$WORK/gokogiri/xpath/_test/_cgo_import.6 $WORK/gokogiri/xpath/_test/_cgo_defun.6
$WORK/gokogiri/xpath/_test/_all.o
cd $WORK/gokogiri/xpath/_test
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o ./_go_.6 -p testmain
-complete -D "" -I . -I $WORK ./_testmain.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK ./main.a ./_go_.6
cd .
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6l -o
$WORK/gokogiri/xpath/_test/xpath.test -L $WORK/gokogiri/xpath/_test -L $WORK -L
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/pkg/darwin_amd64
-extldflags=-L/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/clibs/lib
$WORK/gokogiri/xpath/_test/main.a
# testmain
gokogiri/xpath(__TEXT/__text): unexpected GOT reloc for non-dynamic symbol
exec_xpath_function2
$WORK/gokogiri/xpath/_test/xpath.test
FAIL    gokogiri/xpath [build failed]

@rsc
Copy link
Contributor

rsc commented Oct 29, 2013

Comment 6:

Can you post the log including the -ldflags=-hostobj? If you want the other flag too you
will need to write one -ldflags and quote the arguments:
"-ldflags=-hostobj -extldflags=..."

@gopherbot
Copy link
Contributor Author

Comment 7 by manoj.dayaram@moovweb.com:

Hmmm, that's odd.  It's telling me that flag is unrecognized:
$ go test -x -ldflags="-hostobj
-extldflags=-L/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/clibs/lib"
.
WORK=/tmp/go-build716375047
mkdir -p $WORK/gokogiri/xpath/_test/gokogiri/
mkdir -p $WORK/gokogiri/util/_obj/
mkdir -p $WORK/gokogiri/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/util/_obj/_go_.6 -p gokogiri/util -complete -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
-I $WORK ./util.go
mkdir -p $WORK/gokogiri/help/_obj/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/help/_obj/ -- -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 help.go
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/util.a $WORK/gokogiri/util/_obj/_go_.6
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/help/_obj/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/help/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/help/_obj/_cgo_defun.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -print-libgcc-file-name
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/_cgo_main.o -c
$WORK/gokogiri/help/_obj/_cgo_main.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/_cgo_export.o -c
$WORK/gokogiri/help/_obj/_cgo_export.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/help.cgo2.o -c
$WORK/gokogiri/help/_obj/help.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/help/_obj/_cgo_.o
$WORK/gokogiri/help/_obj/_cgo_main.o $WORK/gokogiri/help/_obj/_cgo_export.o
$WORK/gokogiri/help/_obj/help.cgo2.o -lxml2 -L../../../clibs/lib
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/help/_obj/ -dynimport $WORK/gokogiri/help/_obj/_cgo_.o -dynout
$WORK/gokogiri/help/_obj/_cgo_import.c
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/help/_obj/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/help/_obj/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/help/_obj/_cgo_import.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/help/_obj/_all.o
$WORK/gokogiri/help/_obj/_cgo_export.o $WORK/gokogiri/help/_obj/help.cgo2.o
-L../../../clibs/lib -Wl,-r -nostdlib
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/x86_64/libgcc.a
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/help/_obj/_go_.6 -p gokogiri/help -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
-I $WORK $WORK/gokogiri/help/_obj/_cgo_gotypes.go $WORK/gokogiri/help/_obj/help.cgo1.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/help.a $WORK/gokogiri/help/_obj/_go_.6
$WORK/gokogiri/help/_obj/_cgo_import.6 $WORK/gokogiri/help/_obj/_cgo_defun.6
$WORK/gokogiri/help/_obj/_all.o
mkdir -p $WORK/gokogiri/xpath/_test/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/xpath
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/xpath/_test/ -- -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 expression.go util.go
xpath.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/xpath/_test/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/xpath/_test/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/xpath/_test/_cgo_defun.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/_cgo_main.o -c $WORK/gokogiri/xpath/_test/_cgo_main.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/_cgo_export.o -c $WORK/gokogiri/xpath/_test/_cgo_export.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/expression.cgo2.o -c
$WORK/gokogiri/xpath/_test/expression.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/util.cgo2.o -c $WORK/gokogiri/xpath/_test/util.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/xpath.cgo2.o -c $WORK/gokogiri/xpath/_test/xpath.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/xpath/_test/_cgo_.o
$WORK/gokogiri/xpath/_test/_cgo_main.o $WORK/gokogiri/xpath/_test/_cgo_export.o
$WORK/gokogiri/xpath/_test/expression.cgo2.o $WORK/gokogiri/xpath/_test/util.cgo2.o
$WORK/gokogiri/xpath/_test/xpath.cgo2.o -lxml2 -L../../../clibs/lib -lxml2
-L../../../clibs/lib
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/xpath/_test/ -dynimport $WORK/gokogiri/xpath/_test/_cgo_.o -dynout
$WORK/gokogiri/xpath/_test/_cgo_import.c
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/xpath/_test/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/xpath/_test/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/xpath/_test/_cgo_import.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/xpath/_test/_all.o
$WORK/gokogiri/xpath/_test/_cgo_export.o $WORK/gokogiri/xpath/_test/expression.cgo2.o
$WORK/gokogiri/xpath/_test/util.cgo2.o $WORK/gokogiri/xpath/_test/xpath.cgo2.o
-L../../../clibs/lib -L../../../clibs/lib -Wl,-r -nostdlib
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/x86_64/libgcc.a
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/xpath/_test/_go_.6 -p gokogiri/xpath -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/xpath
-I $WORK -I
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/pkg/darwin_amd64
./util_test.go ./xpath_test.go $WORK/gokogiri/xpath/_test/_cgo_gotypes.go
$WORK/gokogiri/xpath/_test/expression.cgo1.go $WORK/gokogiri/xpath/_test/util.cgo1.go
$WORK/gokogiri/xpath/_test/xpath.cgo1.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/xpath/_test/gokogiri/xpath.a $WORK/gokogiri/xpath/_test/_go_.6
$WORK/gokogiri/xpath/_test/_cgo_import.6 $WORK/gokogiri/xpath/_test/_cgo_defun.6
$WORK/gokogiri/xpath/_test/_all.o
cd $WORK/gokogiri/xpath/_test
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o ./_go_.6 -p testmain
-complete -D "" -I . -I $WORK ./_testmain.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK ./main.a ./_go_.6
cd .
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6l -o
$WORK/gokogiri/xpath/_test/xpath.test -L $WORK/gokogiri/xpath/_test -L $WORK -L
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/pkg/darwin_amd64
-hostobj
-extldflags=-L/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/clibs/lib
$WORK/gokogiri/xpath/_test/main.a
# testmain
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6l: unknown flag -hostobj
$WORK/gokogiri/xpath/_test/xpath.test
FAIL    gokogiri/xpath [build failed]

@ianlancetaylor
Copy link
Contributor

Comment 8:

I think rsc just said -hostobj because you said it yourself in comment #1.
You're quite right: ld does not have a -hostobj option.  Are you thinking of
-linkmode=external?

@gopherbot
Copy link
Contributor Author

Comment 9 by manoj.dayaram@moovweb.com:

lol, yeah, my bad.  Here's the real output:
$ go test -x -hostobj
-ldflags="-extldflags=-L/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/clibs/lib"
.
WORK=/tmp/go-build267804530
mkdir -p $WORK/gokogiri/xpath/_test/gokogiri/
mkdir -p $WORK/gokogiri/util/_obj/
mkdir -p $WORK/gokogiri/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/util/_obj/_go_.6 -p gokogiri/util -complete -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
-I $WORK ./util.go
mkdir -p $WORK/gokogiri/help/_obj/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/help/_obj/ -- -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 help.go
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/util
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/util.a $WORK/gokogiri/util/_obj/_go_.6
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/help/_obj/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/help/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/help/_obj/_cgo_defun.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -print-libgcc-file-name
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/_cgo_main.o -c
$WORK/gokogiri/help/_obj/_cgo_main.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/_cgo_export.o -c
$WORK/gokogiri/help/_obj/_cgo_export.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/help/_obj/
-I../../../clibs/include/libxml2 -o $WORK/gokogiri/help/_obj/help.cgo2.o -c
$WORK/gokogiri/help/_obj/help.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/help/_obj/_cgo_.o
$WORK/gokogiri/help/_obj/_cgo_main.o $WORK/gokogiri/help/_obj/_cgo_export.o
$WORK/gokogiri/help/_obj/help.cgo2.o -lxml2 -L../../../clibs/lib
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/help/_obj/ -dynimport $WORK/gokogiri/help/_obj/_cgo_.o -dynout
$WORK/gokogiri/help/_obj/_cgo_import.c
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/help/_obj/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/help/_obj/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/help/_obj/_cgo_import.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/help/_obj/_all.o
$WORK/gokogiri/help/_obj/_cgo_export.o $WORK/gokogiri/help/_obj/help.cgo2.o
-L../../../clibs/lib -Wl,-r -nostdlib
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/x86_64/libgcc.a
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/help/_obj/_go_.6 -p gokogiri/help -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/help
-I $WORK $WORK/gokogiri/help/_obj/_cgo_gotypes.go $WORK/gokogiri/help/_obj/help.cgo1.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/help.a $WORK/gokogiri/help/_obj/_go_.6
$WORK/gokogiri/help/_obj/_cgo_import.6 $WORK/gokogiri/help/_obj/_cgo_defun.6
$WORK/gokogiri/help/_obj/_all.o
mkdir -p $WORK/gokogiri/xpath/_test/
cd
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/xpath
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/xpath/_test/ -- -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 expression.go util.go
xpath.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/xpath/_test/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/xpath/_test/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/xpath/_test/_cgo_defun.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/_cgo_main.o -c $WORK/gokogiri/xpath/_test/_cgo_main.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/_cgo_export.o -c $WORK/gokogiri/xpath/_test/_cgo_export.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/expression.cgo2.o -c
$WORK/gokogiri/xpath/_test/expression.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/util.cgo2.o -c $WORK/gokogiri/xpath/_test/util.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -I $WORK/gokogiri/xpath/_test/
-I../../../clibs/include/libxml2 -I../../../clibs/include/libxml2 -o
$WORK/gokogiri/xpath/_test/xpath.cgo2.o -c $WORK/gokogiri/xpath/_test/xpath.cgo2.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/xpath/_test/_cgo_.o
$WORK/gokogiri/xpath/_test/_cgo_main.o $WORK/gokogiri/xpath/_test/_cgo_export.o
$WORK/gokogiri/xpath/_test/expression.cgo2.o $WORK/gokogiri/xpath/_test/util.cgo2.o
$WORK/gokogiri/xpath/_test/xpath.cgo2.o -lxml2 -L../../../clibs/lib -lxml2
-L../../../clibs/lib
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/cgo -objdir
$WORK/gokogiri/xpath/_test/ -dynimport $WORK/gokogiri/xpath/_test/_cgo_.o -dynout
$WORK/gokogiri/xpath/_test/_cgo_import.c
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6c -F -V -w -I
$WORK/gokogiri/xpath/_test/ -I /Users/jenkins/.gvm/gos/go1.2rc2/pkg/darwin_amd64 -o
$WORK/gokogiri/xpath/_test/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64
$WORK/gokogiri/xpath/_test/_cgo_import.c
gcc -I . -g -O2 -fPIC -m64 -pthread -fno-common -o $WORK/gokogiri/xpath/_test/_all.o
$WORK/gokogiri/xpath/_test/_cgo_export.o $WORK/gokogiri/xpath/_test/expression.cgo2.o
$WORK/gokogiri/xpath/_test/util.cgo2.o $WORK/gokogiri/xpath/_test/xpath.cgo2.o
-L../../../clibs/lib -L../../../clibs/lib -Wl,-r -nostdlib
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/x86_64/libgcc.a
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o
$WORK/gokogiri/xpath/_test/_go_.6 -p gokogiri/xpath -D
_/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/src/gokogiri/xpath
-I $WORK -I
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/pkg/darwin_amd64
./util_test.go ./xpath_test.go $WORK/gokogiri/xpath/_test/_cgo_gotypes.go
$WORK/gokogiri/xpath/_test/expression.cgo1.go $WORK/gokogiri/xpath/_test/util.cgo1.go
$WORK/gokogiri/xpath/_test/xpath.cgo1.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK
$WORK/gokogiri/xpath/_test/gokogiri/xpath.a $WORK/gokogiri/xpath/_test/_go_.6
$WORK/gokogiri/xpath/_test/_cgo_import.6 $WORK/gokogiri/xpath/_test/_cgo_defun.6
$WORK/gokogiri/xpath/_test/_all.o
cd $WORK/gokogiri/xpath/_test
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6g -o ./_go_.6 -p testmain
-complete -D "" -I . -I $WORK ./_testmain.go
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/pack grcP $WORK ./main.a ./_go_.6
cd .
/Users/jenkins/.gvm/gos/go1.2rc2/pkg/tool/darwin_amd64/6l -o
$WORK/gokogiri/xpath/_test/xpath.test -L $WORK/gokogiri/xpath/_test -L $WORK -L
/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/pkg/darwin_amd64
-extldflags=-L/Users/Shared/JenkinsNet/Home/workspace/manhattan-4.8-build/label/darwin_amd64/.build-sandbox/clibs/lib
$WORK/gokogiri/xpath/_test/main.a
# testmain
gokogiri/xpath(__TEXT/__text): unexpected GOT reloc for non-dynamic symbol
exec_xpath_function
$WORK/gokogiri/xpath/_test/xpath.test -hostobj .
FAIL    gokogiri/xpath [build failed]

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 10:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 11:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 12:

Labels changed: added repo-main.

@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc
Copy link
Contributor

rsc commented Apr 28, 2015

Per #9511, we will not be making any further bug fixes specific to 10.6.

@rsc rsc closed this as completed Apr 28, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants