Git Product home page Git Product logo

Comments (6)

EmpireJones avatar EmpireJones commented on July 30, 2024 7

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.

brian-armstrong-discord avatar brian-armstrong-discord commented on July 30, 2024

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.

dougnd avatar dougnd commented on July 30, 2024

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.

brian-armstrong-discord avatar brian-armstrong-discord commented on July 30, 2024

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.

paulm17 avatar paulm17 commented on July 30, 2024

@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.

brian-armstrong-discord avatar brian-armstrong-discord commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.