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

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.

Change History

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.

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.

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.