This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PowerPC cross-compile build problem


I have hit a problem trying to cross-compile the GNU Java compiler for a
powerpc target.
I have searched all of the usual places (e.g. google for the error
message) and the only
thing I have found remotely related is the Changelog entry:


2000-12-30  Bryce McKinlay  <bryce@albatross.co.nz>

        * Makefile.am (libgcj_la_LIBADD): Add $(THREADLIBS). This ensures
that
        the correct versions of various linuxthreads functions get linked.


My target bootstrap process builds binutils, bootstrap compiler(c only),
glibc, then a full compiler using
the configure script:

../gcc/configure --target=powerpc-linux
--prefix=/home/measterbrook/projects/diameter/tools
--enable-languages=c,c++,java

(i.e. build on i386 to produce a compiler to run on a i386 to produce code
for a powerpc). The target is a small memory system with no disk so all
builds have to be on the i386 machine.

After a while, it trips up:

/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/gcc/xgcc
-shared-libgcc
-B/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/gcc/
-nostdinc++
-L/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/powerpc-linux/nof/libstdc++-v3/src
-L/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/powerpc-linux/nof/libstdc++-v3/src/.libs
-B/home/measterbrook/projects/diameter/tools/powerpc-linux/bin/
-B/home/measterbrook/projects/diameter/tools/powerpc-linux/lib/ -isystem
/home/measterbrook/projects/diameter/tools/powerpc-linux/include 
-msoft-float -fPIC -mstrict-align -shared -nostdlib
/home/measterbrook/projects/diameter/tools/powerpc-linux/lib/crti.o
/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/gcc/nof/crtbeginS.o
.libs/libgcj.la-2.o -Wl,--whole-archive
../boehm-gc/.libs/libgcjgc_convenience.a
../libffi/.libs/libffi_convenience.a ../zlib/.libs/libzgcj_convenience.a
-Wl,--no-whole-archive 
-L/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/powerpc-linux/nof/libstdc++-v3/src
-L/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/powerpc-linux/nof/libstdc++-v3/src/.libs
-L/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/powerpc-linux/nof/libjava
../boehm-gc/.libs/libgcjgc_convenience.a
../libffi/.libs/libffi_convenience.a ../zlib/.libs/libzgcj_convenience.a
-lpthread
-L/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/gcc/nof
-L/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/gcc
-L/home/measterbrook/projects/diameter/tools/powerpc-linux/bin
-L/home/measterbrook/projects/diameter/tools/powerpc-linux/lib/nof
-L/home/measterbrook/projects/diameter/tools/powerpc-linux/lib
-L/home/measterbrook/projects/diameter/tools/lib/gcc-lib/powerpc-linux/3.3.4/nof
-L/home/measterbrook/projects/diameter/tools/lib/gcc-lib/powerpc-linux/3.3.4
-L/home/measterbrook/projects/diameter/tools/lib/gcc-lib/powerpc-linux/3.3.4/../../../../powerpc-linux/lib/nof
-L/home/measterbrook/projects/diameter/tools/lib/gcc-lib/powerpc-linux/3.3.4/../../../../powerpc-linux/lib
-lgcc_s_nof -lc -lgcc_s_nof   
/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/gcc/nof/crtsavres.o
/home/measterbrook/projects/diameter/ppc/build-tools/build-gcc/gcc/nof/crtendS.o
/home/measterbrook/projects/diameter/tools/powerpc-linux/lib/crtn.o 
-Wl,-soname -Wl,libgcj.so.4 -o .libs/libgcj.so.4.0.0
/home/measterbrook/projects/diameter/tools/powerpc-linux/bin/ld: skipping
incompatible /lib/libpthread.so.0 when searching for /lib/libpthread.so.0
/home/measterbrook/projects/diameter/tools/powerpc-linux/bin/ld: cannot
find /lib/libpthread.so.0
collect2: ld returned 1 exit status

I have tried various gcc versions (3.3, 3.3.4, 3.4.0) and they all have the
problem.


Am I right in that it wants the /lib/libpthread.so.0
_of_the_target_system_ rather than the local build system one?
Should it use the --prefix from the configure script?
How do I tell it to use /lib/libpthread.so.0 only on the target system,
and use another one during the build process?


My build directories contain several /lib/libpthread.so.o:
The build of the target glibc:
/home/measterbrook/projects/diameter/ppc/build-tools/build-glibc/linuxthreads/libpthread.so.0
The target build tools:
/home/measterbrook/projects/diameter/tools/powerpc-linux/lib/libpthread.so.0
The installed glibc in the target initrd file system:
/home/measterbrook/projects/diameter/rootfs/lib/libpthread.so.0

As a work-around, I have hacked the offending Makefiles to change:
-lpthreads to the full path of the correct libpthread.so.0 (without
the -l) - however, I have to do this each time I run configure. Is
this safe or am I going to have problems when I use it on the target.

I hope I have included all relevent information :)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]