Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147876 - xen fails to compile with gcc 4.1 and USE=hardened
Summary: xen fails to compile with gcc 4.1 and USE=hardened
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Andrew Ross (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-16 19:44 UTC by Richard Benjamin Voigt
Modified: 2006-10-13 17:06 UTC (History)
1 user (show)

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


Attachments
emerge --info (xen-emerge-info,5.78 KB, application/octet-stream)
2006-09-16 19:45 UTC, Richard Benjamin Voigt
Details
patch for app-emulation/xen (xen-test-gcc-flag-stack-protector.patch,637 bytes, patch)
2006-09-16 19:47 UTC, Richard Benjamin Voigt
Details | Diff
patch for app-emulation/xen-tools (xen-tools-test-gcc-flags.patch,1.34 KB, patch)
2006-09-16 19:48 UTC, Richard Benjamin Voigt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Benjamin Voigt 2006-09-16 19:44:56 UTC
new gcc croaks on some flags that the xen and xen-tools ebuilds pass in.  There's language in some of the subdirs to use test-gcc-flag, these patches add it to all of them
Comment 1 Richard Benjamin Voigt 2006-09-16 19:45:44 UTC
Created attachment 97194 [details]
emerge --info

emerge --info
Comment 2 Richard Benjamin Voigt 2006-09-16 19:47:02 UTC
Created attachment 97195 [details, diff]
patch for app-emulation/xen

makes xen/Rules.mk use test-gcc-flag to avoid invalid -fno-stack-protector and -fno-stack-protector-all on new gcc
Comment 3 Richard Benjamin Voigt 2006-09-16 19:48:20 UTC
Created attachment 97196 [details, diff]
patch for app-emulation/xen-tools

use test-gcc-flag, and changes -nopie which my compiler rejects to -fno-pie which it likes (but also filtered through test-gcc-flag)
Comment 4 Andrew Ross (RETIRED) gentoo-dev 2006-10-05 03:13:12 UTC
The CFLAGs you've indicated are only included if you're using the hardened USE flag, which is intended for use only with the hardened profile. GCC 4.1 isn't compatible with Hardened Gentoo, so this bug is invalid.
Comment 5 Richard Benjamin Voigt 2006-10-06 22:14:30 UTC
Other packages, like gcc, force disable the hardened USE flag when appropriate.  Should xen then also ignore the hardened USE flag when not using a hardened profile?

On the other hand, what's the harm in changing the makefiles to use test-gcc-flag?  Should have no effect when the option is needed, but automatically remove it for non-hardened gcc (which has doesn't recognize the options).
Comment 6 Andrew Ross (RETIRED) gentoo-dev 2006-10-06 23:03:15 UTC
(In reply to comment #5)
> Other packages, like gcc, force disable the hardened USE flag when appropriate.
>  Should xen then also ignore the hardened USE flag when not using a hardened
> profile?

How strange - it was my understanding that the hardened USE flag was masked on non-hardened profiles, but this doesn't seem to be the case.

> On the other hand, what's the harm in changing the makefiles to use
> test-gcc-flag?  Should have no effect when the option is needed, but
> automatically remove it for non-hardened gcc (which has doesn't recognize the
> options).

test-gcc-flag is broken by design and fails when used with "no*" flags, so your proposed patches break xen on hardened. It looks like this is why the hardened USE flag was originally added to the ebuild.

I actually like the solution in http://overlays.gentoo.org/dev/aross/changeset/16 , so unless anyone objects I'll go with that.


Comment 7 Richard Benjamin Voigt 2006-10-10 18:43:50 UTC
Looks like a really clean fix.  ++
Comment 8 Andrew Ross (RETIRED) gentoo-dev 2006-10-13 17:06:41 UTC
Fixed in app-emulation/xen-tools-3.0.2-r4, thanks.