Subject: Re: Problems with JDK 1.5.0 patchset 6
To: None <>
From: Bernd Ernesti <>
List: netbsd-java
Date: 08/19/2007 15:00:55
On Sun, Aug 12, 2007 at 10:45:25PM +0200, Bernd Ernesti wrote:
> Hi,
> I'm trying to update the jdk15 wip package to p6 and got one problem:
> gmake[6]: Entering directory `/pkgsrc/lang/jdk15/work.i386/j2se/make/sun/javac/javac'
> /bin/mkdir -p /pkgsrc/lang/jdk15/work.i386/control/build/bsd-i586/tmp/sun/
> rm -f /pkgsrc/lang/jdk15/work.i386/control/build/bsd-i586/tmp/sun/
> /pkgsrc/lang/jdk15/work.i386/control/build/bsd-i586/bin/java -classpath ../../../tools/CompileProperties CompileProperties ../../../../src/share/classes/com/sun/tools/javac/resources/ /pkgsrc/lang/jdk15/work.i386/control/build/bsd-i586/gensrc/com/sun/tools/javac/resources/
> dl failure on line 730Error: failed /pkgsrc/lang/jdk15/work.i386/control/build/bsd-i586/lib/i386/client/, because /usr/lib/ Undefined PLT symbol "_Unwind_GetIP" (symnum = 161)

I found two places between the p4 and p6 patchset which maybe related.

- In hotspot/build/bsd/makefiles/vm.make:

 -LINK_LIB  = ${CPP} -shared -mimpure-text 
 +LINK_LIB  = ${CPP} -shared -mimpure-text -fPIC

So is now build with -fPIC.

From the p5 Changelog:

2007-05-17 Thursday 17:12  truk
        * hotspot/build/bsd/makefiles/vm.make:
        - link with -fPIC (needed for !i386)

And for another library:

2007-05-24 Thursday 04:52  glewis
        * j2se/make/sun/jdbc/Makefile:
        . Correctly compile shared library objects with -fPIC.
          This avoids an error with gcc 4.2 on amd64.

But this seems to not be my problem. I removed the -fPIC (I know that
this shouldn't have been done, but I wanted to rule it out that this
was the problem) but it still fails the same way.

- Then there is now a version script while linking the libraries.

From hotspot/build/bsd/makefiles/vm.make:

 LFLAGS_VM += -Xlinker --version-script=$(MAPFILE)

Which uses different scripts depending on if this is a debug version or not.
For libjvm_g MAPFILE is defined in hotspot/build/bsd/makefiles/jvmg.make:
 MAPFILE = $(GAMMADIR)/build/bsd/makefiles/mapfile-vers-debug
The same file is also used by hotspot/build/bsd/makefiles/fastdebug.make.

Or hotspot/build/bsd/makefiles/mapfile-vers-product for the normal,
which is defined in hotspot/build/bsd/makefiles/product.make

Both mapfiles have another problem. They use JVM_handle_linux_signal
intead of JVM_handle_bsd_signal.

The mapfile scripts are also disabled for FreeBSD 4, where this was the
entry in the p6 Changelog:

2007-07-25 Wednesday 09:23  arnej
        * hotspot/build/bsd/makefiles/vm.make:
        disable version script on FreeBSD 4, causes dladdr() failure

Adding the same logic for NetBSD made it possible to execute
control/build/bsd-i586/bin/java and continue with the build.

I don't know which problems we will get while disabling the mapfiles.