<?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>211296</bug_id>
          
          <creation_ts>2008-02-24 19:02 0000</creation_ts>
          <short_desc>media-libs/netpbm fails to build with GCC 4.3</short_desc>
          <delta_ts>2008-06-16 15:11:43 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>Library</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>198121</blocked>
          
          <everconfirmed>1</everconfirmed>
          <reporter>dirtyepic@gentoo.org</reporter>
          <assigned_to>graphics@gentoo.org</assigned_to>
          <cc>alessandro.guido+bugzilla@gmail.com</cc>
    
    <cc>devurandom@gmx.net</cc>
    
    <cc>gregoire.favre@gmail.com</cc>
    
    <cc>sebasmagri@gmail.com</cc>
    
    <cc>truedfx@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>dirtyepic@gentoo.org</who>
            <bug_when>2008-02-24 19:02:41 0000</bug_when>
            <thetext>I don&apos;t have a patch since I don&apos;t know MMX builtins and it seems like no one at the other distros do either ;P.  The workaround for this error is append-flags -flax-vector-conversions, which is the route it seems everyone has taken.  I would recommend we do the same until someone fixes this correctly.  This code is only triggered by -msse, so this is x86/x86_64 specific.


the error:

i686-pc-linux-gnu-gcc -Wall -c -I/var/tmp/portage/media-libs/netpbm-10.41.0/work/netpbm-10.41.0/lib -I. -Iimportinc -DNDEBUG  -O2 -g -march=prescott -fomit-frame-pointer -pipe -fPIC \
            -o libpbm3.o libpbm3.c
libpbm3.c: In function &apos;packBitsWithMmxSse&apos;:
libpbm3.c:107: warning: specifying vector types with __attribute__ ((mode)) is deprecated
libpbm3.c:107: warning: use __attribute__ ((vector_size)) instead
libpbm3.c:116: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
libpbm3.c:116: error: incompatible type for argument 1 of &apos;__builtin_ia32_pcmpeqb&apos;
libpbm3.c:116: error: incompatible type for argument 2 of &apos;__builtin_ia32_pcmpeqb&apos;
libpbm3.c:116: error: incompatible types in initialization
libpbm3.c:118: error: incompatible type for argument 1 of &apos;__builtin_ia32_pmovmskb&apos;
make[1]: *** [libpbm3.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-libs/netpbm-10.41.0/work/netpbm-10.41.0/lib&apos;


the code if anyone wants to look at this:

    typedef int v8qi __attribute__ ((mode(V8QI)));
    typedef int di __attribute__ ((mode(DI)));

    di const zero64 = 0;        /* to clear with PXOR */

    unsigned int col;

    for (col = 0; col + 7 &lt; cols; col += 8) {
        v8qi const compare =
            __builtin_ia32_pcmpeqb(*(v8qi*) (&amp;bitrow[col]), *(v8qi*) &amp;zero64);
        unsigned char const backwardWhiteMask = (unsigned char)
            __builtin_ia32_pmovmskb(compare);
        unsigned char const backwardBlackMask = ~backwardWhiteMask;
        unsigned char const blackMask = bitreverse[backwardBlackMask];

        packedBits[col/8] = blackMask;
    }



To prevent the deprecated warning change
    typedef int v8qi __attribute__ ((mode(V8QI)));
to
    typedef int v8qi __attribute__ ((vector_size(8)));</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>truedfx@gentoo.org</who>
            <bug_when>2008-02-25 20:14:53 0000</bug_when>
            <thetext>Looks like it simply needs
  typedef char v8qi __attribute__ ((vector_size(8)));

I&apos;ve checked that the resulting netpbm still works using
  netpbm pbmtoatk testgrid.pbm | netpbm atktopbm - | diff testgrid.pbm -
(and verified that the modified code gets executed by atktopbm)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>truedfx@gentoo.org</who>
            <bug_when>2008-02-25 20:32:35 0000</bug_when>
            <thetext>Created an attachment (id=144639)
netpbm-gcc43.patch

In a nice patch format...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dirtyepic@gentoo.org</who>
            <bug_when>2008-02-26 00:37:56 0000</bug_when>
            <thetext>i thought the base type was ignored when defining vector types with builtins.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dirtyepic@gentoo.org</who>
            <bug_when>2008-02-26 00:42:07 0000</bug_when>
            <thetext>ahhh.  it helps if the manual i&apos;m looking at isn&apos;t for 3.4.4.  :P

thanks!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gregoire.favre@gmail.com</who>
            <bug_when>2008-03-28 17:06:06 0000</bug_when>
            <thetext>Any idea why this patch isn&apos;t included as it works just like a charm ?
I know gcc-4.3.x isn&apos;t really in portage, but it will prepare the future, no ?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-03-28 18:22:03 0000</bug_when>
            <thetext>learn a little bit of patience please</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gregoire.favre@gmail.com</who>
            <bug_when>2008-03-28 18:55:58 0000</bug_when>
            <thetext>Well, I am not complaining... so either my english is too bad and I didn&apos;t wrote what I am feeling, or ???

Anyway, thank for the patch :-)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-03-29 16:18:25 0000</bug_when>
            <thetext>sent fix upstream and i merged what he committed

http://sources.gentoo.org/media-libs/netpbm/netpbm-10.26.52.ebuild?r1=1.1&amp;r2=1.2
http://sources.gentoo.org/media-libs/netpbm/netpbm-10.42.0.ebuild?r1=1.1&amp;r2=1.2
http://sources.gentoo.org/media-libs/netpbm/files/netpbm-10.42.0-gcc43.patch?rev=1.1</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ssuominen@gentoo.org</who>
            <bug_when>2008-06-16 15:11:43 0000</bug_when>
            <thetext>*** Bug 227451 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>144639</attachid>
            <date>2008-02-25 20:32 0000</date>
            <desc>netpbm-gcc43.patch</desc>
            <filename>gcc43.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIG5ldHBibS0xMC40MS4wL2xpYi9saWJwYm0zLmMKKysrIG5ldHBibS0xMC40MS4wL2xpYi9s
aWJwYm0zLmMKQEAgLTEwNCw3ICsxMDQsNyBAQAogICAgICAgICAgICAgKSBdOwogICAgICovCiAK
LSAgICB0eXBlZGVmIGludCB2OHFpIF9fYXR0cmlidXRlX18gKChtb2RlKFY4UUkpKSk7CisgICAg
dHlwZWRlZiBjaGFyIHY4cWkgX19hdHRyaWJ1dGVfXyAoKHZlY3Rvcl9zaXplKDgpKSk7CiAgICAg
dHlwZWRlZiBpbnQgZGkgX19hdHRyaWJ1dGVfXyAoKG1vZGUoREkpKSk7CiAKICAgICBkaSBjb25z
dCB6ZXJvNjQgPSAwOyAgICAgICAgLyogdG8gY2xlYXIgd2l0aCBQWE9SICovCg==
</data>        

          </attachment>
    </bug>

</bugzilla>