Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

go returned unspecified error #53

Closed
ghost opened this issue Dec 12, 2014 · 4 comments
Closed

go returned unspecified error #53

ghost opened this issue Dec 12, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 12, 2014

Hello! I'm having trouble when running goxc -bc="windows,386" -d=dist -q with Go 1.4 in my project's folder (/home/nick/apps/project). Thank you in advance for looking at this!

Note: though it advices me to run goxc -t, I've already done that.

It returns the following (sorry for so long output):

nick@ubuntu:~/apps/project$ goxc -d=dist -bc="windows,386" -q
[goxc:xc] 2014/12/12 22:30:07 Toolchain not ready for {windows 386}. Re-building toolchain. (stat /home/nick/go/bin/windows_386/go.exe: no such file or directory)
# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, linux/amd64.
lib9
libbio
liblink
cmd/cc
cmd/gc
cmd/6l
cmd/8l
cmd/6a
cmd/8a
cmd/6c
cmd/8c
cmd/6g
cmd/8g
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
unicode/utf16
bytes
math
strings
strconv
bufio
sort
container/heap
encoding/base64
syscall
time
os
reflect
fmt
encoding
encoding/json
flag
path/filepath
path
io/ioutil
log
regexp/syntax
regexp
go/token
go/scanner
go/ast
go/parser
os/exec
os/signal
net/url
text/template/parse
text/template
go/doc
go/build
cmd/go
runtime (windows/386)

# Building packages and commands for host, linux/amd64.
runtime
errors
sync/atomic
unicode
unicode/utf8
math
sync
sort
io
syscall
hash
container/heap
encoding
unicode/utf16
hash/crc32
container/list
bytes
strings
bufio
text/tabwriter
time
path
crypto/subtle
crypto/cipher
crypto/hmac
internal/syscall
html
compress/bzip2
strconv
math/rand
hash/adler32
container/ring
hash/crc64
hash/fnv
image/color
image/color/palette
os
math/cmplx
reflect
regexp/syntax
crypto
crypto/md5
encoding/base64
path/filepath
net/url
io/ioutil
os/exec
regexp
crypto/aes
crypto/rc4
fmt
encoding/binary
crypto/sha1
crypto/sha256
crypto/sha512
crypto/des
encoding/pem
os/signal
cmd/pprof/internal/svg
encoding/ascii85
encoding/base32
image
index/suffixarray
runtime/race
cmd/internal/goobj
cmd/internal/rsc.io/arm/armasm
cmd/internal/rsc.io/x86/x86asm
debug/dwarf
debug/gosym
debug/plan9obj
debug/elf
debug/macho
debug/pe
flag
log
go/token
encoding/json
encoding/xml
go/scanner
cmd/internal/objfile
go/ast
text/template/parse
cmd/addr2line
compress/flate
go/parser
go/printer
text/template
compress/gzip
math/big
cmd/cgo
go/format
go/doc
cmd/fix
crypto/elliptic
go/build
encoding/asn1
crypto/ecdsa
crypto/rand
crypto/dsa
crypto/x509/pkix
crypto/rsa
encoding/hex
mime
net/http/internal
runtime/pprof
cmd/nm
cmd/gofmt
cmd/objdump
runtime/cgo
cmd/pack
cmd/pprof/internal/profile
html/template
cmd/pprof/internal/tempfile
cmd/yacc
archive/tar
cmd/pprof/internal/plugin
cmd/pprof/internal/report
cmd/pprof/internal/symbolizer
cmd/pprof/internal/symbolz
archive/zip
compress/lzw
compress/zlib
cmd/pprof/internal/commands
database/sql/driver
database/sql
cmd/pprof/internal/driver
encoding/csv
net
encoding/gob
image/draw
image/jpeg
image/gif
image/png
os/user
runtime/debug
testing
testing/iotest
testing/quick
text/scanner
crypto/x509
net/textproto
log/syslog
mime/multipart
net/mail
crypto/tls
net/http
net/smtp
cmd/go
cmd/pprof/internal/fetch
expvar
net/http/cgi
cmd/pprof
net/http/cookiejar
net/http/fcgi
net/http/httptest
net/http/httputil
net/http/pprof
net/rpc
net/rpc/jsonrpc

# Building packages and commands for windows/386.
runtime
errors
sync/atomic
unicode
unicode/utf8
math
sync
unicode/utf16
sort
io
syscall
hash
container/heap
encoding
hash/crc32
container/list
crypto/subtle
crypto/cipher
bytes
strings
bufio
text/tabwriter
time
path
crypto/hmac
html
compress/bzip2
hash/adler32
container/ring
hash/crc64
hash/fnv
image/color
log/syslog
runtime/race
strconv
math/rand
image/color/palette
math/cmplx
os
reflect
regexp/syntax
crypto
crypto/md5
encoding/base64
net/url
path/filepath
crypto/aes
io/ioutil
regexp
os/exec
crypto/rc4
crypto/sha1
crypto/sha256
crypto/sha512
encoding/pem
fmt
encoding/binary
net
os/signal
crypto/des
cmd/pprof/internal/svg
encoding/ascii85
encoding/base32
image
cmd/internal/goobj
cmd/internal/rsc.io/arm/armasm
cmd/internal/rsc.io/x86/x86asm
debug/dwarf
debug/gosym
debug/elf
debug/macho
debug/pe
debug/plan9obj
flag
log
go/token
cmd/internal/objfile
encoding/json
encoding/xml
go/scanner
go/ast
cmd/addr2line
text/template/parse
compress/flate
go/parser
go/printer
text/template
compress/gzip
math/big
encoding/hex
mime
cmd/cgo
go/format
go/doc
cmd/fix
crypto/elliptic
go/build
encoding/asn1
crypto/ecdsa
crypto/rand
crypto/rsa
crypto/dsa
crypto/x509/pkix
net/textproto
crypto/x509
mime/multipart
net/http/internal
runtime/pprof
cmd/nm
cmd/gofmt
crypto/tls
cmd/objdump
cmd/pack
cmd/pprof/internal/profile
net/http
html/template
cmd/pprof/internal/plugin
cmd/pprof/internal/tempfile
cmd/pprof/internal/symbolizer
cmd/pprof/internal/symbolz
cmd/yacc
archive/tar
cmd/pprof/internal/report
archive/zip
compress/lzw
compress/zlib
cmd/go
cmd/pprof/internal/fetch
database/sql/driver
cmd/pprof/internal/commands
database/sql
cmd/pprof/internal/driver
encoding/csv
encoding/gob
expvar
cmd/pprof
image/draw
image/gif
image/jpeg
image/png
index/suffixarray
net/http/cgi
net/http/cookiejar
net/http/fcgi
net/http/httptest
net/http/httputil
net/http/pprof
net/mail
net/rpc
net/smtp
os/user
runtime/debug
net/rpc/jsonrpc
testing
testing/iotest
testing/quick
text/scanner


---
Installed Go for windows/386 in /home/nick/go
Installed commands in /home/nick/go/path/bin
[goxc:xc] 2014/12/12 22:30:23 'go' returned error: exit status 1
[goxc:xc] 2014/12/12 22:30:23 Error: exit status 1
[goxc:xc] 2014/12/12 22:30:23 Have you run `goxc -t` for this platform (386,windows)???
[goxc:xc] 2014/12/12 22:30:23 Multiple errors (returning first one): [exit status 1]
[goxc:xc] 2014/12/12 22:30:23 Stopping after 'xc' failed with error 'exit status 1'
[goxc] 2014/12/12 22:30:23 RunTasks error: exit status 1

Providing necessary information

go env

GOARCH="amd64"
GOBIN="/home/nick/go/path/bin"
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/nick/go/path"
GORACE=""
GOROOT="/home/nick/go"
GOTOOLDIR="/home/nick/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

go version

go version go1.4 linux/amd64
@laher
Copy link
Owner

laher commented Dec 14, 2014

Hi there, thanks for the details.

I've been trying Go1.4 and it seems to work fine for me so far.

  • Are you using the Mercurial repo from code.google.com? This is still the recommended repo for installing-from-source. I have tried the github repo, it didn't build for me.
    • Can you try again without the -q option? It might help give more clues. If not, the -v option could also help.

So, if not, then the next step is to check that you can cross-compile the toolchain manually (without goxc):

export GOOS=windows
export GOARCH=386
cd "$GOROOT/src" # or just cd into /home/nick/go/src
./all.bash

I find it a bit weird that your GOPATH is inside your GOROOT, but each to their own, as long as it's not a mistake.

Let me know what you find. Ta

@ghost
Copy link
Author

ghost commented Dec 14, 2014

Hmm. I moved GOPATH to /home/nick/gopath. Hello World builds well, but my application doesn't. It uses go-gtk library. Here's the code:

package main

import (
    "github.com/mattn/go-gtk/gtk"
    "os"
)

func main() {
    gtk.Init(&os.Args)
    window := gtk.NewWindow(gtk.WINDOW_TOPLEVEL)
    window.SetTitle("Hello World")
    window.Connect("destroy", gtk.MainQuit)

    gtk.Main()
}

And the error I get:
http://paste.debian.net/hidden/fc0d6afb/

It seems like the problem is here. But this is a simple import and library code is already built with go get command. go build command shouldn't be called in this folder at all, or I'm mistaking?

main.go:4:2: no buildable Go source files in /home/nick/gopath/src/github.com/mattn/go-gtk/gtk

UPD: Oh, I've forgotten to tell you that I can build toolkit with all.bash successfully. However, I reinstalled go then and tried to run goxc on Hello World using clean go installation, and that worked.
UPD: Running GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -o appname.windows main.go in the project's folder gave me that error. Going deeper.
UPD: Running with CGO_ENABLED=1 returns the following:

nick@ubuntu:~/apps/test$ GOOS=windows GOARCH=386 CGO_ENABLED=1 go build -o appname.windows main.go
# runtime/cgo
gcc: error: unrecognized command line option ‘-mthreads’

So, can I compile packages which import C library for another platform at all?

@ghost
Copy link
Author

ghost commented Dec 15, 2014

Closing as not goxc related. However, it would be great to see your piece of advice.

@ghost ghost closed this as completed Dec 15, 2014
@laher
Copy link
Owner

laher commented Dec 16, 2014

Hey there, yes, unfortuntately goxc isn't much use for cross-compiling C/C++ dependencies. There's some other projects you might want to look at to help with that, but you'd need to cross-compile the GCC toolchain, which is a lot more work. You might want to look at a project called xgo, which is moving towards a better solution: https://github.com/karalabe/xgo

Oh and I think you're much better off keeping your GOPATH outside of GOROOT. There's no real benefit to mixing them up.

Cheers

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant