<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>1044</bug_id>
          
          <creation_ts>2002-03-10 08:23 0000</creation_ts>
          <short_desc>sys-apps/hdparm-4.6.ebuild fails with Crusoe optimizations</short_desc>
          <delta_ts>2003-02-04 19:42:18 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>robm@flipturn.org</reporter>
          <assigned_to>g2boojum@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>robm@flipturn.org</who>
            <bug_when>2002-03-10 08:23:43 0000</bug_when>
            <thetext>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 &apos;-mpreferredtack-boundary&apos; instead
of removing the &apos;-s&apos; 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&apos;s CFLAGS, the
CFLAGS insertion ought to come last in the sed command.

Here&apos;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 &quot;s/-O2/${CFLAGS}/&quot; -e &quot;s:-s::&quot; \
+
sed -e &quot;s:-s::&quot; -e &quot;s/-O2/${CFLAGS}/&quot; \
 	Makefile.orig &gt; Makefile
 }</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>drobbins@gentoo.org</who>
            <bug_when>2002-03-12 10:01:03 0000</bug_when>
            <thetext>Grant -- I fixed this bug on CVS, but I&apos;m reassigning it to you because we
really need to add this info to our Development HOWTO.  It&apos;s something that
never occurred to me.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>blizzy-keyword-gentoo_bugs2.a8a736@blizzy.de</who>
            <bug_when>2002-05-29 10:31:37 0000</bug_when>
            <thetext>What&apos;s so different about this patch now? It still replaces things like
&quot;-fkeep-static-consts&quot; with &quot;-fkeeptatic-consts&quot; :-/

Better make that

  ... -e &apos;s| -s||&apos; ...

(note the space)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>g2boojum@gentoo.org</who>
            <bug_when>2002-07-19 10:13:14 0000</bug_when>
            <thetext>Killed old version, thereby fixing the problem.
Good catch!</thetext>
          </long_desc>
      
    </bug>

</bugzilla>