From owner-freebsd-java@FreeBSD.ORG Fri Mar 30 22:22:31 2007 Return-Path: X-Original-To: java@freebsd.org Delivered-To: freebsd-java@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF61A16A405 for ; Fri, 30 Mar 2007 22:22:31 +0000 (UTC) (envelope-from arnej@pvv.ntnu.no) Received: from decibel.pvv.ntnu.no (decibel.pvv.ntnu.no [129.241.210.179]) by mx1.freebsd.org (Postfix) with ESMTP id B4AA513C48A for ; Fri, 30 Mar 2007 22:22:31 +0000 (UTC) (envelope-from arnej@pvv.ntnu.no) Received: from arnej by decibel.pvv.ntnu.no with local (Exim 4.60) (envelope-from ) id 1HXP0l-000763-21; Fri, 30 Mar 2007 23:51:55 +0200 Date: Fri, 30 Mar 2007 23:51:55 +0200 (CEST) From: "Arne H. Juul" To: "David E. Cross" In-Reply-To: <20070330112806.S74265@monica.cs.rpi.edu> Message-ID: References: <20070330112806.S74265@monica.cs.rpi.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: java@freebsd.org Subject: Re: i386 jvm on an amd64... X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2007 22:22:32 -0000 On Fri, 30 Mar 2007, David E. Cross wrote: > (this is with ports built jdk1.5.0-p4) and FreeBSD 6.x, I'm guessing? > I am trying to run an i386 jvm on an amd64 architecture (and installed as > such machine). I get 2 classes of problems, the first is where it is > unable (for an unknown reason) to find the libjvm.so file. this I think is because when running a 32-bit binary on a 64-bit machine, it will use /libexec/ld-elf32.so.1 as the runtime linker, and that will use LD_32_LIBRARY_PATH instead of the normal LD_LIBRARY_PATH that the java main program. So when java figures out where the libraries are, it sets LD_LIBRARY_PATH in the environment and exec(2)'s itself, but that doesn't actually work. I don't know of any good solution to this, only a couple of workarounds; doing ldconfig -32 -m is probably the easiest for now. > I have fixed this > via an ldconfig -32 -m .... and the next is libverify.so which I also address > via a ldconfig -32 -m.. at that point however the java process simply > segfaults. I actually tried this very recently and found that the system calls that the pthread library use on FreeBSD 6 aren't properly translated between a 64-bit kernel and 32-bit userland, so it overwrites parts of the thread library and crashes in spectacular ways. I don't have the know-how to fix the sys/compat/freebsd32 stuff to include all the various kse_* and thr_* system calls properly, I'll leave that to the FreeBSD kernel people... - Arne H. J.