[cairo] Help compiling Cairo-1.12.0 for the PS3

Nacho Man nacho2874 at yahoo.com
Sat Nov 30 12:01:01 PST 2013

Hello, I am trying to compile Cairo-1.12.0 for the Playstation 3.  I am having trouble.   Cairo-1.10.2 compiles just fine.   With Cairo-1.12.0 or higher, I get the following error message:

make[5]: Leaving directory `/home/spork/src/toolchain/build/ps3libraries/build/cairo-1.12.0/build-ppu/boilerplate'
  CCLD   cairo-test-suite
cairo_test_suite-cairo-test.o: In function `.cairo_test_reference_filename':
cairo-test.c:(.text.cairo_test_reference_filename+0x84): undefined reference to `.access'
cairo-test.c:(.text.cairo_test_reference_filename+0xfc): undefined reference to `.access'
cairo-test.c:(.text.cairo_test_reference_filename+0x15c): undefined reference to `.access'
cairo-test.c:(.text.cairo_test_reference_filename+0x1dc): undefined reference to `.access'
cairo-test.c:(.text.cairo_test_reference_filename+0x23c): undefined reference to `.access'
cairo_test_suite-cairo-test.o:cairo-test.c:(.text.cairo_test_reference_filename+0x2ac): more undefined references to `.access' follow
../boilerplate/.libs/libcairoboilerplate.a(cairo-boilerplate.o):(.toc+0xf8): undefined reference to `pclose'
../boilerplate/.libs/libcairoboilerplate.a(cairo-boilerplate.o): In function `.cairo_boilerplate_open_any2ppm':
cairo-boilerplate.c:(.text.cairo_boilerplate_open_any2ppm+0x90): undefined reference to `.popen'
collect2: error: ld returned 1 exit status
make[4]: *** [cairo-test-suite] Error 1
make[4]: Leaving directory `/home/spork/src/toolchain/build/ps3libraries/build/cairo-1.12.0/build-ppu/test'

The problem is with cairo-test.c using the access() function.   The 1.10.2 version of cairo-test.c also contains the access() function.  I have no problems with that version though.   Just 1.12.0 or higher.  It appears that in 1.10.2, the files in ./cairo-1.10.2/test do not get compiled at all, however, in the later versions they do.   Is there any way to pass something to the configure script to get it to not compile the test suite?   I am using the PS3Toolchain to compile this.  I have updated the packages in the toolchain to the latest and greatest versions (for example, instead of GCC-4.7.0, I'm using GCC-4.8.2).  I have created a simple C program that uses the access() function to see if it will compile and it does...if I use spu-gcc to compile it instead of powerpc64-ps3-elf-gcc.

Here are the configure options I'm using:

CPPFLAGS="-I${PS3DEV}/ppu/include -I${PS3DEV}/portlibs/ppu/include" \
CFLAGS="-I${PS3DEV}/ppu/include -I${PS3DEV}/portlibs/ppu/include -DCAIRO_NO_MUTEX" \
LDFLAGS="-L${PS3DEV}/ppu/lib -L${PS3DEV}/portlibs/ppu/lib -lrt -llv2" \
PKG_CONFIG_PATH="$PS3DEV/portlibs/ppu/lib/pkgconfig" \
../configure --prefix="$PS3DEV/portlibs/ppu" --host="powerpc64-ps3-elf" \
--enable-script=no --enable-test-surfaces=no --enable-xcb=no --disable-dependency-tracking \
--enable-option-checking --enable-fc=no --enable-xlib="no" --disable-shared --disable-valgrind \

I create a build-ppu directory in ./cairo-1.12.0 and I change to that directory then I run configure and then finally make.  If I can figure this out with your guys help, I can work on updating the rest of the PS3 Libraries to the latest versions.   The reason I started with Cairo-1.12.0 is because the latest version has the same issue.   And since the version before 1.12.0 compiles, I figured it'd be easier to figure out.

The access() function for the PS3Toolchain is provided by libgloss.   It's in the newlib-1.20.0/libgloss/spu/access.c file.   There's no PPU version of it.   One of the things I tried (and failed at) was modifying the Makefile in the ./cairo-1.12.0/build-ppu/test directory and manually switching all the various variables that used the powerpc64-ps3-elf stuff over to the spu stuff.   For example, I replaced CC = powerpc64-ps3-elf-gcc with CC = spu-gcc.   This got the test suite to compile successfully, however, further down the line I had problems with incompatible libraries (which I was afraid of).   I used to be a system programmer back in 2005.  I haven't programmed in a while so it's a little fuzzy still.   Any ideas?   Thank you guys.   I appreciate the help.

More information about the cairo mailing list