Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494478 - x11-drivers/xf86-video-virtualbox: lazy linking fails on hardened (-z,now) systems
Summary: x11-drivers/xf86-video-virtualbox: lazy linking fails on hardened (-z,now) sy...
Status: RESOLVED DUPLICATE of bug 546362
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-12-16 22:19 UTC by Christopher Jones
Modified: 2015-10-22 02:14 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_494478.txt,5.42 KB, text/plain)
2013-12-16 22:22 UTC, Christopher Jones
Details
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-4.3.4/temp/xf86-video-virtualbox-link-lazy.patch.out (file_494478.txt,3.94 KB, patch)
2013-12-16 22:28 UTC, Christopher Jones
Details | Diff
xf86-video-virtualbox-4.3.4.ebuild (file_494478.txt,5.19 KB, text/plain)
2013-12-16 22:31 UTC, Christopher Jones
Details
Refreshed link lazy patch (xf86-video-virtualbox-4.3.6-link-lazy.patch,1.14 KB, patch)
2014-01-11 16:28 UTC, Aaron W. Swenson
Details | Diff
4.3.6 Ebuild Patch to use refreshed lazy link patch (xf86-video-virtualbox-4.3.6.ebuild.patch,410 bytes, patch)
2014-01-11 16:29 UTC, Aaron W. Swenson
Details | Diff
Updated patch to add lazy linking (xf86-video-virtualbox-4.3.10-link-lazy.patch,1.85 KB, patch)
2014-04-06 14:52 UTC, Fredric Johansson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Jones 2013-12-16 22:19:33 UTC
Cant compile this package on my non-hardened system. It applies all the patches but when it gets to link-lazy.patch during prepare phase, the emerge fails with an error. I then navigated to the patch.out and saw the patch cant find a file and that the patch is to be applied to config.kmk to add some paramters to one line so that it can fix a bug #394757 intended for hardened-gcc compiles. I fixed this bug by commenting out the code in the xf86-video-virtualbox-4.3.4-ebuild file that applies the link-lazy.patch. the coding uses the 'if gcc-specs-now' I guess as a way to check if the compiler is the gcc-hardened one, and then to apply that patch. I assume that check doesn't work since it thought my gcc was hardened and went on to apply the patch. there should be should be a check to see if its hardened else its not-hardened and to skip that patch. 

Reproducible: Always

Steps to Reproduce:
1.tried to emerge package
2.package gets to prepare phase and starts applying patches
3.emerge failed because it tried apply link-lazy.patch, a hardened-gcc patch with a non-hardened gcc.
Actual Results:  
got the message "Failed Patch: xf86-video-virtualbox-link-lazy.patch ! ( /usr/portage/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox/files/xf86-video-virtualbox-link-lazy.patch ) 

Expected Results:  
not applied that patch that was added to fix a bug for hardened-gcc and emerged the packaged successfully
Comment 1 Christopher Jones 2013-12-16 22:22:33 UTC
Created attachment 365482 [details]
emerge --info
Comment 2 Christopher Jones 2013-12-16 22:28:24 UTC
Created attachment 365484 [details, diff]
/var/tmp/portage/x11-drivers/xf86-video-virtualbox-4.3.4/temp/xf86-video-virtualbox-link-lazy.patch.out
Comment 3 Christopher Jones 2013-12-16 22:31:57 UTC
Created attachment 365486 [details]
xf86-video-virtualbox-4.3.4.ebuild

lines 89, 90, and 91 are the code that check to see if the gcc is a hardened one and then applies the patch. Comment out these lines if you have a non-hardened gcc to successfully compile this package.
Comment 4 Christopher Jones 2013-12-17 00:56:38 UTC
please ignore, I just noticed my gcc is hardened. somehow my kernels got mixed up. I have both a non-hardened and hardened kernel selection at grub. its booting a non-hardened karnel with hardened toolchain
Comment 5 Aaron W. Swenson gentoo-dev 2014-01-11 16:28:12 UTC
Created attachment 367638 [details, diff]
Refreshed link lazy patch

This refreshed patch allows epatch to do its job.
Comment 6 Aaron W. Swenson gentoo-dev 2014-01-11 16:29:04 UTC
Created attachment 367640 [details, diff]
4.3.6 Ebuild Patch to use refreshed lazy link patch
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-01-11 21:26:54 UTC
+*xf86-video-virtualbox-4.2.22 (11 Jan 2014)
+
+  11 Jan 2014; Lars Wendler <polynomial-c@gentoo.org>
+  +xf86-video-virtualbox-4.2.22.ebuild, xf86-video-virtualbox-4.3.6.ebuild,
+  +files/xf86-video-virtualbox-4.3.6-link-lazy.patch:
+  Version bump. Fixed link lazy patch (bug #494478).
+
Please test and report back your results.
Comment 8 Aaron W. Swenson gentoo-dev 2014-01-12 03:29:55 UTC
(In reply to Lars Wendler (Polynomial-C) from comment #7)
> +*xf86-video-virtualbox-4.2.22 (11 Jan 2014)
> +
> +  11 Jan 2014; Lars Wendler <polynomial-c@gentoo.org>
> +  +xf86-video-virtualbox-4.2.22.ebuild, xf86-video-virtualbox-4.3.6.ebuild,
> +  +files/xf86-video-virtualbox-4.3.6-link-lazy.patch:
> +  Version bump. Fixed link lazy patch (bug #494478).
> +
> Please test and report back your results.

Well, it fixes the compilation for me, but now I have this issue:

Failed to load /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so: /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so: undefined symbol: vgaHWFree HWRec

And I'm a bit stuck now.
Comment 9 Fredric Johansson 2014-04-06 14:52:19 UTC
Created attachment 374382 [details, diff]
Updated patch to add lazy linking

A little bruteforce addition of -Wl,-z,lazy to LDFLAGS definitions created this patch.
The 2nd part is same as previous patch. All three parts are certainly not necessary but I wasn't really sure what was the appropriate place to add it and it doesn't complain
Comment 10 tni 2014-09-24 13:57:42 UTC
Still broken with Virtualbox 4.3.16 / hardened GCC (as per comment 8, missing symbol in vboxvideo_drv.so).

The patch from Fredric Johansson works.
Comment 11 Rick Farina (Zero_Chaos) gentoo-dev 2015-10-22 02:14:19 UTC

*** This bug has been marked as a duplicate of bug 546362 ***