Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 44905

Summary: grub: filtering -fstack-protector doesn't help size issues, but filtering -pie does
Product: Gentoo Linux Reporter: Christian Rubbert <ceed>
Component: HardenedAssignee: Hardened Gentoo <hardened>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: 2004.0   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch against grub-0.94-r1-ebuild to remove filter-flags -fstack-protector and add filter-ldflags -pie

Description Christian Rubbert 2004-03-16 17:10:52 UTC
When compiling grub-0.94 with

CFLAGS="-march=athlon-mp -O2 -pipe -fPIC -fstack-protector"
LDFLAGS="${LDFLAGS} -pie"

the grub stages become rather big:

cdimage root # du -sh /usr/lib/grub       
2.3G    /usr/lib/grub

Filtering -fstack-protector as in grub-0.94-r1.ebuild didn't help bring the size down, but removing -pie from LDFLAGS while leaving CFLAGS alone did the trick:

cdimage grub # du -sh /usr/lib/grub
992K    /usr/lib/grub

See attached patch.
Comment 1 Christian Rubbert 2004-03-16 17:11:53 UTC
Created attachment 27503 [details, diff]
Patch against grub-0.94-r1-ebuild to remove filter-flags -fstack-protector and add filter-ldflags -pie
Comment 2 solar (RETIRED) gentoo-dev 2004-03-17 11:25:11 UTC
wtf is grub doing creating 2.3G of data that's just insane.

filter-ldflags -pie added to grub ~arch

I'm not so sure about the removal of the filter-flags of 
-fstack-protector The ebuild unsets CFLAGS by default which would make
it now show up for you but if a user were using say hgcc then we might
run into addressing problems and missing symbols.  This should all be
documented in our bugzilla system some place.

I'm going to go ahead and change the resolution to FIXED here.
Reopen if you think otherwise.