From owner-freebsd-amd64@FreeBSD.ORG Tue Dec 14 23:15:46 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18B5916A4CE; Tue, 14 Dec 2004 23:15:46 +0000 (GMT) Received: from mail.mcneil.com (mcneil.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id B593E43D55; Tue, 14 Dec 2004 23:15:45 +0000 (GMT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id 6ED31F1A61; Tue, 14 Dec 2004 15:15:43 -0800 (PST) Received: from mail.mcneil.com ([127.0.0.1]) by localhost (server.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00738-03; Tue, 14 Dec 2004 15:15:41 -0800 (PST) Received: from mcneil.com (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id 749ABF1802; Tue, 14 Dec 2004 15:15:41 -0800 (PST) From: Sean McNeil To: Ruslan Ermilov In-Reply-To: <1103062382.46568.1.camel@server.mcneil.com> References: <20041214182153.GA80721@ip.net.ua> <1103049246.21655.3.camel@server.mcneil.com> <20041214215415.GB29362@ip.net.ua> <1103062382.46568.1.camel@server.mcneil.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-v3ZzuzRGf8/ffyt2eNTj" Date: Tue, 14 Dec 2004 15:15:41 -0800 Message-Id: <1103066141.2041.4.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 FreeBSD GNOME Team Port X-Virus-Scanned: by amavisd-new at mcneil.com cc: amd64@FreeBSD.org cc: David O'Brien Subject: Re: ports/emulators/linux_base on amd64 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2004 23:15:46 -0000 --=-v3ZzuzRGf8/ffyt2eNTj Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2004-12-14 at 14:13 -0800, Sean McNeil wrote: > On Tue, 2004-12-14 at 23:54 +0200, Ruslan Ermilov wrote: > > On Tue, Dec 14, 2004 at 10:34:06AM -0800, Sean McNeil wrote: > > [...] > > > rpm scripts should also be fixed. It seems like a bug in the rpm por= t > > > that no one has addressed. > > >=20 > > rpm port is not guilty -- running the postinstall script > > manually on amd64 returns 1, but on i386 it returns 0: > >=20 > > Script started on Tue Dec 14 23:10:31 2004 > > hammer# /compat/linux/bin/sh > > sh-2.04# uname -srm > > Linux 2.4.2 amd64 > > sh-2.04# /usr/sbin/glibc_post_upgrade=20 > > sh-2.04# echo $? > > 1 > > Script done on Tue Dec 14 23:10:53 2004 >=20 > Yes, I just got to this point. Thanks for the confirmation. I'm trying > to find sources to glibc_post_upgrade to take a look. Here is what I have so far.... The source looks like this: #ifdef ARCH_386 /* Work around rpm bug */ char *remove_file[] =3D { "/lib/i686/libc-" VERSION ".so", "/lib/i686/libm-" VERSION ".so", "/lib/i686/libpthread-" PVERSION ".so", "/lib/i686/libc.so.6", "/lib/i686/libm.so.6", "/lib/i686/libpthread.so.0", NULL }; int i; for (i =3D 0; remove_file[i]; i++) unlink (remove_file[i]); #endif pid =3D vfork (); if (pid =3D=3D 0) { execl ("/sbin/ldconfig", "/sbin/ldconfig", NULL); _exit (1); } else if (pid < 0) { _exit (1); } if (waitpid (0, &status, 0) !=3D pid || !WIFEXITED (status)) { _exit (1); } if (WEXITSTATUS (status)) _exit (WEXITSTATUS (status)); ktrace shows: 2018 ktrace RET ktrace 0 2018 ktrace CALL execve(0x7fffffffee0f,0x7fffffffec60,0x7fffffffec70) 2018 ktrace NAMI "/compat/linux/usr/sbin/glibc_post_upgrade" 2018 glibc_post_upgrade RET execve 0 2018 glibc_post_upgrade CALL unlink(0x8048788) 2018 glibc_post_upgrade NAMI "/compat/linux/lib/i686/libc-2.2.4.so" 2018 glibc_post_upgrade NAMI "/lib/i686/libc-2.2.4.so" 2018 glibc_post_upgrade RET unlink JUSTRETURN 2018 glibc_post_upgrade CALL unlink(0x80487a0) 2018 glibc_post_upgrade NAMI "/compat/linux/lib/i686/libm-2.2.4.so" 2018 glibc_post_upgrade NAMI "/lib/i686/libm-2.2.4.so" 2018 glibc_post_upgrade RET unlink JUSTRETURN 2018 glibc_post_upgrade CALL unlink(0x80487b8) 2018 glibc_post_upgrade NAMI "/compat/linux/lib/i686/libpthread-0.9.so" 2018 glibc_post_upgrade NAMI "/lib/i686/libpthread-0.9.so" 2018 glibc_post_upgrade RET unlink JUSTRETURN 2018 glibc_post_upgrade CALL unlink(0x80487d4) 2018 glibc_post_upgrade NAMI "/compat/linux/lib/i686/libc.so.6" 2018 glibc_post_upgrade NAMI "/lib/i686/libc.so.6" 2018 glibc_post_upgrade RET unlink JUSTRETURN 2018 glibc_post_upgrade CALL unlink(0x80487e8) 2018 glibc_post_upgrade NAMI "/compat/linux/lib/i686/libm.so.6" 2018 glibc_post_upgrade NAMI "/lib/i686/libm.so.6" 2018 glibc_post_upgrade RET unlink JUSTRETURN 2018 glibc_post_upgrade CALL unlink(0x80487fc) 2018 glibc_post_upgrade NAMI "/compat/linux/lib/i686/libpthread.so.0" 2018 glibc_post_upgrade NAMI "/lib/i686/libpthread.so.0" 2018 glibc_post_upgrade RET unlink JUSTRETURN 2018 glibc_post_upgrade CALL lstat 2018 glibc_post_upgrade RET lstat 2019/0x7e3 2018 glibc_post_upgrade CALL old.sendmsg(0,0xffffdb8c,0,0) 2018 glibc_post_upgrade RET old.sendmsg 2019/0x7e3 2018 glibc_post_upgrade CALL exit(0x1) Looks like there is a mismatch in kernel entry points here. lstat instead of vfork and old.sendmsg instead of (maybe) waitpid. Does ktrace work with linux abi? --=-v3ZzuzRGf8/ffyt2eNTj Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBv3QdyQsGN30uGE4RAvT5AJ9JgjIGREG9xAmrUXHKXgRp33i9RACePwZw pbDTkIB4Xws/C62xm4tw0yI= =Jfar -----END PGP SIGNATURE----- --=-v3ZzuzRGf8/ffyt2eNTj--