dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
242 stars 80 forks source link

Build failure when compiling for Homebrew on Linux #884

Closed p-linnane closed 1 year ago

p-linnane commented 1 year ago

Hello 👋 . I'm a maintainer for the Homebrew project. While trying to package v0.13.0 we are running into a build error on Linux. The relevant GitHub Actions run can be found here.

The error in question:

/usr/bin/ld: obj/dmd/containers/src/containers/ttree.o: relocation R_X86_64_32 against hidden symbol `__stop_minfo' can not be used when making a PIE object
/usr/bin/ld: failed to set dynamic section sizes: bad value

Any guidance here would be appreciated. Thank you!

rikkimax commented 1 year ago

Shouldn't this be PIC?

On Sat, Jan 7, 2023, 11:40 Patrick Linnane @.***> wrote:

Hello 👋 . I'm a maintainer for the Homebrew https://brew.sh project. While trying to package v0.13.0 we are running into a build error on Linux. The relevant GitHub Actions run can be found here https://github.com/Homebrew/homebrew-core/actions/runs/3852640661/jobs/6564985752 .

The error in question:

/usr/bin/ld: obj/dmd/containers/src/containers/ttree.o: relocation R_X86_64_32 against hidden symbol `__stop_minfo' can not be used when making a PIE object

/usr/bin/ld: failed to set dynamic section sizes: bad value

Any guidance here would be appreciated. Thank you!

— Reply to this email directly, view it on GitHub https://github.com/dlang-community/D-Scanner/issues/884, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHSL43NVYLFWAASFRCNU3TWRCNPRANCNFSM6AAAAAATTQ3TK4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

p-linnane commented 1 year ago

Thank you. I was able to get it to build with ENV.append "DFLAGS", "-fPIC" if OS.linux?.

rikkimax commented 1 year ago

This isn't the first report of this release having issues with PIC not being set. I should probably look into what happened.

On Sat, Jan 7, 2023, 12:06 Patrick Linnane @.***> wrote:

Thank you. I was able to get it to build with ENV.append "DFLAGS", "-fPIC" if OS.linux?.

— Reply to this email directly, view it on GitHub https://github.com/dlang-community/D-Scanner/issues/884#issuecomment-1374239284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHSL4Y7Z73ALCYHGYR26PDWRCQP3ANCNFSM6AAAAAATTQ3TK4 . You are receiving this because you commented.Message ID: @.***>

rikkimax commented 1 year ago

Ah huh! You weren't using dub, that explains it. Dub is setup to handle this.