-
Notifications
You must be signed in to change notification settings - Fork 647
libui_linux_amd64.a(libui-combined.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC #230
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
Comments
What version of Go? |
go 1.8 |
My environment (Ubuntu 16.10 64bit) has the same problem. My environment 🖥️
What problem 😦
How to solve it 🙂# build `libui`
git clone [email protected]:andlabs/libui.git
cd libui/
mkdir build
cd build/
cmake -DBUILD_SHARED_LIBS=OFF ..
make
# copy to `ui` src dir
cp out/libui.a ${GOPATH}/src/github.com/andlabs/ui/libui_linux_amd64.a
# build `ui`
cd ${GOPATH}/src/github.com/andlabs/ui/
go build Successful build. The tutorial code also worked. |
So what is the difference between my |
It is not certain but "Relocation Types" seems to be different. (I do not know what this means) in git repository binaryThere are many
The same error occurs even with a simple build of gcc.
in my buildThere is no
|
And what happens if you run
instead? |
In my own build, it matches a lot.
|
same problem with @arisbasic worked around with @mjyuta 's solution |
Same with debian unstable, Go 1.8.3. About to try the solution to build libui on my own. |
And yes, following the above solution worked. |
Same problem with go 1.8.3 on Arch Linux. |
Also having this issue here on Arch and on a quite vanilla Manjaro with go version 1.9.3. |
Okay, so I will need to fix libui to use PIC everywhere, though I thought I was already doing that?... |
I'm on debian 9, go 1.10. I've tried the wonderfully detailed workaround from @mjyuta but this is how it ends up: sue@xray:~/dev/src/github.com/andlabs/ui$ go build |
You will need to use the alpha 3.1 or 3.5 source archives, not master. |
Okay, so I think andlabs/libui#308 has something to do with it. My HYPOTHESIS is that I have another HYPOTHESIS that this is the same issue that prevented me from being able to build a linux/386 version of Alpha 3.5 (which is part of the reason why I didn't migrate the APIs over yet). If anyone decides to confirm either of these hypotheses in the meantime, then great. Otherwise, we'll see what happens. |
Same here on arch linux with latest Go. |
Same with Ubuntu 18.04: |
Barring the specific PRs I'm waiting for updates on being completed, I'll try getting rid of libui-combined.o from GTK+ tonight (already did it on OS X). It won't completely fix the libui issue I linked above (there are some runtime-object-system namespace issues I have to work out first), but it will get us 90% of the way there. Whether that will fix this issue, though, will have to wait a bit longer, because the APIs have changed considerably enough since the last "stable" release that backporting will be totally nontrivial. Alpha 4 may come sooner than I originally planned (I've already forgotten the complete list of what I wanted out of it). |
Hi. Thanks to @mjyut for sharing the workaround but I did: build
|
You never set your |
@andlabs sorry noob like me. I reattached correct screenshot. |
No need to use |
@andlabs thank you. andlabs directory and ui directory were missing - I created them and cp works. Thanks! |
It seems like you did a |
Again, you didn't set your |
@andlabs I did next:
I got: But error still present Now I got "No package found" instead of "Nonrepresentable section on output |
For debian the package is called |
Hi, Please, Help! |
That's because package ui hasn't been updated to use the latest libui APIs yet. It won't until the next tagged release is made. Until then, you'll have to go back and build the alpha3.5 tag of libui or whatever the latest tag was (I forget now). |
@andlabs thank you for answer. |
The same way you did above, except before running |
@andlabs I did all steps and even GO BUILD works but can't figure out how to run go example described on wiki :( |
Now that |
@andlabs thank you. |
@andlabs is it possible to run this library with golang.org/x/mobile/app package which allows go to build android apk? |
No, there is no support in libui for Android, and I'm not sure if doing that would be the right thing to do, or if a separate API for mobile apps would be better. |
@andlabs thank you for your answer. |
This is still a problem on Arch linux amd64 and go 1.10.3 - trying to work around it by recompiling libui as suggested.
|
@andydotxyz you are still building an old version of package ui; use Everyone else: does this still happen? |
Using the |
go get -u github.com/andlabs/ui
github.com/andlabs/ui
/usr/bin/ld: ../../go/src/github.com/andlabs/ui/libui_linux_amd64.a(libui-combined.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
The text was updated successfully, but these errors were encountered: