andlabs / ui

Platform-native GUI library for Go.
Other
8.34k stars 648 forks source link

Linux: go get fails with gcc error #185

Closed joeblew99 closed 8 years ago

joeblew99 commented 8 years ago

i have gotten it all working on OSX and windows. Now trying out on Linux.

Its a clean ubuntu inside a vm.

Here we go::

# get gcc 
sudo apt-get install gcc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gcc is already the newest version (4:5.3.1-1ubuntu1).
gcc set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.

# check its there !!
gedw99@gedw99-Veertu:~/Downloads$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2) 

# on go 1.7 in ubuntu 16.04.02
gedw99@gedw99-Veertu:~/Downloads$ go env
GOARCH="amd64"
GOBIN="/home/gedw99/workspace/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/gedw99/workspace/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build544849099=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

# Lets try a go get
gedw99@gedw99-Veertu:~/Downloads$ go get github.com/andlabs/ui
# runtime
/usr/local/go/src/runtime/lfstack_amd64.go:16: lfstackPack redeclared in this block
    previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:37
/usr/local/go/src/runtime/lfstack_amd64.go:20: lfstackUnpack redeclared in this block
    previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:41
/usr/local/go/src/runtime/os_linux.go:27: _FUTEX_WAIT redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:22
/usr/local/go/src/runtime/os_linux.go:28: _FUTEX_WAKE redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:23
/usr/local/go/src/runtime/os_linux.go:36: futexsleep redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:31
/usr/local/go/src/runtime/os_linux.go:67: futexwakeup redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:62
/usr/local/go/src/runtime/os_linux.go:83: getproccount redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:78
/usr/local/go/src/runtime/os_linux.go:109: _CLONE_VM redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:104
/usr/local/go/src/runtime/os_linux.go:110: _CLONE_FS redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:105
/usr/local/go/src/runtime/os_linux.go:111: _CLONE_FILES redeclared in this block
    previous declaration at /usr/local/go/src/runtime/os1_linux.go:106
/usr/local/go/src/runtime/os_linux.go:111: too many errors
andlabs commented 8 years ago

It is trying to rebuild package runtime. Did you make any changes to the Go source?

joeblew99 commented 8 years ago

@andlabs

I did not make any changes to the Go source of github.com/andlabs/ui. I have a clean machine with gcc installed and just did a go get on github.com/andlabs/ui

i tried it again this morning, and got the same thing.

Not sure whats going on...

Maybe its because my gcc is too old ?

joeblew99 commented 8 years ago

I would love to be able to help you.

To help you I would need to learn how to take the code in the libui report and compile it into statics for this report I am guessing.

If you feel like it do have time to help on this.

itcreator commented 8 years ago

I've reproduced it on linux mint

go version go1.7.3 linux/amd64
Linux some-pc 4.4.0-040400-lowlatency #201601101930 SMP PREEMPT Mon Jan 11 00:38:46 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
go get -u -v github.com/nsf/gocode
github.com/nsf/gocode (download)
runtime
# runtime
/usr/local/go/src/runtime/lfstack_amd64.go:16: lfstackPack redeclared in this block
        previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:37
/usr/local/go/src/runtime/lfstack_amd64.go:20: lfstackUnpack redeclared in this block
        previous declaration at /usr/local/go/src/runtime/lfstack_64bit.go:41
/usr/local/go/src/runtime/os_linux.go:27: _FUTEX_WAIT redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:22
/usr/local/go/src/runtime/os_linux.go:28: _FUTEX_WAKE redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:23
/usr/local/go/src/runtime/os_linux.go:36: futexsleep redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:31
/usr/local/go/src/runtime/os_linux.go:67: futexwakeup redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:62
/usr/local/go/src/runtime/os_linux.go:83: getproccount redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:78
/usr/local/go/src/runtime/os_linux.go:109: _CLONE_VM redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:104
/usr/local/go/src/runtime/os_linux.go:110: _CLONE_FS redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:105
/usr/local/go/src/runtime/os_linux.go:111: _CLONE_FILES redeclared in this block
        previous declaration at /usr/local/go/src/runtime/os1_linux.go:106
/usr/local/go/src/runtime/os_linux.go:111: too many errors
itcreator commented 8 years ago

this topic solved this issue for me http://stackoverflow.com/questions/39064285/go-project-build-failed-lfstackpack-redeclared-in-this-block

itcreator commented 8 years ago

@joeblew99

joeblew99 commented 8 years ago

@itcreator thanks for the tip. works !!