Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 1044 - sys-apps/hdparm-4.6.ebuild fails with Crusoe optimizations
Summary: sys-apps/hdparm-4.6.ebuild fails with Crusoe optimizations
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High critical
Assignee: Grant Goodyear (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-10 08:23 UTC by Rob McMullen
Modified: 2003-02-04 19:42 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob McMullen 2002-03-10 08:23:43 UTC
With the optimizations I wanted to use for compiling on the Crusoe processor:

-O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe
-mpreferred-stack-boundary=2 -march=i686 -malign-functions=0 -malign-jumps=0
-malign-loops=0

the sys-apps/hdparm ebuild fails because in src_unpack(), the sed command
replaces the -mpreferred-stack-boundary with '-mpreferredtack-boundary' instead
of removing the '-s' flag from the command line as was intended.

In general, any time sed is used to place the CFLAGS in a Makefile, we ought to
do any changes/deletions to the file before we insert the CFLAGS.  In other
words, unless you really mean to potentially change the user's CFLAGS, the
CFLAGS insertion ought to come last in the sed command.

Here's a fix for hdparm.

--- hdparm-4.6.ebuild	Sun Mar 10 07:53:31 2002
+++ hdparm-4.6-r1.ebuild	Sun Mar 10 07:50:15 2002
@@ -12,7 +12,7 @@
 	unpack ${A}
 	cd ${S}
 	mv Makefile Makefile.orig
-
sed -e "s/-O2/${CFLAGS}/" -e "s:-s::" \
+
sed -e "s:-s::" -e "s/-O2/${CFLAGS}/" \
 	Makefile.orig > Makefile
 }
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2002-03-12 10:01:03 UTC
Grant -- I fixed this bug on CVS, but I'm reassigning it to you because we
really need to add this info to our Development HOWTO.  It's something that
never occurred to me.
Comment 2 Maik Schreiber 2002-05-29 10:31:37 UTC
What's so different about this patch now? It still replaces things like
"-fkeep-static-consts" with "-fkeeptatic-consts" :-/

Better make that

  ... -e 's| -s||' ...

(note the space)
Comment 3 Grant Goodyear (RETIRED) gentoo-dev 2002-07-19 10:13:14 UTC
Killed old version, thereby fixing the problem.
Good catch!