From owner-freebsd-emulation@FreeBSD.ORG Thu Aug 5 05:53:11 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B115D16A4CE for ; Thu, 5 Aug 2004 05:53:11 +0000 (GMT) Received: from mail.postmark.net (postmark.net [199.227.76.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 531D543D67 for ; Thu, 5 Aug 2004 05:53:11 +0000 (GMT) (envelope-from themask@postmark.net) Received: by mail.postmark.net (Postfix, from userid 500) id C461C143634; Thu, 5 Aug 2004 01:40:53 -0400 (EDT) Received: from 202.149.214.109 by www.postmark.net with HTTP; 05 Aug 2004 05:40:53 -0000 Mime-Version: 1.0 From: The Mask To: freebsd-emulation Date: Thu, 05 Aug 2004 11:10:53 +0530 Content-Type: text/plain; charset="iso-8859-1" Message-Id: <20040805054053.C461C143634@mail.postmark.net> Subject: Req for help: ELF File OS ABI Invalid X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2004 05:53:11 -0000 Hi, I am searching really hard for a solution regarding the "ELF file OS ABI Invalid" error. I am running Simple Jni example (to test jni I am getting same error in my project)on FreeBSD but I am getting the following error while executing my java program: %java Sample1 Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/home/smgusr/mangesh/libSample1.so.1.0.1: /usr/home/smgusr/mangesh/libSample1.so.1.0.1: ELF file OS ABI invalid at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1456) at java.lang.Runtime.load0(Runtime.java:737) at java.lang.System.load(System.java:811) at Sample1.main(Sample1.java:10) if I use the ldd command it refer like this %ldd /usr/home/smgusr/mangesh/libSample1.so.1.0.1 /usr/home/smgusr/mangesh/libSample1.so.1.0.1: libc.so.4 => /usr/lib/libc.so.4 (0x2806a000) I have made libSample1.so.1.0.1 in the following way: gcc -o2 -fPIC -g -I/usr/local/linux-sun-jdk1.4.2/include -I/usr/local/linux-sun-jdk1.4.2/include/linux -c Sample1.c -o Sample1.o for linking and making shared library gcc -o2 -shared -fPIC -pthread -Wl -I/usr/local/linux-sun-jdk1.4.2/include -I/usr/local/linux-sun-jdk1.4.2/include/linux -soname,libSample1.so.1 -o libSample1.so.1.0.1 Sample1.o -L/usr/compat/linux/lib -L/usr/lib -L/usr/home/smgusr/mangesh -lc Even though I try to load standard shared library from /usr/lib the error persists. What is going wrong? Is it the Linux emulator problemor my shared lirary problem?? We have installed linux_base to set linux environment set linux_base="yes" (/etc/rc.conf) set kern.fallback_brand=3 (/etc/sysctl.conf) Running kldstat is giving the following result %kldstat Id Refs Address Size Name 1 4 0xc0100000 44fbf8 kernel 2 1 0xc33e3000 7000 linprocfs.ko 3 1 0xc3455000 15000 linux.ko 4 1 0xc3646000 3000 snp.ko Running following command to check linux binary compatibility layer is loaded: %kldstat -v | grep linuxelf 219 linuxelf I am getting the above output which means the linux emulator is loaded. Running following command to check if the layer is compiled into the kernel or loaded as a module: % kldstat | grep linux.ko 3 1 0xc3455000 15000 linux.ko I am getting the above output (Ref link:http://www.merlinobbs.net/modules.php?name=News&file=article&sid= 483 Does it means it needs some more settings like setting options compat_linux in kernel config? Is there any issue related to configuring ld.so files on FreeBSD?? linprocfs is mounted and showing entry in the (/etc/fstab) and kldstat command. Configuration is : FreeBSD 4.10-BETA (GENERIC) I am using the following packages linux-sun-jdk-1.4.2.04 Sun Java Development Kit 1.4 for Linux linux_base-8-8.0_4 Base set of packages needed in Linux mode (only for i386) linux_devtools-8.0_1 Packages needed for doing development in Linux mode libtool-1.3.5_1 Generic shared library support script gmake-3.80_1 GNU version of 'make' utility automake-1.4.5_9 GNU Standards-compliant Makefile generator (legacy version GCC 2.95.4 gdb 4.18 ld 2.12.1 supported emulation elf_i386 I am awaiting your valuable suggestions. Thanks in advance. Regards, Mangesh