Bug 211296 - media-libs/netpbm fails to build with GCC 4.3
|
Bug#:
211296
|
Product: Gentoo Linux
|
Version: unspecified
|
Platform: x86
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: graphics@gentoo.org
|
Reported By: dirtyepic@gentoo.org
|
|
Component: Library
|
|
|
URL:
|
|
Summary: media-libs/netpbm fails to build with GCC 4.3
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2008-02-24 19:02 0000
|
I don't have a patch since I don'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 'packBitsWithMmxSse':
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
'__builtin_ia32_pcmpeqb'
libpbm3.c:116: error: incompatible type for argument 2 of
'__builtin_ia32_pcmpeqb'
libpbm3.c:116: error: incompatible types in initialization
libpbm3.c:118: error: incompatible type for argument 1 of
'__builtin_ia32_pmovmskb'
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'
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 < cols; col += 8) {
v8qi const compare =
__builtin_ia32_pcmpeqb(*(v8qi*) (&bitrow[col]), *(v8qi*) &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)));
Looks like it simply needs
typedef char v8qi __attribute__ ((vector_size(8)));
I'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)
i thought the base type was ignored when defining vector types with builtins.
ahhh. it helps if the manual i'm looking at isn't for 3.4.4. :P
thanks!
Any idea why this patch isn't included as it works just like a charm ?
I know gcc-4.3.x isn't really in portage, but it will prepare the future, no ?
learn a little bit of patience please
Well, I am not complaining... so either my english is too bad and I didn't
wrote what I am feeling, or ???
Anyway, thank for the patch :-)
*** Bug 227451 has been marked as a duplicate of this bug. ***