From owner-freebsd-hackers Wed Aug 7 23:43:07 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA14969 for hackers-outgoing; Wed, 7 Aug 1996 23:43:07 -0700 (PDT) Received: from ra.dkuug.dk (ra.dkuug.dk [193.88.44.193]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id XAA14964 for ; Wed, 7 Aug 1996 23:43:05 -0700 (PDT) Received: (from sos@localhost) by ra.dkuug.dk (8.6.12/8.6.12) id IAA01368; Thu, 8 Aug 1996 08:42:58 +0200 Message-Id: <199608080642.IAA01368@ra.dkuug.dk> Subject: Re: running linux-elf matlab To: bartol@salk.edu (Tom Bartol) Date: Thu, 8 Aug 1996 08:42:58 +0200 (MET DST) Cc: hackers@FreeBSD.org In-Reply-To: from "Tom Bartol" at Aug 7, 96 03:39:08 pm From: sos@FreeBSD.org Reply-to: sos@FreeBSD.org X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk In reply to Tom Bartol who wrote: [snip snap] > > I also added /lib/elf to /compat/linux/etc/ld.so.conf and rehashed > ld.so.cache with ldconfig as per the section of the FreeBSD handbook on > linux compat. Now, one would hope that matlab would run but here's what > results when I try: > > /usr/local/pkgs/matlab-4.2c/bin/lnx86/matlab > ELF interpreter /lib/elf/ld-linux.so.1 not known > Abort > > and > > /compat/linux/usr/bin/ldd /usr/local/pkgs/matlab-4.2c/bin/lnx86/matlab > ELF interpreter /lib/elf/ld-linux.so.1 not known The problem here is that the ELF loader looks in a certain location for the ELF interpreter. This is the most annoying problem with Linux, they can't get a grip on where to put files, its a nightmare to keep track of all the different places to look :( :( However when one KNOWS where to look its easy fixable: The patch is for -current, so you shouldn't have any troubles with that, let me know if you get any further, it would be nice to have matlab running... *** sys/i386/linux/linux_sysvec.c.ORG Thu Jun 20 04:38:08 1996 --- sys/i386/linux/linux_sysvec.c Wed Aug 7 23:30:57 1996 *************** *** 409,414 **** --- 409,419 ---- "/lib/ld-linux.so.1", "/compat/linux" }; + Elf32_Interp_info linux_interp_old = { + &elf_linux_sysvec, + "/lib/elf/ld-linux.so.1", + "/compat/linux" + }; #ifndef LKM /* *** lkm/linux/linux.c.ORG Wed Aug 7 23:34:44 1996 --- lkm/linux/linux.c Wed Aug 7 23:34:35 1996 *************** *** 42,53 **** --- 42,56 ---- MOD_EXEC(linux, -1, (struct execsw*)&linux_execsw); extern Elf32_Interp_info linux_interp; + extern Elf32_Interp_info linux_interp_old; static int linux_load(struct lkm_table *lkmtp, int cmd) { if (elf_insert_interp(&linux_interp)) uprintf("Could not install ELF interpreter entry\n"); + if (elf_insert_interp(&linux_interp_old)) + uprintf("Could not install ELF interpreter entry\n"); uprintf("Linux emulator installed\n"); return 0; } *************** *** 56,61 **** --- 59,66 ---- linux_unload(struct lkm_table *lkmtp, int cmd) { if (elf_remove_interp(&linux_interp)) + uprintf("Could not deinstall ELF interpreter entry\n"); + if (elf_remove_interp(&linux_interp_old)) uprintf("Could not deinstall ELF interpreter entry\n"); uprintf("Linux emulator removed\n"); return 0; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Soren Schmidt (sos@FreeBSD.org) FreeBSD Core Team So much code to hack -- so little time.