Comments (6)
In case this is helpful for others, I was able to work around this without branching, by calling export CGO_LDFLAGS='-no-pie'
before calling go get github.com/discordapp/lilliput
and go build
.
from lilliput.
Sorry to hear you got bit by this. The -no-pie
option might be interesting. We had to turn off the fPIC mode because it caused a tremendous performance regression, but maybe the -no-pie mode wouldn't. It's worth looking into for sure.
from lilliput.
Yeah I don't know the best solution. I can setup a PR from https://github.com/dougnd/lilliput/tree/feature/no-pie if you like. It does work:
3:13 $ docker run -it golang:1.11 /bin/bash
root@2082aeec8cbc:/go# go get github.com/discordapp/lilliput
# github.com/discordapp/lilliput
/usr/bin/ld: src/github.com/discordapp/lilliput/deps/linux/lib/libswscale.a(swscale.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: src/github.com/discordapp/lilliput/deps/linux/lib/libswscale.a(utils.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: src/github.com/discordapp/lilliput/deps/linux/lib/libswscale.a(vscale.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: src/github.com/discordapp/lilliput/deps/linux/lib/libswscale.a(hscale_fast_bilinear_simd.o): relocation R_X86_64_32S against `.text.unlikely' can not be used when making a shared object; recompile with -fPIC
[...and a lot more errors...]
root@2082aeec8cbc:/go# cd src/github.com/discordapp/lilliput/
root@2082aeec8cbc:/go/src/github.com/discordapp/lilliput# git remote add dougnd https://github.com/dougnd/lilliput
root@2082aeec8cbc:/go/src/github.com/discordapp/lilliput# git fetch dougnd
root@2082aeec8cbc:/go/src/github.com/discordapp/lilliput# git checkout feature/no-pie
root@2082aeec8cbc:/go/src/github.com/discordapp/lilliput# go build
go build github.com/discordapp/lilliput: invalid flag in #cgo LDFLAGS: -no-pie
root@2082aeec8cbc:/go/src/github.com/discordapp/lilliput# export CGO_LDFLAGS_ALLOW='-no-pie'
root@2082aeec8cbc:/go/src/github.com/discordapp/lilliput# go build
[...Success!...]
Notice that you'd need to set CGO_LDFLAGS_ALLOW
to allow the -no-pie
. So your library would no longer be go-gettable (without setting that env). Although it looks like they are soliciting more flags to be whitelisted, so I could make a request they whitelist -no-pie
in future versions of Go.
I'd still be interested in how Discord builds this -- what OS, what version of GCC, etc. Clearly you guys don't run into this problem, so if there are preferred platforms, it might be nice to know.
Thanks!
from lilliput.
I appreciate the offer to help with the branch. I think in the short term, we're going to set up a branch that works in newer versions of Ubuntu so that you can fetch that sha instead. That will generally work cleaner, and in the long term, the repo will stop working on old versions of Ubuntu.
from lilliput.
@dougnd Thank you for supplying a fork.
I wasn't originally hit by this bug as I was running Centos. But now due to some issues I'm now running the latest debian. So I'm another one affected by this issue.
from lilliput.
This is finally done. Please note that building with some flags can cause large performance impacts. Instead we now provide the binaries that will work on modern distributions.
from lilliput.
Related Issues (20)
- APNG support HOT 4
- WebP animated support HOT 7
- Unreachable code in thumbhash_encoder_create function
- Segfaults when `go-fitz` is imported
- ld: library not found for -lsharpyuv HOT 2
- A path to supporting ARM HOT 2
- Discord breaks webp image on upload HOT 4
- The effect of Discord increasingly relying on rust on this project HOT 2
- Couldnt build lilliput HOT 2
- Can not build the lib HOT 4
- PNG compression algorithm causing desaturation HOT 1
- Please add sample for Audio support
- Some .gifs are incorrectly "smearing"
- go get error HOT 3
- Not possible to cross compile
- Compile warning on Ubuntu 20.04.2 LTS HOT 4
- PNG compression - larger then before HOT 2
- ARM support (Apple M1) HOT 4
- Apple M1 issues HOT 2
- Versions not picked up by pkg.go.dev
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lilliput.