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.
Created attachment 28752 [details, diff] Patch to allow sys-devel/patch-2.5.9 to compile on amd64 with LDFLAGS="-pie"
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)
- 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.
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.
and of course append || die to make sure that the sed succeeds, otherwise you'll have no warning if it fails.
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.