Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46892 - sys-devel/patch-2.5.9 doesnt work with LDFLAGS="-pie" on amd64
Summary: sys-devel/patch-2.5.9 doesnt work with LDFLAGS="-pie" on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-05 12:54 UTC by Danny van Dyk (RETIRED)
Modified: 2004-05-08 07:24 UTC (History)
2 users (show)

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


Attachments
Patch to allow sys-devel/patch-2.5.9 to compile on amd64 with LDFLAGS="-pie" (patch-2.5.9-hardened-amd64.diff,827 bytes, patch)
2004-04-05 12:57 UTC, Danny van Dyk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Danny van Dyk (RETIRED) gentoo-dev 2004-04-05 12:54:05 UTC
When LDFLAGS contains "-pie" on amd64, the patch ./configure does strange things.
However, hiding "-pie" from ./configure and manually patching it into the Makefile solves
the issue for me. I'll attach a patch for the ebuild.
Comment 1 Danny van Dyk (RETIRED) gentoo-dev 2004-04-05 12:57:19 UTC
Created attachment 28752 [details, diff]
Patch to allow sys-devel/patch-2.5.9 to compile on amd64 with LDFLAGS="-pie"
Comment 2 solar (RETIRED) gentoo-dev 2004-05-07 09:35:47 UTC
Patch looks good.. You should commit it.
Maybe change 

+		sed -e 's/LDFLAGS\ =\ /LDFLAGS\ =\ -pie/' Makefile > Makefile.new
+		mv Makefile.new Makefile

To
sed -i -e 's/LDFLAGS\ =\ /LDFLAGS\ =\ -pie/' Makefile
The -i flag allows us to now have to swap out files with mv statements.

-i[suffix], --in-place[=suffix]
    edit files in place (makes backup if extension supplied)
Comment 3 solar (RETIRED) gentoo-dev 2004-05-07 09:36:59 UTC
- The -i flag allows us to now have to swap out files with mv statements.
+ The -i flag allows us to not have to swap out files with mv statements.
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2004-05-07 19:25:50 UTC
sed -i -e 's/^LDFLAGS =/& -pie/' Makefile

There's no need to escape the spaces.  You're already quoting.  The & is replaced with whatever was matched on the LHS, no need to repeat LDFLAGS =.  Also use ^ to anchor the match to the start of a line.
Comment 5 Aron Griffis (RETIRED) gentoo-dev 2004-05-07 19:26:38 UTC
and of course append || die to make sure that the sed succeeds, otherwise you'll have no warning if it fails.
Comment 6 Danny van Dyk (RETIRED) gentoo-dev 2004-05-08 07:24:40 UTC
Oh god, just forgot about this bug. I need some kind of live-management... ;-)

Thanks for all those tips ! Didn't know any of them...
In CVS now.