Problems compiling on NetBSD/m68k

Kiyo Inaba inaba at
Thu Mar 4 04:32:21 PST 1999

I may find why (my) cross compilation environment was broken,
when libtools is introduced.

I wrote:
>With '--with-staticlib --with-staticvm --with-engine=jit --with-threads=unix-jthreads --without-x'
>for 99/2/28 snap, I get
>	.libs/KaffeS.o(.text+0x1de8): undefined reference to `_GLOBAL_OFFSET_TABLE_'
>	../kaffevm/.libs/libkaffevm.a(ltdl.lo): In function `dl_open':
>	/proj/lab4/inaba/src/kaffe-snap-nb3-sjj/libltdl/../../kaffe-snap/libltdl/ltdl.c:255: undefined reference to `_GLOBAL_OFFSET_TABLE_'

Ok, I dig into this problem...

_GLOBAL_OFFSET_TABLE_ are defined when I use -fPIC for gcc. With the
configuration above, two files shown below have references to this

So, where this symbol is defined?
	lib/libc.a <= NO.
	lib/ <= YES

Well, -fPIC needs shared libc...

# BTW, I did not copy* or to the cross environment.

Next try. If I specify '--disable-shared', what happens?

This time, 'ltdl.lo' is not generated. Only 'ltdl.o' (without -fPIC
flag) is generated. But still, 'KaffeS.o' is compiled with -fPIC
flag, sigh...

Then, if I compile KaffeS.c without -fPIC.
Voila! I get Kaffe without any 'undefined reference'! I am now
testing this cross-compiled-statically-linked version of Kaffe,
and at least first 7 tests has passed.

	Prepare KaffeS.lo (with -fPIC) or KaffeS.o (without
	-fPIC) corresponding to the configuration options


More information about the kaffe mailing list