[cairo] Cross-compiling Cairo. Included ltmain.sh/libtool brings in my host libs.

Leon Woestenberg leonw at mailcan.com
Sat Dec 24 08:18:16 PST 2005


Hello all,

I am having problems cross-compiling Cairo, and I think it boils down to 
a problem in the included "ltmain.sh".

Can pls. anyone more familiar with libtool see what could be the cause?

My aim is to cross-compile Cairo. Last time I did so, I stripped it down 
and got it to work on a Analog Blackfin DSP running the Visual DSP++ 
IDE, just for kicks. I threw out the font support then, because it 
brought too much dependencies. This time round, I am trying to 
cross-compile cairo on a "x86_64-linux" machine, for running on a 
"x86-linux" machine, but with font support via Freetype.

The problem is the resulting libtool brings in my development host 
libraries, while I am cross-compiling.

I have Freetype cross-compiled and verified ok. Fontconfig, I had the 
same problems as Cairo, and I had to manually link it. This is how I 
proceed with Cairo from there. Snippet 1 shows my configure, snippet 2 
shows that libtool comes up with the right compile arguments, but 
snippet 3 shows libtool lists /usr/lib64/libfreetype.so which is my 
hosts freetype library.;

---<snippet 1>---

./configure --host=i686-linux --prefix=/usr \
FONTCONFIG_CFLAGS=-I`pwd`/../../fontconfig/fontconfig-2.3.2/ \
FONTCONFIG_LIBS=-L`pwd`/../../fontconfig/fontconfig-2.3.2/.libs \
FREETYPE_CFLAGS="-I`pwd`/../../freetype/sysroot/usr/include 
-I`pwd`/../../freetype/sysroot/usr/include/freetype2" \ 
FREETYPE_LDFLAGS=-L`pwd`/../../freetype/sysroot/usr/lib \
--disable-xlib --disable-png --disable-ps --disable-pdf

---</snippet 1>---

libtool does fine in the compile stages:

---<snippet 2>---

if /bin/sh ../libtool --tag=CC --mode=compile i686-linux-gcc 
-DHAVE_CONFIG_H -I. -I. -I.. -I. -I../pixman/src 
-I/home/cross/sandbox/tracs/cairo/cairo-cvs/../../fontconfig/fontconfig-2.3.2/ 
-I/home/cross/sandbox/tracs/cairo/cairo-cvs/../../freetype/sysroot/usr/include 
-I/home/cross/sandbox/tracs/cairo/cairo-cvs/../../freetype/sysroot/usr/include/freetype2  
-Wall -Wpointer-arith -Wstrict-prototypes      -Wmissing-prototypes 
-Wmissing-declarations    -Wnested-externs -fno-strict-aliasing    -g 
-O2 -MT cairo-paginated-surface.lo -MD -MP -MF 
".deps/cairo-paginated-surface.Tpo" -c -o cairo-paginated-surface.lo 
cairo-paginated-surface.c; \
then mv -f ".deps/cairo-paginated-surface.Tpo" 
".deps/cairo-paginated-surface.Plo"; else rm -f 
".deps/cairo-paginated-surface.Tpo"; exit 1; fi

 i686-linux-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I../pixman/src 
-I/home/cross/sandbox/tracs/cairo/cairo-cvs/../../fontconfig/fontconfig-2.3.2/ 
-I/home/cross/sandbox/tracs/cairo/cairo-cvs/../../freetype/sysroot/usr/include 
-I/home/cross/sandbox/tracs/cairo/cairo-cvs/../../freetype/sysroot/usr/include/freetype2 
-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes 
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing -g -O2 -MT 
cairo-meta-surface.lo -MD -MP -MF .deps/cairo-meta-surface.Tpo -c 
cairo-meta-surface.c  -fPIC -DPIC -o .libs/cairo-meta-surface.o

---</snippet 2>---

But includes my host libraries during the link stage:

---<snippet 3>---

/bin/sh ../libtool --tag=CXX --mode=link i686-linux-g++  -g -O2  -s -o 
libcairo.la -rpath /usr/lib -version-info 5:0:3 -no-undefined  cairo.lo 
cairo-arc.lo cairo-array.lo cairo-cache.lo cairo-clip.lo cairo-color.lo 
cairo-debug.lo cairo-fixed.lo cairo-font.lo cairo-font-options.lo 
cairo-gstate.lo cairo-hash.lo cairo-hull.lo cairo-image-surface.lo 
cairo-matrix.lo cairo-path.lo cairo-path-bounds.lo cairo-path-data.lo 
cairo-path-fill.lo cairo-path-stroke.lo cairo-pen.lo cairo-polygon.lo 
cairo-region.lo cairo-scaled-font.lo cairo-slope.lo cairo-spline.lo 
cairo-stroke-style.lo cairo-surface.lo cairo-surface-fallback.lo 
cairo-traps.lo cairo-pattern.lo cairo-unicode.lo cairo-output-stream.lo 
cairo-wideint.lo cairo-meta-surface.lo cairo-paginated-surface.lo  
cairo-ft-font.lo              ../pixman/src/libpixman.la 
-L/home/cross/sandbox/tracs/cairo/cairo-cvs/../../fontconfig/fontconfig-2.3.2/.libs 
-lfreetype -lz      -lm

i686-linux-g++ -shared -nostdlib 
/home/cross/sandbox/tracs/diy/sysroot/usr/lib/crti.o 
/home/cross/sandbox/tracs/diy/i686/nptl/lib/gcc/i686-linux/3.4.4/crtbeginS.o  
.libs/cairo.o .libs/cairo-arc.o .libs/cairo-array.o .libs/cairo-cache.o 
.libs/cairo-clip.o .libs/cairo-color.o .libs/cairo-debug.o 
.libs/cairo-fixed.o .libs/cairo-font.o .libs/cairo-font-options.o 
.libs/cairo-gstate.o .libs/cairo-hash.o .libs/cairo-hull.o 
.libs/cairo-image-surface.o .libs/cairo-matrix.o .libs/cairo-path.o 
.libs/cairo-path-bounds.o .libs/cairo-path-data.o 
.libs/cairo-path-fill.o .libs/cairo-path-stroke.o .libs/cairo-pen.o 
.libs/cairo-polygon.o .libs/cairo-region.o .libs/cairo-scaled-font.o 
.libs/cairo-slope.o .libs/cairo-spline.o .libs/cairo-stroke-style.o 
.libs/cairo-surface.o .libs/cairo-surface-fallback.o .libs/cairo-traps.o 
.libs/cairo-pattern.o .libs/cairo-unicode.o .libs/cairo-output-stream.o 
.libs/cairo-wideint.o .libs/cairo-meta-surface.o 
.libs/cairo-paginated-surface.o .libs/cairo-ft-font.o 
-Wl,--whole-archive ../pixman/src/.libs/libpixman.a 
-Wl,--no-whole-archive  -Wl,--rpath -Wl,/usr/lib64 -Wl,--rpath 
-Wl,/home/cross/sandbox/tracs/diy/i686/nptl/i686-linux/lib -Wl,--rpath 
-Wl,/usr/lib64 -Wl,--rpath 
-Wl,/home/cross/sandbox/tracs/diy/i686/nptl/i686-linux/lib 
-L/home/cross/sandbox/tracs/cairo/cairo-cvs/../../fontconfig/fontconfig-2.3.2/.libs 
/usr/lib64/libfreetype.so -lz 
-L/home/cross/sandbox/tracs/diy/i686/nptl/lib/gcc/i686-linux/3.4.4 
-L/home/cross/sandbox/tracs/diy/i686/nptl/lib/gcc/i686-linux/3.4.4/../../../../i686-linux/lib 
-L/home/cross/sandbox/tracs/diy/sysroot/lib 
-L/home/cross/sandbox/tracs/diy/sysroot/usr/lib 
/home/cross/sandbox/tracs/diy/i686/nptl/i686-linux/lib/libstdc++.so 
-L/home/cross/sandbox/tracs/diy/src/i686/nptl/gcc-build/i686-linux/libstdc++-v3/src 
-L/home/cross/sandbox/tracs/diy/src/i686/nptl/gcc-build/i686-linux/libstdc++-v3/src/.libs 
-L/home/cross/sandbox/tracs/diy/src/i686/nptl/gcc-build/gcc 
-L/home/cross/sandbox/tracs/diy/i686/nptl/i686-linux/bin 
-L/home/cross/sandbox/tracs/diy/i686/nptl/i686-linux/lib -lm -lc -lgcc_s 
/home/cross/sandbox/tracs/diy/i686/nptl/lib/gcc/i686-linux/3.4.4/crtendS.o 
/home/cross/sandbox/tracs/diy/sysroot/usr/lib/crtn.o  -Wl,-soname 
-Wl,libcairo.so.2 -o .libs/libcairo.so.2.3.0
/usr/lib64/libfreetype.so: could not read symbols: File in wrong format

---</snippet 3>---


More information about the cairo mailing list