Closed DeadNumbers closed 6 years ago
I thought I fixed this argh; will go back and fix it for real later
@andlabs is there a work-around? The README's build instructions now just refer to go get
.
I just tried to use go get on Mac OSX and it failed like so:
go version go version go1.9.4 darwin/amd64 go get -v -u github.com/andlabs/ui github.com/andlabs/ui (download) github.com/andlabs/ui go build github.com/andlabs/ui: invalid flag in #cgo LDFLAGS: /Users/modejong/Development/GoPackages/src/github.com/andlabs/ui/libui_darwin_amd64.a
@serussell it's a problem with libui's build process in which I need to figure out why -fPIC
isn't being applied... because I thought I did apply it explicitly
@mdejong upgrade to Go 1.10 or wait for 1.9.5
@andlabs Understood. Can you paste the build command (and arguments) in the meantime so we can build the project?
I found that setting the following ENV var also worked around the build problem on MacOSX:
export CGO_LDFLAGS_ALLOW=".*"
@serussell I just do cmake -DBUILD_SHARED_LIBS=OFF
and then make
.
getting an error on OSX High Sierra 10.3.3 using Go 1.10
go get -v -u github.com/andlabs/ui github.com/andlabs/ui (download) github.com/andlabs/ui go build github.com/andlabs/ui: invalid flag in #cgo LDFLAGS: -mmacosx-version-min=10.8
ive bypassed the error by using the export CGO_LDFLAGS_ALLOW=".*"
but I then get a warning which I'm not sure if I should be worried about.
go get -v -u github.com/andlabs/ui github.com/andlabs/ui (download) github.com/andlabs/ui ld: warning: object file (/Users/neural/golang/src/github.com/andlabs/ui/libui_darwin_amd64.a(libui-combined.o)) was built for newer OSX version (10.12) than being linked (10.8)
Again, the "invalid cgo flag" stuff is a Go 1.10 thing, because of a recent security vulnerability. CGO_LDFLAGS_ALLOW=".*"
defeats that whole problem, so you should probably alter this regex to be fine-tuned toward the specific cases until the 1.10.1 patch comes out that will handle the things that weren't patched in.
@mdejong @SirNeural where did each of you get the .*
workaround from?
The "was built for newer version" stuff is another libui build bug I thought I fixed already.
@andlabs I just saw the reply from @mdejong and tried it, seemed to help get the go get
command working
Anything I can do to help give more information on this issue?
Using ArchLinux here and the CGO_LDFLAGS_ALLOW=".*"
does not work to get this installed (get the same error as OP)
tried to use all of the new CGO ALLOW vars with no success (CGO_CFLAGS_ALLOW=".*" CGO_CXXFLAGS_ALLOW=".*" CGO_LDFLAGS_ALLOW=".*"
)
Go 1.10.1 is expected march 1st, hopefully it helps.
Right, the issue the OP has has nothing to do with the cgo options whitelist.
(sorry I missed relaying some info in the wee hours last night): I tried also setting CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go get github.com/andlabs/ui
which changed the OP error into a cgo issue (got the idea to set the flags from an old issue#)
Edit: well after looking at all this again I did it right finally; pulled down libui, cmake + make and copied the out/libui.a over ui's libui_linux_amd64.a
allowing a go build && go install
Maybe the release section of libui can have the .o and .a files as well and ui can just reference them?
@andlabs, I tried to compile libui by myself, replacing libui_linux_amd64.a
by out/libui.a
and then go install ui. As @vanillaSprinkles did. But it fails with these errors:
/tmp/go-build458073604/b001/_x010.o: In function `newFont':
./draw.go:88: undefined reference to `uiDrawLoadClosestFont'
/tmp/go-build458073604/b001/_x010.o: In function `_cgo_2fc1135dc6ba_Cfunc_uiDrawFontFamiliesFamily':
/tmp/go-build/cgo-gcc-prolog:327: undefined reference to `uiDrawFontFamiliesFamily'
/tmp/go-build458073604/b001/_x010.o: In function `_cgo_2fc1135dc6ba_Cfunc_uiDrawFontFamiliesNumFamilies':
/tmp/go-build/cgo-gcc-prolog:344: undefined reference to `uiDrawFontFamiliesNumFamilies'
/tmp/go-build458073604/b001/_x010.o: In function `_cgo_2fc1135dc6ba_Cfunc_uiDrawListFontFamilies':
/tmp/go-build/cgo-gcc-prolog:408: undefined reference to `uiDrawListFontFamilies'
... and few others such lines
Is it possible, that current libui is not compatible with current ui? Which version is then?
Yep, groan. Will need to update all the APIs :|
Would you appreciate some helping hand? :) Is it only about renaming or are these complicated API changes?
Er wait I reread, you are building libui from source, so I assume you are building it from master. master has breaking API changes. You'll need to build from one of the stable tarball releases. Sorry!
You are right, thanks. Now I have a different problem - my program panics at the start, but it might not be a problem with (lib)ui.
I'm getting this same error on debian 9, go 1.10. Is it best to build from source? Will try that now.
Duplicate of:
go version go1.10 linux/amd64 libui 0.3.5.alpha-1 gcc 7.3.0