Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#9276 closed patch

Support for linking with "as-needed"

Reported by: SF/jmmdebian Owned by: fingolfin
Priority: normal Component: Port: Linux
Version: Keywords:
Cc: Game:

Description

Dear ScummVm devs, scuvmm currently can't be built when using the linker feature "--as-needed". Please see http://www.gentoo.org/proj/en/qa/asneeded.xml for a description.

I'm attaching a patch written by Matthias Klose tp fix this. It was reported in the Debian BTS under http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607182

Please consider merging it for 1.2.2 or 1.3.0.

Cheers, Moritz

Ticket imported from: #3149416. Ticket imported from: patches/1381.

Attachments (1)

scummvm-as-needed.diff (451 bytes ) - added by SF/jmmdebian 14 years ago.

Download all attachments as: .zip

Change History (8)

by SF/jmmdebian, 14 years ago

Attachment: scummvm-as-needed.diff added

comment:1 by bluegr, 14 years ago

Moving to patches

comment:2 by fingolfin, 14 years ago

Hi Moritz, thanks for your patch. And of course we are interested in making things go smoothly for Debian, Ubuntu and other distros.

However, I am slightly confused -- the attached patch only modifies the unit test build system. So when you say "ScummVM can't be built", does that just mean that "make test" fails, or do you see build errors for the ScummVM binary itself? If so, then maybe some other patch is missing?

Moreover, I don't understand what the patch does, and can't find any explanation on e.g. the Debian BTS about the rational behind it. Could you explain? So it moves the LDFLAGS to the very end of the linker command. But why? What is, in fact, the actual error message this patch addresses? The gentoo page you referenced lists all kinds of possible issues, but I really don't like guessing, and also prefer understanding a patch before applying it :).

comment:3 by fingolfin, 14 years ago

(BTW, my *guess* is that linking order is the crucial aspect here, but I'd like to have this confirmed :)

comment:4 by SF/jmmdebian, 14 years ago

> However, I am slightly confused -- the attached patch only modifies the > unit test build system. So when you say "ScummVM can't be built", does that > just mean that "make test" fails, or do you see build errors for the > ScummVM binary itself? If so, then maybe some other patch is missing?

True, this only affects the test/runner build. However, since it's being build as part of the Debian package, it makes the entire Debian package fail to build. (Note that this doesn't currently affect the Debian toolchain, since Debian is in freeze for the next release. Ubuntu has already made the change, though)

Here's the build logs for ScummVM 1.2.1 with the change applied and w/o: w/o: http://launchpadlibrarian.net/60606441/buildlog_ubuntu-natty-i386.scummvm_1.2.1-1_FAILEDTOBUILD.txt.gz w/: http://launchpadlibrarian.net/60999854/buildlog_ubuntu-natty-i386.scummvm_1.2.1-2ubuntu1_BUILDING.txt.gz

> Moreover, I don't understand what the patch does, and can't find any > explanation on e.g. the Debian BTS about the rational behind it. Could you > explain? So it moves the LDFLAGS to the very end of the linker command. But > why? What is, in fact, the actual error message this patch addresses?

For the specific error see above. It affects the linking of indirectly referenced libs. The background is summarised in the Debian wiki: http://wiki.debian.org/ToolChain/DSOLinking Fedora also collected some info: https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

Cheers, Moritz

comment:5 by fingolfin, 14 years ago

Owner: set to fingolfin
Status: newclosed

comment:6 by fingolfin, 14 years ago

Patch added in SVN rev 55588, will go into 1.3.0

comment:7 by digitall, 6 years ago

Component: Port: Linux
Note: See TracTickets for help on using tickets.