[kaffe] Question on cross compiling with static libraries

Dan Kegel dank at kegel.com
Fri Jan 3 21:04:03 PST 2003


Kim, Seong Beom wrote:
> Host: i386-linux (RedHat 7.3)
> Target: mips-linux (RedHat 7.1)
> Configuration command:
> CC=mips-linux-gcc CXX=mips-linux-c++ ./configure --with-engine=intrp 
> --target=mips-pc-linux-gnu --host=mips-pc-linux-gnu --build=mips-pc-linux-gnu
> --with-includes=/usr/mips-linux/include --with-libraries=/usr/mips-linux/lib
> --with-awt=qt --with-qtdir=/home/sbkim/work/qte-3.0.6
> --with-jikes=/home/sbkim/bin/jikes --disable-debug --with-staticlib
> [but I get undefined references to libpthread when I link]
> Because libqte-mt.a refers functions in libpthread.a and libjpeg.a,
> those errors are natural and can easily be avoided only if I can specify proper libraries.
> The question I have is how to do it elegantly. ;-)
> Of course, I can hack configure and configure.in file to my taste but I would like to know a better way.

The simple answer is probably to select unix-jthreads
when configuring :-)

For what it's worth, here's the configure line I use to compile
from x86 Debian 3.0 to powerpc linux:

set -e; cd ppc750; CC=/opt/hardhat/devkit/ppc/7xx/bin/powerpc-linux-gcc CFLAGS="-mcpu=750
-D__PPC750__" LD=/opt/hardhat/devkit/ppc/7xx/bin/powerpc-linux-ld
AR=/opt/hardhat/devkit/ppc/7xx/bin/powerpc-linux-ar
KAFFEH=/home/dank/wk/ixos/dap/ppc750-release/build/bin/kaffeh ac_cv_alignmentof_voidp=4
ac_cv_long_division_broken=yes ac_cv_long_long_modulo_broken=no ac_cv_long_modulo_broken=yes
ac_cv_strtod_m0_broken=no kaffe_cv_signal_one_shot=no ../kaffe-1.0.7-libtool1.4e/configure
--without-x --build=i686-pc-linux-gnu --host=ppc-unknown-linux --prefix=/opt/kaffe \
--with-threads=unix-pthreads \
--disable-debug \
--disable-xprofiling \
--disable-xdebugging \
--disable-feedback \
--without-profiling \
--without-stats \
--disable-gcj

Configure prints

checking for pthread_create in -lpthread... yes

It creates a top-level Makefile containing

VM_LIBS = -lpthread

and my link lines do indeed include
 -lpthread

If this isn't happening for you, something's wrong...

You have a newer version of the source than I do,
but I suspect it ought to work similarly...
- Dan

-- 
Dan Kegel
Linux User #78045
http://www.kegel.com





More information about the kaffe mailing list