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 }
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.
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)
Killed old version, thereby fixing the problem. Good catch!