VirtualBox

Opened 14 years ago

Closed 13 years ago

#7085 closed defect (worksforme)

virtualbox-ose: --as-needed fix (patch included)

Reported by: Polynomial-C Owned by:
Component: other Version: VirtualBox 3.2.6
Keywords: Cc:
Guest type: other Host type: Linux

Description

Hi,

at Gentoo we encourage users to use LDFLAGS="-Wl,--as-needed" as much as possible to reduce the amount of packages that need recompilation when some shared libs have ABI change. For that reason we also provide the possibility to make the compiler use --as-needed during linking by default [1]. This failed for virtualbox-ose as can be seen in [2]. Kacper Kowalik was so kind to examine this problem and wrote a patch which I want to suggest for inclusion. Please see the attached patch.

[1] http://www.gentoo.org/proj/en/qa/asneeded.xml (see section "Forced --as-needed")

[2] https://bugs.gentoo.org/249295

Attachments (1)

virtualbox-ose-asneeded.patch (516 bytes ) - added by Polynomial-C 14 years ago.

Download all attachments as: .zip

Change History (5)

by Polynomial-C, 14 years ago

comment:1 by Frank Mehnert, 14 years ago

Well, applying this patch would probably not hurt. But linking xpidl with --as-needed does not make much sense because this binary is not included in the final package (xpidl is only required during compilation of VirtualBox) and all relevant binaries are already linked with --as-needed.

comment:2 by Polynomial-C, 14 years ago

Of course it doesn't make much sense if it's only used internally but when you have a compiler that has --as-needed in his spec file it links everything with --as-needed unless --no-as-needed is supplied via the build system.
As we at Gentoo use --as-needed enabled compilers (see first link from my initial post, section "Forced --as-needed") to test software that has broken build systems you would do us a big favour in applying this patch.

comment:3 by Frank Mehnert, 14 years ago

I added the -Wl,--as-needed switch manually to the linker flags of xpidl (see r31534). This works fine here and sorry, but I still don't see the reason of applying the patch. The output of libIDL-config-2 --libs and pkg-config --libs-only-L libIDL-2.0 ; pkg-config --libs-only-l libIDL-2.0 is the exactly the same here. Same for libIDL-config-2 --cflags and pkg-config --cflags libIDL-2.0.

comment:4 by Frank Mehnert, 13 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use