Bug 7900 - liboil-0.3.9 generates instructions that cause compiles to fail on NetBSD 3.0.1/macppc
liboil-0.3.9 generates instructions that cause compiles to fail on NetBSD 3.0...
Status: RESOLVED FIXED
Product: liboil
Classification: Unclassified
Component: unknown
HEAD
PowerPC NetBSD
: high major
Assigned To: David Schleef
David Schleef
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-15 20:39 UTC by David H. Gutteridge
Modified: 2007-03-16 15:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David H. Gutteridge 2006-08-15 20:39:13 UTC
Compiling liboil-0.3.9 on NetBSD 3.0.1/macppc results in the following errors:

Making all in powerpc
if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I../..   -I /usr/pkg/include -Wall -Wa,-mregnames -D_BSD_SOURCE -D_GNU_SOURCE
-I../.. -g -O2 -MT libpowerpc_la-abs.lo -MD -MP -MF
".deps/libpowerpc_la-abs.Tpo" -c -o libpowerpc_la-abs.lo `test -f 'abs.c' ||
echo './'`abs.c;  then mv -f ".deps/libpowerpc_la-abs.Tpo"
".deps/libpowerpc_la-abs.Plo"; else rm -f ".deps/libpowerpc_la-abs.Tpo"; exit 1; fi
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I /usr/pkg/include -Wall -Wa,-mregnames
-D_BSD_SOURCE -D_GNU_SOURCE -I../.. -g -O2 -MT libpowerpc_la-abs.lo -MD -MP -MF
.deps/libpowerpc_la-abs.Tpo -c abs.c  -fPIC -DPIC -o .libs/libpowerpc_la-abs.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I /usr/pkg/include -Wall -Wa,-mregnames
-D_BSD_SOURCE -D_GNU_SOURCE -I../.. -g -O2 -MT libpowerpc_la-abs.lo -MD -MP -MF
.deps/libpowerpc_la-abs.Tpo -c abs.c -o libpowerpc_la-abs.o >/dev/null 2>&1
if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I../..   -I /usr/pkg/include -Wall -Wa,-mregnames -D_BSD_SOURCE -D_GNU_SOURCE
-I../.. -g -O2 -MT libpowerpc_la-clip.lo -MD -MP -MF
".deps/libpowerpc_la-clip.Tpo" -c -o libpowerpc_la-clip.lo `test -f 'clip.c' ||
echo './'`clip.c;  then mv -f ".deps/libpowerpc_la-clip.Tpo"
".deps/libpowerpc_la-clip.Plo"; else rm -f ".deps/libpowerpc_la-clip.Tpo"; exit
1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I /usr/pkg/include -Wall -Wa,-mregnames
-D_BSD_SOURCE -D_GNU_SOURCE -I../.. -g -O2 -MT libpowerpc_la-clip.lo -MD -MP -MF
.deps/libpowerpc_la-clip.Tpo -c clip.c  -fPIC -DPIC -o .libs/libpowerpc_la-clip.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I /usr/pkg/include -Wall -Wa,-mregnames
-D_BSD_SOURCE -D_GNU_SOURCE -I../.. -g -O2 -MT libpowerpc_la-clip.lo -MD -MP -MF
.deps/libpowerpc_la-clip.Tpo -c clip.c -o libpowerpc_la-clip.o >/dev/null 2>&1
if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I../..   -I /usr/pkg/include -Wall -Wa,-mregnames -D_BSD_SOURCE -D_GNU_SOURCE
-I../.. -g -O2 -MT libpowerpc_la-conv.lo -MD -MP -MF
".deps/libpowerpc_la-conv.Tpo" -c -o libpowerpc_la-conv.lo `test -f 'conv.c' ||
echo './'`conv.c;  then mv -f ".deps/libpowerpc_la-conv.Tpo"
".deps/libpowerpc_la-conv.Plo"; else rm -f ".deps/libpowerpc_la-conv.Tpo"; exit
1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I /usr/pkg/include -Wall -Wa,-mregnames
-D_BSD_SOURCE -D_GNU_SOURCE -I../.. -g -O2 -MT libpowerpc_la-conv.lo -MD -MP -MF
.deps/libpowerpc_la-conv.Tpo -c conv.c  -fPIC -DPIC -o .libs/libpowerpc_la-conv.o
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I /usr/pkg/include -Wall -Wa,-mregnames
-D_BSD_SOURCE -D_GNU_SOURCE -I../.. -g -O2 -MT libpowerpc_la-conv.lo -MD -MP -MF
.deps/libpowerpc_la-conv.Tpo -c conv.c -o libpowerpc_la-conv.o >/dev/null 2>&1
if /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.
-I../..   -I /usr/pkg/include -Wall -Wa,-mregnames -D_BSD_SOURCE -D_GNU_SOURCE
-I../.. -g -O2 -MT libpowerpc_la-copy.lo -MD -MP -MF
".deps/libpowerpc_la-copy.Tpo" -c -o libpowerpc_la-copy.lo `test -f 'copy.c' ||
echo './'`copy.c;  then mv -f ".deps/libpowerpc_la-copy.Tpo"
".deps/libpowerpc_la-copy.Plo"; else rm -f ".deps/libpowerpc_la-copy.Tpo"; exit
1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I /usr/pkg/include -Wall -Wa,-mregnames
-D_BSD_SOURCE -D_GNU_SOURCE -I../.. -g -O2 -MT libpowerpc_la-copy.lo -MD -MP -MF
.deps/libpowerpc_la-copy.Tpo -c copy.c  -fPIC -DPIC -o .libs/libpowerpc_la-copy.o
/var/tmp//ccTEzesh.s: Assembler messages:
/var/tmp//ccTEzesh.s:63: Error: Unrecognized opcode: `lvsl'
/var/tmp//ccTEzesh.s:64: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:67: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:68: Error: Unrecognized opcode: `vperm'
/var/tmp//ccTEzesh.s:69: Error: Unrecognized opcode: `stvx'
/var/tmp//ccTEzesh.s:70: Error: Unrecognized opcode: `vor'
/var/tmp//ccTEzesh.s:98: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:99: Error: Unrecognized opcode: `stvx'
/var/tmp//ccTEzesh.s:184: Error: Unrecognized opcode: `lvsl'
/var/tmp//ccTEzesh.s:185: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:188: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:190: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:192: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:194: Error: Unrecognized opcode: `lvx'
/var/tmp//ccTEzesh.s:196: Error: Unrecognized opcode: `vperm'
/var/tmp//ccTEzesh.s:197: Error: Unrecognized opcode: `vperm'
/var/tmp//ccTEzesh.s:198: Error: Unrecognized opcode: `vperm'
/var/tmp//ccTEzesh.s:199: Error: Unrecognized opcode: `vperm'
/var/tmp//ccTEzesh.s:200: Error: Unrecognized opcode: `stvx'
/var/tmp//ccTEzesh.s:202: Error: Unrecognized opcode: `stvx'
/var/tmp//ccTEzesh.s:204: Error: Unrecognized opcode: `stvx'
/var/tmp//ccTEzesh.s:206: Error: Unrecognized opcode: `stvx'
/var/tmp//ccTEzesh.s:208: Error: Unrecognized opcode: `vor'
*** Error code 1

Stop.
make: stopped in /tmp/liboil-0.3.9/liboil/powerpc
*** Error code 1

Stop.
make: stopped in /tmp/liboil-0.3.9/liboil
*** Error code 1

Stop.
make: stopped in /tmp/liboil-0.3.9
*** Error code 1

Stop.
make: stopped in /tmp/liboil-0.3.9

It looks like (to my less-than-knowledgable eyes) these are Altivec instructions
which are causing the assembler some confusion.

GCC version:

Using built-in specs.
Configured with:
/home/nick/work/netbsd/src/tools/gcc/../../gnu/dist/gcc/configure
--enable-long-long --disable-multilib --enable-threads --disable-symvers
--build=i386-unknown-netbsdelf2.0. --host=powerpc--netbsd --target=powerpc--netbsd
Thread model: posix
gcc version 3.3.3 (NetBSD nb3 20040520)

The machine in question is a 366MHz G3 (750-series) processor, which as far as I
know doesn't support Altivec instructions.
Comment 1 David H. Gutteridge 2006-09-27 11:35:31 UTC
I think the solution to this problem is quite simple.  I think I misunderstood
how liboil works, normally if I see Altivec instructions being compiled, I
assume they will be called, but I infer that's not the case with liboil, rather
it determines at run-time whether to apply them.  (Or that's what the slide show
posted on the wiki site suggests.  I haven't had time to look at the code.)

I was able to fix builds on NetBSD/macppc just by adding -maltivec and
-mabi=altivec to the CFLAGS variable.  NetBSD does not enable these by default
during compiles (especially not on an install with a G3 processor).  I
understand another NetBSD user successfully compiled with these changes on a G4
though they encountered some relocation issues when trying to run gstreamer, but
that's a separate problem.

So the fix seems to be that if the configure script finds the compiler supports
Altivec, and it does, and it's GCC, then the CFLAGS variable should be set to
explicitly accommodate compiling Altivec instructions.
Comment 2 David Schleef 2007-03-16 15:19:06 UTC
Uh, duh, add -maltivec on powerpc.  Sorry I took so long to fix this.