From owner-freebsd-sparc Thu Jan 2 6:41:10 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3588037B401 for ; Thu, 2 Jan 2003 06:41:09 -0800 (PST) Received: from cc-gw.1anetworks.net (cc-gw.1anetworks.net [193.243.179.83]) by mx1.FreeBSD.org (Postfix) with SMTP id 178FC43EB2 for ; Thu, 2 Jan 2003 06:41:08 -0800 (PST) (envelope-from brian@ukip.com) Received: from BRI (brian.1anetworks.net [212.36.98.200]) by parma.1anetworks.net (8.9.3+Sun/8.9.3) with SMTP id OAA23394; Thu, 2 Jan 2003 14:41:00 GMT From: "Bri" To: "Oliver Blasnik" , Subject: RE: hme errors Date: Thu, 2 Jan 2003 14:35:15 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <003901c2a8db$0477f5f0$2100a8c0@xpath1000> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org yeah I've had some over Christmas Dec 23 18:22:53 lighthouse kernel: hme0: error signaled, status=0x30001 Dec 23 18:22:53 lighthouse kernel: hme0: error signaled, status=0x30001 Dec 27 17:37:55 lighthouse kernel: hme0: error signaled, status=0x30001 Dec 27 17:37:55 lighthouse kernel: hme0: too may errors; not reporting any more Bri, -----Original Message----- From: owner-freebsd-sparc@FreeBSD.ORG [mailto:owner-freebsd-sparc@FreeBSD.ORG]On Behalf Of Oliver Blasnik Sent: 21 December 2002 10:23 To: Kris Kennaway; sparc@FreeBSD.ORG Subject: Re: hme errors Hi Kris, > I get a lot of hme errors on the sparc64 cluster machines: > hme0: error signaled, status=0x10021 > hme0: error signaled, status=0x10021 > hme0: error signaled, status=0x10021 > hme0: error signaled, status=0x3000400 > ... 0021 is a RX FIFO OVERFLOW, and 0400 is a MAX PACKET SIZE ERROR. First could (but should not, huh?!) happen if the data was received too fast and the driver did not get them, so packets were lost at hardware level. Latter should never happen and possibly needs investigation, as this is a transmission error (while sending). > What are these about? > Kris Good that you did not ask why they happen :P xmas wishes, Oliver To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Thu Jan 2 8:49:59 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8009437B406 for ; Thu, 2 Jan 2003 08:49:58 -0800 (PST) Received: from PIKES.panasas.com (gw2.panasas.com [65.194.124.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id E179843EC5 for ; Thu, 2 Jan 2003 08:49:53 -0800 (PST) (envelope-from chris@pennasoft.com) Received: from waumbek ([172.17.2.36]) by PIKES.panasas.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id XA31NN8A; Thu, 2 Jan 2003 11:49:52 -0500 Content-Type: text/plain; charset="us-ascii" From: Chris BeHanna Reply-To: chris@pennasoft.com Organization: PennaSoft Corporation To: sparc64@freebsd.org Subject: filesystem endian converter? Date: Thu, 2 Jan 2003 11:49:52 -0500 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200301021149.52369.chris@pennasoft.com> Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Are there any tools to convert a filesystem created on a little-endian machine for use on a big-endian machine, or vice-versa? Can FreeBSD/sparc64 mount Solaris 8 UFS partitions, even if only in read-only mode? (For that matter, anyone know if FreeBSD/x86 can mount Solaris 8 x86 UFS partitions, even if only in read-only mode? I'm trying to help out a co-worker whose Solaris 8 x86 box crashed. His new machine is going to be FreeBSD 4.7, but he has two disks full of data to recover.) Thanks, --=20 Chris BeHanna http://www.pennasoft.com=20 Principal Consultant =20 PennaSoft Corporation =20 chris@pennasoft.com =20 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Thu Jan 2 11:27: 9 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 605C737B487 for ; Thu, 2 Jan 2003 11:27:04 -0800 (PST) Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5E6643EC5 for ; Thu, 2 Jan 2003 11:27:03 -0800 (PST) (envelope-from jake@k6.locore.ca) Received: from k6.locore.ca (jake@localhost.locore.ca [127.0.0.1]) by k6.locore.ca (8.12.6/8.12.6) with ESMTP id h02JjRuP076533; Thu, 2 Jan 2003 14:45:27 -0500 (EST) (envelope-from jake@k6.locore.ca) Received: (from jake@localhost) by k6.locore.ca (8.12.6/8.12.6/Submit) id h02JjRlZ076532; Thu, 2 Jan 2003 14:45:27 -0500 (EST) Date: Thu, 2 Jan 2003 14:45:27 -0500 From: Jake Burkholder To: Chris BeHanna Cc: sparc64@FreeBSD.ORG Subject: Re: filesystem endian converter? Message-ID: <20030102144527.X43538@locore.ca> References: <200301021149.52369.chris@pennasoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200301021149.52369.chris@pennasoft.com>; from chris@pennasoft.com on Thu, Jan 02, 2003 at 11:49:52AM -0500 Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Apparently, On Thu, Jan 02, 2003 at 11:49:52AM -0500, Chris BeHanna said words to the effect of; > Are there any tools to convert a filesystem created on a > little-endian machine for use on a big-endian machine, or vice-versa? Ian Dowse (iedowse@freebsd.org) wrote a program to do this on a file backed memory file system. I don't know how well it would work on a large filesystem or in place on disk though. > > Can FreeBSD/sparc64 mount Solaris 8 UFS partitions, even if only > in read-only mode? This should work, at least it used to, but you have to be really careful about fscking solaris filesystem with freebsd fsck and vice versa. Read only is the only thing that's really safe. > > (For that matter, anyone know if FreeBSD/x86 can mount Solaris 8 > x86 UFS partitions, even if only in read-only mode? I'm trying to > help out a co-worker whose Solaris 8 x86 box crashed. His new machine > is going to be FreeBSD 4.7, but he has two disks full of data to > recover.) Don't know. Since freebsd/sparc64 can (or could) read big endian solaris filesystems, I don't see why not. Jake To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 4: 1: 8 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 358BF37B406; Fri, 3 Jan 2003 04:01:05 -0800 (PST) Received: from amun.isnic.is (amun.isnic.is [193.4.58.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id D788243E4A; Fri, 3 Jan 2003 04:01:02 -0800 (PST) (envelope-from oli@amun.isnic.is) Received: from amun.isnic.is (oli@localhost [127.0.0.1]) by amun.isnic.is (8.12.3/8.12.3/isnic) with ESMTP id h03C0vmV008088; Fri, 3 Jan 2003 12:00:57 GMT (envelope-from oli@amun.isnic.is) Received: (from oli@localhost) by amun.isnic.is (8.12.3/8.12.3/Submit) id h03C0vZL008087; Fri, 3 Jan 2003 12:00:57 GMT (envelope-from oli) Date: Fri, 3 Jan 2003 12:00:57 +0000 From: Olafur Osvaldsson To: freebsd-hackers@freebsd.org Cc: freebsd-sparc@freebsd.org Subject: Locale errors on 5.0-CURRENT (sparc) Message-ID: <20030103120057.GI74128@isnic.is> Mail-Followup-To: freebsd-hackers@freebsd.org, freebsd-sparc@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.28i X-Spam-Status: No, hits=-1.2 required=5.0 tests=SPAM_PHRASE_01_02,USER_AGENT,USER_AGENT_MUTT version=2.43-isnic Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I'm having some problems with seting the locale on 5.0 wich I have set up on sparc hardware...I'm pretty sure this is not sparc related but if so please correct me. On all my intel machines (4.*) I set the lang and locale by adding the following to the default section in /etc/login.conf: :charset=ISO-8859-1:\ :lang=is_IS.ISO_8859-1:\ and adding "LC_ALL=is_IS.ISO8859-1" to the setenv line. This seems to have no effect on the 5.0 system as I get locale errors when running any locale dependant programs... When running man I get: ctype locale: Invalid argument When running perl I get: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LC_ALL = "is_IS.ISO8859-1", LANG = "is_IS.ISO8859-1" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). So I made a simple program to see if I could set the locale to what I wanted. ================================================= #include #include main(argc, argv) int argc; char *argv[]; { printf("setlocale(LC_ALL, \"%s\") returns: %s\n",argv[1],setlocale(LC_ALL, argv[1])); printf("setlocale(LC_TIME, \"%s\") returns: %s\n",argv[1],setlocale(LC_TIME, argv[1])); printf("Testing: [áíóðþæö]\n"); return 0; } ================================================= When run on the 5.0 system: # ./locale-test is_IS.ISO8859-1 setlocale(LC_ALL, "is_IS.ISO8859-1") returns: (null) setlocale(LC_TIME, "is_IS.ISO8859-1") returns: is_IS.ISO8859-1 Testing: [áíóðþæö] But when run on a 4.7-STABLE system it goes like this: # ./locale-test is_IS.ISO8859-1 setlocale(LC_ALL, "is_IS.ISO8859-1") returns: is_IS.ISO8859-1 setlocale(LC_TIME, "is_IS.ISO8859-1") returns: is_IS.ISO8859-1 Testing: [áíóðþæö] The is_IS.ISO8859-1 locale is the same on both systems and I get the same error when trying to set en_US.ISO8859-1 but if I try C it works fine on the 5.0 system: # ./locale-test C setlocale(LC_ALL, "C") returns: C setlocale(LC_TIME, "C") returns: C Testing: [áíóðþæö] I think there is some problem there but I don't have a free intel system to test if 5.0 behaves the same there as on the sparc system. I hope this all makes sense to someone else than just me. /Oli -- Olafur Osvaldsson Systems Administrator Internet a Islandi hf. Tel: +354 525-5291 Email: oli@isnic.is To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 4:32:23 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 565E137B405 for ; Fri, 3 Jan 2003 04:32:22 -0800 (PST) Received: from straylight.ringlet.net (office.sbnd.net [217.75.140.130]) by mx1.FreeBSD.org (Postfix) with SMTP id D94EF43EE6 for ; Fri, 3 Jan 2003 04:32:15 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 51577 invoked by uid 1000); 3 Jan 2003 12:31:42 -0000 Date: Fri, 3 Jan 2003 14:31:41 +0200 From: Peter Pentchev To: Olafur Osvaldsson Cc: freebsd-hackers@freebsd.org, freebsd-sparc@freebsd.org Subject: Re: Locale errors on 5.0-CURRENT (sparc) Message-ID: <20030103123141.GA45645@straylight.oblivion.bg> Mail-Followup-To: Olafur Osvaldsson , freebsd-hackers@freebsd.org, freebsd-sparc@freebsd.org References: <20030103120057.GI74128@isnic.is> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: <20030103120057.GI74128@isnic.is> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 03, 2003 at 12:00:57PM +0000, Olafur Osvaldsson wrote: > Hi, > I'm having some problems with seting the locale on 5.0 wich I have set > up on sparc hardware...I'm pretty sure this is not sparc related but if > so please correct me. [snip] >=20 > When run on the 5.0 system: >=20 > # ./locale-test is_IS.ISO8859-1 > setlocale(LC_ALL, "is_IS.ISO8859-1") returns: (null) > setlocale(LC_TIME, "is_IS.ISO8859-1") returns: is_IS.ISO8859-1 > Testing: [???????] FWIW, I can reproduce this on panther.FreeBSD.org, a sparc64 running 5.0-CURRENT as of December 6, 2001. All the other machines in the FreeBSD cluster that I could test - ref5 (i386), pluto1 (IA-64), and beast (alpha) - are able to set both the is_IS.ISO8859-1 and the bg_BG.CP1251 locales correctly for both LC_ALL and LC_TIME. Only the sparc64 machine is having trouble setting LC_ALL for any locale I tried. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence would be seven words long if it were six words shorter. --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+FYKt7Ri2jRYZRVMRAuiVAJwJPK4XDZ1LxYfsVjM+By/G9qfKUwCgpTfs /SreBmEUF4igxQ7dVoa9z38= =g/Zf -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 4:57:19 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 125E237B401 for ; Fri, 3 Jan 2003 04:57:19 -0800 (PST) Received: from libra.cs.put.poznan.pl (libra.cs.put.poznan.pl [150.254.30.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 176B243EB2 for ; Fri, 3 Jan 2003 04:57:13 -0800 (PST) (envelope-from piotr.wozniak@cs.put.poznan.pl) Received: from libra.cs.put.poznan.pl (localhost [127.0.0.1]) by libra (Postfix on VMS) with SMTP id B17E75A for ; Fri, 3 Jan 2003 13:56:57 +0100 (CET) Received: from dcs-pw (dcs-pw.cs.put.poznan.pl [150.254.31.188]) by libra.cs.put.poznan.pl (Postfix on VMS) with ESMTP id 768714B for ; Fri, 3 Jan 2003 13:56:57 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2; format=flowed To: freebsd-sparc@freebsd.org Subject: terminal types - 5.0-RC2 install From: =?iso-8859-2?B?UGlvdHIgV2+8bmlhaw==?= Organization: PUT Date: Fri, 03 Jan 2003 13:59:56 +0100 Message-ID: User-Agent: Opera M2 7.0 build 2349 Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I'm installing FreeBSD on Ultra5.. What type of terminal (in the beginning of installation) should I choise not to get rubbish on the screen? Piotr -- Piotr Wo¼niak Instytut Informatyki PP ul.Piotrowo 3A, 60-965 Poznan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 5:30: 8 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A72F37B420 for ; Fri, 3 Jan 2003 05:30:06 -0800 (PST) Received: from straylight.ringlet.net (office.sbnd.net [217.75.140.130]) by mx1.FreeBSD.org (Postfix) with SMTP id 9FA7C43EE5 for ; Fri, 3 Jan 2003 05:30:01 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 51972 invoked by uid 1000); 3 Jan 2003 13:29:27 -0000 Date: Fri, 3 Jan 2003 15:29:27 +0200 From: Peter Pentchev To: Olafur Osvaldsson Cc: David O'Brien , freebsd-hackers@freebsd.org, freebsd-sparc@freebsd.org Subject: Re: Locale errors on 5.0-CURRENT (sparc) Message-ID: <20030103132927.GC45645@straylight.oblivion.bg> Mail-Followup-To: Olafur Osvaldsson , David O'Brien , freebsd-hackers@freebsd.org, freebsd-sparc@freebsd.org References: <20030103120057.GI74128@isnic.is> <20030103123141.GA45645@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZwgA9U+XZDXt4+m+" Content-Disposition: inline In-Reply-To: <20030103123141.GA45645@straylight.oblivion.bg> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --ZwgA9U+XZDXt4+m+ Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 03, 2003 at 02:31:41PM +0200, Peter Pentchev wrote: > On Fri, Jan 03, 2003 at 12:00:57PM +0000, Olafur Osvaldsson wrote: > > Hi, > > I'm having some problems with seting the locale on 5.0 wich I have set > > up on sparc hardware...I'm pretty sure this is not sparc related but if > > so please correct me. > [snip] > >=20 > > When run on the 5.0 system: > >=20 > > # ./locale-test is_IS.ISO8859-1 > > setlocale(LC_ALL, "is_IS.ISO8859-1") returns: (null) > > setlocale(LC_TIME, "is_IS.ISO8859-1") returns: is_IS.ISO8859-1 > > Testing: [???????] >=20 > FWIW, I can reproduce this on panther.FreeBSD.org, a sparc64 running > 5.0-CURRENT as of December 6, 2001. All the other machines in the > FreeBSD cluster that I could test - ref5 (i386), pluto1 (IA-64), and > beast (alpha) - are able to set both the is_IS.ISO8859-1 and the > bg_BG.CP1251 locales correctly for both LC_ALL and LC_TIME. Only the > sparc64 machine is having trouble setting LC_ALL for any locale I tried. Actually, I seem to have found the reason: on panther.FreeBSD.org, there are no LC_CTYPE files for any locale, and setlocale(LC_ALL) attempts to load, well, *all* locale type definitions, including LC_CTYPE. Thus, it would (and does) return NULL with errno set to ENOENT for all locales... The LC_CTYPE files are not there, because there is an explicit test for the build architecture in src/share/Makefile, which excludes the mklocale directory for sparc64; it was introduced in rev. 1.27 by David O'Brien about 7 months ago. David, what exactly was the 'bad juju' mentioned in the commit message, and is it still there? A test run of 'cvs up share/mklocale && cd share/mklocale && make' on panther seemed to complete OK; I have not yet tested the resulting locale files though. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence claims to be an Epimenides paradox, but it is lying. --ZwgA9U+XZDXt4+m+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+FZA37Ri2jRYZRVMRAuZ6AJ0epcTsl2CXOT8FboOd8pB7rcKSEACeOLuM AZyNgukAapIxuh/kjuK8IXY= =4P70 -----END PGP SIGNATURE----- --ZwgA9U+XZDXt4+m+-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 6:50: 6 2003 Delivered-To: freebsd-sparc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1AA5F37B401 for ; Fri, 3 Jan 2003 06:50:04 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9CD2C43EE5 for ; Fri, 3 Jan 2003 06:50:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h03Eo2NS064132 for ; Fri, 3 Jan 2003 06:50:02 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h03Eo2Q5064131; Fri, 3 Jan 2003 06:50:02 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 62FF737B401 for ; Fri, 3 Jan 2003 06:41:17 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D41A43EC2 for ; Fri, 3 Jan 2003 06:41:16 -0800 (PST) (envelope-from hbb@catssrv.fokus.gmd.de) Received: from catssrv.fokus.gmd.de (catssrv [192.168.229.23]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id h03EfEJ10726 for ; Fri, 3 Jan 2003 15:41:14 +0100 (MET) Received: from catssrv.fokus.gmd.de (localhost [127.0.0.1]) by catssrv.fokus.gmd.de (8.12.6/8.12.6) with ESMTP id h03EfEx5003599 for ; Fri, 3 Jan 2003 15:41:14 +0100 (CET) (envelope-from hbb@catssrv.fokus.gmd.de) Received: (from hbb@localhost) by catssrv.fokus.gmd.de (8.12.6/8.12.6/Submit) id h03EfD4t003598; Fri, 3 Jan 2003 15:41:13 +0100 (CET) (envelope-from hbb) Message-Id: <200301031441.h03EfD4t003598@catssrv.fokus.gmd.de> Date: Fri, 3 Jan 2003 15:41:13 +0100 (CET) From: Hartmut Brandt Reply-To: Hartmut Brandt To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: sparc64/46729: gethostbyname fails for NIS Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46729 >Category: sparc64 >Synopsis: gethostbyname fails for NIS >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-sparc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 03 06:50:01 PST 2003 >Closed-Date: >Last-Modified: >Originator: Hartmut Brandt >Release: FreeBSD 5.0-CURRENT sparc64 >Organization: FhI Fokus >Environment: System: FreeBSD catssrv.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #20: Fri Jan 3 14:08:11 CET 2003 hbb@catssrv.fokus.gmd.de:/opt/obj/usr/src/sys/CATSSRV sparc64 >Description: /usr/src/lib/libc/net/gethostbynis.c assumes, that an AF_INET address is the same as an u_long. This is abviously false and leads to the effect, that all IP addresses obtained via NIS are 0.0.0.0. >How-To-Repeat: Execute ping host-with-name-via-nis and observe that ping is able to resolve the name, but the printed address is 0.0.0.0. >Fix: Apply the following patch and recompile and install libc: Index: gethostbynis.c =================================================================== RCS file: /usr/ncvs/src/lib/libc/net/gethostbynis.c,v retrieving revision 1.15 diff -c -r1.15 gethostbynis.c *** gethostbynis.c 22 Mar 2002 21:52:29 -0000 1.15 --- gethostbynis.c 3 Jan 2003 14:31:16 -0000 *************** *** 67,72 **** --- 67,73 ---- static struct hostent h; static char *domain = (char *)NULL; static char ypbuf[YPMAXRECORD + 2]; + in_addr_t addr; switch(af) { case AF_INET: *************** *** 104,110 **** *cp++ = '\0'; h.h_addr_list = host_addrs; h.h_addr = hostaddr; ! *((u_long *)h.h_addr) = inet_addr(result); h.h_length = size; h.h_addrtype = AF_INET; while (*cp == ' ' || *cp == '\t') --- 105,112 ---- *cp++ = '\0'; h.h_addr_list = host_addrs; h.h_addr = hostaddr; ! addr = inet_addr(result); ! bcopy((char *)&addr, h.h_addr, size); h.h_length = size; h.h_addrtype = AF_INET; while (*cp == ' ' || *cp == '\t') >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 6:53:40 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C8D8237B401; Fri, 3 Jan 2003 06:53:38 -0800 (PST) Received: from amun.isnic.is (amun.isnic.is [193.4.58.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E65CC43EA9; Fri, 3 Jan 2003 06:53:37 -0800 (PST) (envelope-from oli@amun.isnic.is) Received: from amun.isnic.is (oli@localhost [127.0.0.1]) by amun.isnic.is (8.12.3/8.12.3/isnic) with ESMTP id h03ErWmV011887; Fri, 3 Jan 2003 14:53:33 GMT (envelope-from oli@amun.isnic.is) Received: (from oli@localhost) by amun.isnic.is (8.12.3/8.12.3/Submit) id h03ErWoS011886; Fri, 3 Jan 2003 14:53:32 GMT (envelope-from oli) Date: Fri, 3 Jan 2003 14:53:32 +0000 From: Olafur Osvaldsson To: Peter Pentchev Cc: "David O'Brien" , freebsd-hackers@FreeBSD.ORG, freebsd-sparc@FreeBSD.ORG Subject: Re: Locale errors on 5.0-CURRENT (sparc) Message-ID: <20030103145332.GN74128@isnic.is> Mail-Followup-To: Peter Pentchev , David O'Brien , freebsd-hackers@FreeBSD.ORG, freebsd-sparc@FreeBSD.ORG References: <20030103120057.GI74128@isnic.is> <20030103123141.GA45645@straylight.oblivion.bg> <20030103132927.GC45645@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Content-Disposition: inline In-Reply-To: <20030103132927.GC45645@straylight.oblivion.bg> User-Agent: Mutt/1.3.28i X-Spam-Status: No, hits=-3.7 required=5.0 tests=IN_REP_TO,PGP_SIGNATURE_2,QUOTED_EMAIL_TEXT,REFERENCES, SPAM_PHRASE_02_03,USER_AGENT,USER_AGENT_MUTT version=2.43-isnic Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Removing the exclude for sparc64 in src/share/Makefile rebuilding/installing fixes this for me and I see nothing wrong with the is_IS.ISO8859-1 locale so far. Unless there is some real reason for excluding it I suggest that the sparc64 test is removed from that file. /Oli On Fri, 03 Jan 2003, Peter Pentchev wrote: > The LC_CTYPE files are not there, because there is an explicit test for > the build architecture in src/share/Makefile, which excludes the > mklocale directory for sparc64; it was introduced in rev. 1.27 by David > O'Brien about 7 months ago. David, what exactly was the 'bad juju' > mentioned in the commit message, and is it still there? A test run of > 'cvs up share/mklocale && cd share/mklocale && make' on panther seemed > to complete OK; I have not yet tested the resulting locale files though. --=20 Olafur Osvaldsson Systems Administrator Internet a Islandi hf. Tel: +354 525-5291 Email: oli@isnic.is --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+FaPs8xNRBRknOFwRAlEvAJ9qlz9FIbHeEwaDm58CD/+v9gZfmQCfTPmA 54SAxrn3pNELpuyugB7sDXs= =vLJg -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 7:10:11 2003 Delivered-To: freebsd-sparc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A49C37B401 for ; Fri, 3 Jan 2003 07:10:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6185143ED8 for ; Fri, 3 Jan 2003 07:10:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h03FA1NS020981 for ; Fri, 3 Jan 2003 07:10:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h03FA1Rp020980; Fri, 3 Jan 2003 07:10:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBB2337B401 for ; Fri, 3 Jan 2003 07:09:39 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC2A643EC5 for ; Fri, 3 Jan 2003 07:09:38 -0800 (PST) (envelope-from hbb@catssrv.fokus.gmd.de) Received: from catssrv.fokus.gmd.de (catssrv [192.168.229.23]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id h03F9bJ13266 for ; Fri, 3 Jan 2003 16:09:37 +0100 (MET) Received: from catssrv.fokus.gmd.de (localhost [127.0.0.1]) by catssrv.fokus.gmd.de (8.12.6/8.12.6) with ESMTP id h03F9bx5003758 for ; Fri, 3 Jan 2003 16:09:37 +0100 (CET) (envelope-from hbb@catssrv.fokus.gmd.de) Received: (from hbb@localhost) by catssrv.fokus.gmd.de (8.12.6/8.12.6/Submit) id h03F9bmD003757; Fri, 3 Jan 2003 16:09:37 +0100 (CET) (envelope-from hbb) Message-Id: <200301031509.h03F9bmD003757@catssrv.fokus.gmd.de> Date: Fri, 3 Jan 2003 16:09:37 +0100 (CET) From: Hartmut Brandt Reply-To: Hartmut Brandt To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: sparc64/46730: kldxref does not work Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46730 >Category: sparc64 >Synopsis: kldxref does not work >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-sparc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 03 07:10:00 PST 2003 >Closed-Date: >Last-Modified: >Originator: Hartmut Brandt >Release: FreeBSD 5.0-CURRENT sparc64 >Organization: FhI Fokus >Environment: System: FreeBSD catssrv.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #20: Fri Jan 3 14:08:11 CET 2003 hbb@catssrv.fokus.gmd.de:/opt/obj/usr/src/sys/CATSSRV sparc64 >Description: kldxref fails to correctly read most kld files. The reason for this is that kldxref assumes, that the ELF file containes only REL relocation records and that only RELATIVE relocations need to be performed to read the module meta data. If these two assumptions are true, effectively no relocation has to be performed, because the module's load address is 0 in kldxref's case. For sparc64 the first assumptions is certainly false, because sparc64 uses only RELA relocation records. Because of the missing relocation in this case, the code tries to access 0 offsets in the file. >How-To-Repeat: Execute kldxref /boot/kernel and watch the error messages. >Fix: The following patch fixes the problem in the following way: 1. It reads the REL and RELA relocation records. 2. At the places where pointers are accessed in the object file two additional routines are called that look whether relocation records exist for the object file part that is to be red. If there are it applies the relocations. The patch currently handles REL records of type R_I386_RELATIVE and RELA records of type R_SPARC_RELATIVE. Alle other combinations result in a warning message. This means that alpha and ia64 user will probably see warning messages. This can be overcome by either adding the corresponding alpha and ia64 relocation types (R_ALPHA_RELATIVE and R_IA64_REL64LSB (I suppose)) or removing the warning message itself. The entire handling of REL records could be removed, because it effectively is a NOP a.t.m. I suggest leaving it, because if in the future other relocation types refer to the file offsets in question, we will get a warning message. Index: ef.c =================================================================== RCS file: /usr/ncvs/src/usr.sbin/kldxref/ef.c,v retrieving revision 1.5 diff -c -r1.5 ef.c *** ef.c 17 Jul 2002 23:41:58 -0000 1.5 --- ef.c 3 Jan 2003 14:56:09 -0000 *************** *** 151,157 **** --- 151,166 ---- Elf_Hashelt hashhdr[2]; /* int plttype = DT_REL;*/ int error; + Elf_Off rel_off; + Elf_Off rela_off; + int rel_sz; + int rela_sz; + int rel_entry; + int rela_entry; + rel_off = rela_off = 0; + rel_sz = rela_sz = 0; + rel_entry = rela_entry = 0; for (dp = ef->ef_dyn; dp->d_tag != DT_NULL; dp++) { switch (dp->d_tag) { case DT_HASH: *************** *** 187,192 **** --- 196,231 ---- if (dp->d_un.d_val != sizeof(Elf_Sym)) return EFTYPE; break; + case DT_REL: + if (rel_off != 0) + warnx("second DT_REL entry ignored"); + rel_off = dp->d_un.d_ptr; + break; + case DT_RELSZ: + if (rel_sz != 0) + warnx("second DT_RELSZ entry ignored"); + rel_sz = dp->d_un.d_val; + break; + case DT_RELENT: + if (rel_entry != 0) + warnx("second DT_RELENT entry ignored"); + rel_entry = dp->d_un.d_val; + break; + case DT_RELA: + if (rela_off != 0) + warnx("second DT_RELA entry ignored"); + rela_off = dp->d_un.d_ptr; + break; + case DT_RELASZ: + if (rela_sz != 0) + warnx("second DT_RELASZ entry ignored"); + rela_sz = dp->d_un.d_val; + break; + case DT_RELAENT: + if (rela_entry != 0) + warnx("second DT_RELAENT entry ignored"); + rela_entry = dp->d_un.d_val; + break; } } if (ef->ef_symoff == 0) { *************** *** 210,218 **** --- 249,360 ---- warnx("can't load .dynstr section"); return EIO; } + if (rel_off != 0) { + if (rel_entry == 0) { + warnx("%s: no DT_RELENT for DT_REL", ef->ef_name); + return (EFTYPE); + } + if (rel_entry != sizeof(Elf_Rel)) { + warnx("%s: inconsistent DT_RELENT value", + ef->ef_name); + return (EFTYPE); + } + if (rel_sz % rel_entry != 0) { + warnx("%s: inconsistent values for DT_RELSZ and " + "DT_RELENT", ef->ef_name); + return (EFTYPE); + } + if (ef_read_entry(ef, ef_get_offset(ef, rel_off), rel_sz, + (void **)&ef->ef_rel) != 0) { + warnx("%s: cannot load DT_REL section", ef->ef_name); + return (EIO); + } + ef->ef_relsz = rel_sz / rel_entry; + if (ef->ef_verbose) + warnx("%s: %d REL entries", ef->ef_name, + ef->ef_relsz); + } + if (rela_off != 0) { + if (rela_entry == 0) { + warnx("%s: no DT_RELAENT for DT_RELA", ef->ef_name); + return (EFTYPE); + } + if (rela_entry != sizeof(Elf_Rela)) { + warnx("%s: inconsistent DT_RELAENT value", + ef->ef_name); + return (EFTYPE); + } + if (rela_sz % rela_entry != 0) { + warnx("%s: inconsistent values for DT_RELASZ and " + "DT_RELAENT", ef->ef_name); + return (EFTYPE); + } + if (ef_read_entry(ef, ef_get_offset(ef, rela_off), rela_sz, + (void **)&ef->ef_rela) != 0) { + warnx("%s: cannot load DT_RELA section", ef->ef_name); + return (EIO); + } + ef->ef_relasz = rela_sz / rela_entry; + if (ef->ef_verbose) + warnx("%s: %d RELA entries", ef->ef_name, + ef->ef_relasz); + } return 0; } + /* + * Apply relocations to the values we got from the file. + */ + static int + ef_reloc(elf_file_t ef, Elf_Off offset, size_t len, void *dest) + { + const Elf_Rel *r; + const Elf_Rela *a; + #ifdef R_SPARC_RELATIVE + Elf_Word w; + #endif + + for (r = ef->ef_rel; r < &ef->ef_rel[ef->ef_relsz]; r++) { + if (r->r_offset >= offset && r->r_offset < offset + len) { + switch (ELF_R_TYPE(r->r_info)) { + + #ifdef R_386_RELATIVE + case R_386_RELATIVE: + /* load address is 0 - nothing to do */ + break; + #endif + + default: + warnx("unhandled relocation type %u", + ELF_R_TYPE(r->r_info)); + break; + } + } + } + + for (a = ef->ef_rela; a < &ef->ef_rela[ef->ef_relasz]; a++) { + if (a->r_offset >= offset && a->r_offset < offset + len) { + switch (ELF_R_TYPE(a->r_info)) { + + #ifdef R_SPARC_RELATIVE + case R_SPARC_RELATIVE: + /* load address is 0 */ + w = a->r_addend; + memcpy((u_char *)dest + (a->r_offset - offset), + &w, sizeof(w)); + break; + #endif + + default: + warnx("unhandled relocation type %u", + ELF_R_TYPE(a->r_info)); + break; + } + } + } + return (0); + } + int ef_read(elf_file_t ef, Elf_Off offset, size_t len, void*dest) { *************** *** 259,264 **** --- 401,423 ---- } int + ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void*dest) + { + u_long ofs = ef_get_offset(ef, offset); + int error; + + if (ofs == 0) { + if (ef->ef_verbose) + warnx("ef_seg_read(%s): zero offset (%lx:%ld)", + ef->ef_name, (long)offset, ofs); + return EFAULT; + } + if ((error = ef_read(ef, ofs, len, dest)) != 0) + return (error); + return (ef_reloc(ef, offset, len, dest)); + } + + int ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void**ptr) { int error; *************** *** 267,272 **** --- 426,445 ---- if (*ptr == NULL) return ENOMEM; error = ef_seg_read(ef, offset, len, *ptr); + if (error) + free(*ptr); + return error; + } + + int + ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, void**ptr) + { + int error; + + *ptr = malloc(len); + if (*ptr == NULL) + return ENOMEM; + error = ef_seg_read_rel(ef, offset, len, *ptr); if (error) free(*ptr); return error; Index: ef.h =================================================================== RCS file: /usr/ncvs/src/usr.sbin/kldxref/ef.h,v retrieving revision 1.2 diff -c -r1.2 ef.h *** ef.h 11 Apr 2002 09:30:15 -0000 1.2 --- ef.h 3 Jan 2003 14:56:09 -0000 *************** *** 28,33 **** --- 28,37 ---- int ef_nsegs; Elf_Phdr * ef_segs[2]; int ef_verbose; + Elf_Rel * ef_rel; /* relocation table */ + int ef_relsz; /* number of entries */ + Elf_Rela * ef_rela; /* relocation table */ + int ef_relasz; /* number of entries */ } *elf_file_t; __BEGIN_DECLS *************** *** 36,42 **** --- 40,48 ---- int ef_read(elf_file_t ef, Elf_Off offset, size_t len, void* dest); int ef_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void **ptr); int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest); + int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest); int ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len, void**ptr); + int ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len, void**ptr); int ef_lookup_symbol(elf_file_t ef, const char* name, Elf_Sym** sym); __END_DECLS Index: kldxref.c =================================================================== RCS file: /usr/ncvs/src/usr.sbin/kldxref/kldxref.c,v retrieving revision 1.4 diff -c -r1.4 kldxref.c *** kldxref.c 22 Apr 2002 13:44:44 -0000 1.4 --- kldxref.c 3 Jan 2003 14:56:09 -0000 *************** *** 229,238 **** check(ef_lookup_symbol(&ef, "__stop_set_" MDT_SETNAME, &sym)); finish = sym->st_value; entries = (finish - start) / sizeof(void *); ! check(ef_seg_read_entry(&ef, start, sizeof(*p) * entries, (void**)&p)); orgp = p; while(entries--) { ! check(ef_seg_read(&ef, (Elf_Off)*p, sizeof(md), &md)); p++; check(ef_seg_read(&ef, (Elf_Off)md.md_cval, sizeof(cval), cval)); cval[MAXMODNAME] = '\0'; --- 229,239 ---- check(ef_lookup_symbol(&ef, "__stop_set_" MDT_SETNAME, &sym)); finish = sym->st_value; entries = (finish - start) / sizeof(void *); ! check(ef_seg_read_entry_rel(&ef, start, sizeof(*p) * entries, ! (void**)&p)); orgp = p; while(entries--) { ! check(ef_seg_read_rel(&ef, (Elf_Off)*p, sizeof(md), &md)); p++; check(ef_seg_read(&ef, (Elf_Off)md.md_cval, sizeof(cval), cval)); cval[MAXMODNAME] = '\0'; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 7:30:24 2003 Delivered-To: freebsd-sparc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 422C237B405 for ; Fri, 3 Jan 2003 07:30:05 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52E0143EE1 for ; Fri, 3 Jan 2003 07:30:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h03FU3NS026068 for ; Fri, 3 Jan 2003 07:30:03 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h03FU3lO026067; Fri, 3 Jan 2003 07:30:03 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE03F37B401 for ; Fri, 3 Jan 2003 07:29:16 -0800 (PST) Received: from mailhub.fokus.gmd.de (mailhub.fokus.gmd.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF4C743ED8 for ; Fri, 3 Jan 2003 07:29:14 -0800 (PST) (envelope-from hbb@catssrv.fokus.gmd.de) Received: from catssrv.fokus.gmd.de (catssrv [192.168.229.23]) by mailhub.fokus.gmd.de (8.11.6/8.11.6) with ESMTP id h03FTDJ14937 for ; Fri, 3 Jan 2003 16:29:13 +0100 (MET) Received: from catssrv.fokus.gmd.de (localhost [127.0.0.1]) by catssrv.fokus.gmd.de (8.12.6/8.12.6) with ESMTP id h03FTDx5003876 for ; Fri, 3 Jan 2003 16:29:13 +0100 (CET) (envelope-from hbb@catssrv.fokus.gmd.de) Received: (from hbb@localhost) by catssrv.fokus.gmd.de (8.12.6/8.12.6/Submit) id h03FTCMT003875; Fri, 3 Jan 2003 16:29:12 +0100 (CET) (envelope-from hbb) Message-Id: <200301031529.h03FTCMT003875@catssrv.fokus.gmd.de> Date: Fri, 3 Jan 2003 16:29:12 +0100 (CET) From: Hartmut Brandt Reply-To: Hartmut Brandt To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: sparc64/46732: kernel linker cannot resolve dependencies Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 46732 >Category: sparc64 >Synopsis: kernel linker cannot resolve dependencies >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-sparc >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 03 07:30:03 PST 2003 >Closed-Date: >Last-Modified: >Originator: Hartmut Brandt >Release: FreeBSD 5.0-CURRENT sparc64 >Organization: FhI Fokus >Environment: System: FreeBSD catssrv.fokus.gmd.de 5.0-CURRENT FreeBSD 5.0-CURRENT #20: Fri Jan 3 14:08:11 CET 2003 hbb@catssrv.fokus.gmd.de:/opt/obj/usr/src/sys/CATSSRV sparc64 >Description: The kernel linker (kern_linker.c) needs to access module metadata in the module it tries to load to resolve dependencies. This access involves pointers and therefor relocation is needed to correctly access these pointers. The kernel linker uses a routine linker_reloc_ptr, that assumes, that all relocation of pointers is done via ELF REL relocation records, by adding the original contents of the pointer to relocate (as red from the file) to the load address. This does not work for sparc64 because sparc64 uses RELA records, where the value to add is in the relocation records itself not in the location to be relocated. This leads to the kernel linker access random locations in memory and not beeing able to process dependency information. An unrelated problem are some wrong printf format characters in the linker debugging code. >How-To-Repeat: Compile the modules netgraph.ko and ng_socket.ko and try to load ng_socket via kldload ng_socket observer /var/log/message to contain a kernel message about an unresolved external symbol. >Fix: The fix is to move the relocation entirely to the MD file, where it belongs to. This is done, by removing all the relocation stuff from kern_linker.c and expect elf linker link_elf.c to process all intra-module relocation before the linker tries to access module metadata. In link_elf.c there are two places affected. For preloaded modules local relocations are processed just before returning to the linker and for kldloaded modules before calling linker_load_dependencies. This is done by a function link_elf_reloc_local, which loops through all relocation records and calling the MD elf_reloc_local. In the MD parts elf_reloc is split. elf_reloc_local processes all relocations that are intra-module (R_*_RELATIVE) and ignores all others. elf_reloc ignores all intra-module relocations and processes all others. The first of the following two patches changes kern_linker, link_elf, i386/i386/elf_machdep.c and sparc64/sparc64/elf_machdep.c in the way described. This patch has been tested on both i386 and sparc64. It corrects also some broken printf format strings for the debugging code. The seconds patch applies to alpha/alpha/elf_machdep.c and ia64/ia64/elf_machdep.c and has neither been compiled nor tested (I have no IA64 or Alpha), but should be simple to verify. -------------- PATCH 1 ------------------------------------------- Index: kern/kern_linker.c =================================================================== RCS file: /usr/ncvs/src/sys/kern/kern_linker.c,v retrieving revision 1.101 diff -c -r1.101 kern_linker.c *** kern/kern_linker.c 14 Dec 2002 08:18:05 -0000 1.101 --- kern/kern_linker.c 3 Jan 2003 12:15:30 -0000 *************** *** 499,505 **** * Give the module a chance to veto the unload. */ if ((error = module_unload(mod)) != 0) { ! KLD_DPF(FILE, ("linker_file_unload: module %x" " vetoes unload\n", mod)); goto out; } else --- 499,505 ---- * Give the module a chance to veto the unload. */ if ((error = module_unload(mod)) != 0) { ! KLD_DPF(FILE, ("linker_file_unload: module %p" " vetoes unload\n", mod)); goto out; } else *************** *** 594,600 **** size_t common_size = 0; int i; ! KLD_DPF(SYM, ("linker_file_lookup_symbol: file=%x, name=%s, deps=%d\n", file, name, deps)); if (LINKER_LOOKUP_SYMBOL(file, name, &sym) == 0) { --- 594,600 ---- size_t common_size = 0; int i; ! KLD_DPF(SYM, ("linker_file_lookup_symbol: file=%p, name=%s, deps=%d\n", file, name, deps)); if (LINKER_LOOKUP_SYMBOL(file, name, &sym) == 0) { *************** *** 608,614 **** common_size = symval.size; else { KLD_DPF(SYM, ("linker_file_lookup_symbol: symbol" ! ".value=%x\n", symval.value)); return (symval.value); } } --- 608,614 ---- common_size = symval.size; else { KLD_DPF(SYM, ("linker_file_lookup_symbol: symbol" ! ".value=%p\n", symval.value)); return (symval.value); } } *************** *** 618,624 **** name, 0); if (address) { KLD_DPF(SYM, ("linker_file_lookup_symbol:" ! " deps value=%x\n", address)); return (address); } } --- 618,624 ---- name, 0); if (address) { KLD_DPF(SYM, ("linker_file_lookup_symbol:" ! " deps value=%p\n", address)); return (address); } } *************** *** 634,640 **** STAILQ_FOREACH(cp, &file->common, link) { if (strcmp(cp->name, name) == 0) { KLD_DPF(SYM, ("linker_file_lookup_symbol:" ! " old common value=%x\n", cp->address)); return (cp->address); } } --- 634,640 ---- STAILQ_FOREACH(cp, &file->common, link) { if (strcmp(cp->name, name) == 0) { KLD_DPF(SYM, ("linker_file_lookup_symbol:" ! " old common value=%p\n", cp->address)); return (cp->address); } } *************** *** 656,662 **** STAILQ_INSERT_TAIL(&file->common, cp, link); KLD_DPF(SYM, ("linker_file_lookup_symbol: new common" ! " value=%x\n", cp->address)); return (cp->address); } KLD_DPF(SYM, ("linker_file_lookup_symbol: fail\n")); --- 656,662 ---- STAILQ_INSERT_TAIL(&file->common, cp, link); KLD_DPF(SYM, ("linker_file_lookup_symbol: new common" ! " value=%p\n", cp->address)); return (cp->address); } KLD_DPF(SYM, ("linker_file_lookup_symbol: fail\n")); *************** *** 1106,1151 **** return (mod); } - /* - * This routine is cheap and nasty but will work for data pointers. - */ - static void * - linker_reloc_ptr(linker_file_t lf, const void *offset) - { - return (lf->address + (uintptr_t)offset); - } - - /* - * Dereference MDT_VERSION metadata into module name and version - */ - static void - linker_mdt_version(linker_file_t lf, struct mod_metadata *mp, - const char **modname, int *version) - { - struct mod_version *mvp; - - if (modname) - *modname = linker_reloc_ptr(lf, mp->md_cval); - if (version) { - mvp = linker_reloc_ptr(lf, mp->md_data); - *version = mvp->mv_version; - } - } - - /* - * Dereference MDT_DEPEND metadata into module name and mod_depend structure - */ - static void - linker_mdt_depend(linker_file_t lf, struct mod_metadata *mp, - const char **modname, struct mod_depend **verinfo) - { - - if (modname) - *modname = linker_reloc_ptr(lf, mp->md_cval); - if (verinfo) - *verinfo = linker_reloc_ptr(lf, mp->md_data); - } - static void linker_addmodules(linker_file_t lf, struct mod_metadata **start, struct mod_metadata **stop, int preload) --- 1106,1111 ---- *************** *** 1155,1171 **** int ver; for (mdp = start; mdp < stop; mdp++) { ! if (preload) ! mp = *mdp; ! else ! mp = linker_reloc_ptr(lf, *mdp); if (mp->md_type != MDT_VERSION) continue; ! if (preload) { ! modname = mp->md_cval; ! ver = ((struct mod_version *)mp->md_data)->mv_version; ! } else ! linker_mdt_version(lf, mp, &modname, &ver); if (modlist_lookup(modname, ver) != NULL) { printf("module %s already present!\n", modname); /* XXX what can we do? this is a build error. :-( */ --- 1115,1125 ---- int ver; for (mdp = start; mdp < stop; mdp++) { ! mp = *mdp; if (mp->md_type != MDT_VERSION) continue; ! modname = mp->md_cval; ! ver = ((struct mod_version *)mp->md_data)->mv_version; if (modlist_lookup(modname, ver) != NULL) { printf("module %s already present!\n", modname); /* XXX what can we do? this is a build error. :-( */ *************** *** 1249,1266 **** resolves = 1; /* unless we know otherwise */ if (!error) { for (mdp = start; mdp < stop; mdp++) { ! mp = linker_reloc_ptr(lf, *mdp); if (mp->md_type != MDT_DEPEND) continue; ! linker_mdt_depend(lf, mp, &modname, &verinfo); for (nmdp = start; nmdp < stop; nmdp++) { ! nmp = linker_reloc_ptr(lf, *nmdp); if (nmp->md_type != MDT_VERSION) continue; ! linker_mdt_version(lf, nmp, &nmodname, ! NULL); ! nmodname = linker_reloc_ptr(lf, ! nmp->md_cval); if (strcmp(modname, nmodname) == 0) break; } --- 1203,1218 ---- resolves = 1; /* unless we know otherwise */ if (!error) { for (mdp = start; mdp < stop; mdp++) { ! mp = *mdp; if (mp->md_type != MDT_DEPEND) continue; ! modname = mp->md_cval; ! verinfo = mp->md_data; for (nmdp = start; nmdp < stop; nmdp++) { ! nmp = *nmdp; if (nmp->md_type != MDT_VERSION) continue; ! nmodname = nmp->md_cval; if (strcmp(modname, nmodname) == 0) break; } *************** *** 1283,1293 **** if (resolves) { if (!error) { for (mdp = start; mdp < stop; mdp++) { ! mp = linker_reloc_ptr(lf, *mdp); if (mp->md_type != MDT_VERSION) continue; ! linker_mdt_version(lf, mp, ! &modname, &nver); if (modlist_lookup(modname, nver) != NULL) { printf("module %s already" --- 1235,1246 ---- if (resolves) { if (!error) { for (mdp = start; mdp < stop; mdp++) { ! mp = *mdp; if (mp->md_type != MDT_VERSION) continue; ! modname = mp->md_cval; ! nver = ((struct mod_version *) ! mp->md_data)->mv_version; if (modlist_lookup(modname, nver) != NULL) { printf("module %s already" *************** *** 1338,1347 **** &stop, NULL); if (!error) { for (mdp = start; mdp < stop; mdp++) { ! mp = linker_reloc_ptr(lf, *mdp); if (mp->md_type != MDT_DEPEND) continue; ! linker_mdt_depend(lf, mp, &modname, &verinfo); mod = modlist_lookup2(modname, verinfo); mod->container->refs++; error = linker_file_add_dependency(lf, --- 1291,1301 ---- &stop, NULL); if (!error) { for (mdp = start; mdp < stop; mdp++) { ! mp = *mdp; if (mp->md_type != MDT_DEPEND) continue; ! modname = mp->md_cval; ! verinfo = mp->md_data; mod = modlist_lookup2(modname, verinfo); mod->container->refs++; error = linker_file_add_dependency(lf, *************** *** 1763,1772 **** &count) != 0) return (0); for (mdp = start; mdp < stop; mdp++) { ! mp = linker_reloc_ptr(lf, *mdp); if (mp->md_type != MDT_VERSION) continue; ! linker_mdt_version(lf, mp, &modname, &ver); mod = modlist_lookup(modname, ver); if (mod != NULL) { printf("interface %s.%d already present in the KLD" --- 1717,1727 ---- &count) != 0) return (0); for (mdp = start; mdp < stop; mdp++) { ! mp = *mdp; if (mp->md_type != MDT_VERSION) continue; ! modname = mp->md_cval; ! ver = ((struct mod_version *)mp->md_data)->mv_version; mod = modlist_lookup(modname, ver); if (mod != NULL) { printf("interface %s.%d already present in the KLD" *************** *** 1777,1792 **** } for (mdp = start; mdp < stop; mdp++) { ! mp = linker_reloc_ptr(lf, *mdp); if (mp->md_type != MDT_DEPEND) continue; ! linker_mdt_depend(lf, mp, &modname, &verinfo); nmodname = NULL; for (nmdp = start; nmdp < stop; nmdp++) { ! nmp = linker_reloc_ptr(lf, *nmdp); if (nmp->md_type != MDT_VERSION) continue; ! nmodname = linker_reloc_ptr(lf, nmp->md_cval); if (strcmp(modname, nmodname) == 0) break; } --- 1732,1748 ---- } for (mdp = start; mdp < stop; mdp++) { ! mp = *mdp; if (mp->md_type != MDT_DEPEND) continue; ! modname = mp->md_cval; ! verinfo = mp->md_data; nmodname = NULL; for (nmdp = start; nmdp < stop; nmdp++) { ! nmp = *nmdp; if (nmp->md_type != MDT_VERSION) continue; ! nmodname = nmp->md_cval; if (strcmp(modname, nmodname) == 0) break; } Index: kern/link_elf.c =================================================================== RCS file: /usr/ncvs/src/sys/kern/link_elf.c,v retrieving revision 1.68 diff -c -r1.68 link_elf.c *** kern/link_elf.c 19 Nov 2002 22:12:42 -0000 1.68 --- kern/link_elf.c 3 Jan 2003 11:34:31 -0000 *************** *** 116,121 **** --- 116,122 ---- static int link_elf_each_function_name(linker_file_t, int (*)(const char *, void *), void *); + static void link_elf_reloc_local(linker_file_t); static kobj_method_t link_elf_methods[] = { KOBJMETHOD(linker_lookup_symbol, link_elf_lookup_symbol), *************** *** 488,493 **** --- 489,495 ---- linker_file_unload(lf); return error; } + link_elf_reloc_local(lf); *result = lf; return (0); } *************** *** 748,753 **** --- 750,757 ---- error = parse_dynamic(ef); if (error) goto out; + link_elf_reloc_local(lf); + error = linker_load_dependencies(lf); if (error) goto out; *************** *** 1265,1268 **** --- 1269,1300 ---- return (0); return ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + } + + static void + link_elf_reloc_local(linker_file_t lf) + { + const Elf_Rel *rellim; + const Elf_Rel *rel; + const Elf_Rela *relalim; + const Elf_Rela *rela; + elf_file_t ef = (elf_file_t)lf; + + /* Perform relocations without addend if there are any: */ + if ((rel = ef->rel) != NULL) { + rellim = (const Elf_Rel *)((const char *)ef->rel + ef->relsize); + while (rel < rellim) { + elf_reloc_local(lf, rel, ELF_RELOC_REL); + rel++; + } + } + + /* Perform relocations with addend if there are any: */ + if ((rela = ef->rela) != NULL) { + relalim = (const Elf_Rela *)((const char *)ef->rela + ef->relasize); + while (rela < relalim) { + elf_reloc_local(lf, rela, ELF_RELOC_RELA); + rela++; + } + } } Index: sparc64/sparc64/elf_machdep.c =================================================================== RCS file: /usr/ncvs/src/sys/sparc64/sparc64/elf_machdep.c,v retrieving revision 1.12 diff -c -r1.12 elf_machdep.c *** sparc64/sparc64/elf_machdep.c 2 Dec 2002 18:56:30 -0000 1.12 --- sparc64/sparc64/elf_machdep.c 3 Jan 2003 11:26:10 -0000 *************** *** 235,240 **** --- 235,262 ---- }; #define RELOC_VALUE_BITMASK(t) (reloc_target_bitmask[t]) + int + elf_reloc_local(linker_file_t lf, const void *data, int type) + { + const Elf_Rela *rela; + Elf_Addr value; + Elf_Addr *where; + + if (type != ELF_RELOC_RELA) + return (-1); + + rela = (const Elf_Rela *)data; + if (ELF_R_TYPE(rela->r_info) != R_SPARC_RELATIVE) + return (-1); + + value = rela->r_addend + (Elf_Addr)lf->address; + where = (Elf_Addr *)((Elf_Addr)lf->address + rela->r_offset); + + *where = value; + + return (0); + } + /* Process one elf relocation with addend. */ int elf_reloc(linker_file_t lf, const void *data, int type) *************** *** 258,264 **** rtype = ELF_R_TYPE(rela->r_info); symidx = ELF_R_SYM(rela->r_info); ! if (rtype == R_SPARC_NONE) return (0); if (rtype == R_SPARC_JMP_SLOT || rtype == R_SPARC_COPY || --- 280,286 ---- rtype = ELF_R_TYPE(rela->r_info); symidx = ELF_R_SYM(rela->r_info); ! if (rtype == R_SPARC_NONE || rtype == R_SPARC_RELATIVE) return (0); if (rtype == R_SPARC_JMP_SLOT || rtype == R_SPARC_COPY || Index: i386/i386/elf_machdep.c =================================================================== RCS file: /usr/ncvs/src/sys/i386/i386/elf_machdep.c,v retrieving revision 1.12 diff -c -r1.12 elf_machdep.c *** i386/i386/elf_machdep.c 19 Oct 2002 19:16:03 -0000 1.12 --- i386/i386/elf_machdep.c 3 Jan 2003 11:25:49 -0000 *************** *** 86,93 **** &freebsd_brand_info); /* Process one elf relocation with addend. */ ! int ! elf_reloc(linker_file_t lf, const void *data, int type) { Elf_Addr relocbase = (Elf_Addr) lf->address; Elf_Addr *where; --- 86,93 ---- &freebsd_brand_info); /* Process one elf relocation with addend. */ ! static int ! elf_reloc_internal(linker_file_t lf, const void *data, int type, int local) { Elf_Addr relocbase = (Elf_Addr) lf->address; Elf_Addr *where; *************** *** 116,121 **** --- 116,130 ---- panic("unknown reloc type %d\n", type); } + if (local) { + if (rtype == R_386_RELATIVE) { /* A + B */ + addr = relocbase + addend; + if (*where != addr) + *where = addr; + } + return (0); + } + switch (rtype) { case R_386_NONE: /* none */ *************** *** 156,165 **** *where = addr; break; ! case R_386_RELATIVE: /* B + A */ ! addr = relocbase + addend; ! if (*where != addr) ! *where = addr; break; default: --- 165,171 ---- *where = addr; break; ! case R_386_RELATIVE: break; default: *************** *** 168,173 **** --- 174,191 ---- return -1; } return(0); + } + + int + elf_reloc(linker_file_t lf, const void *data, int type) + { + return (elf_reloc_internal(lf, data, type, 0)); + } + + int + elf_reloc_local(linker_file_t lf, const void *data, int type) + { + return (elf_reloc_internal(lf, data, type, 1)); } int -------------- PATCH 2 ------------------------------------------- Index: ia64/ia64/elf_machdep.c =================================================================== RCS file: /usr/ncvs/src/sys/ia64/ia64/elf_machdep.c,v retrieving revision 1.9 diff -c -r1.9 elf_machdep.c *** ia64/ia64/elf_machdep.c 19 Oct 2002 19:30:38 -0000 1.9 --- ia64/ia64/elf_machdep.c 3 Jan 2003 11:19:39 -0000 *************** *** 141,148 **** } /* Process one elf relocation with addend. */ ! int ! elf_reloc(linker_file_t lf, const void *data, int type) { Elf_Addr relocbase = (Elf_Addr)lf->address; Elf_Addr *where; --- 141,148 ---- } /* Process one elf relocation with addend. */ ! static int ! elf_reloc_internal(linker_file_t lf, const void *data, int type, int local) { Elf_Addr relocbase = (Elf_Addr)lf->address; Elf_Addr *where; *************** *** 179,184 **** --- 179,190 ---- panic("%s: invalid ELF relocation (0x%x)\n", __func__, type); } + if (local) { + if (rtype == R_IA64_REL64LSB) + *where = relocbase + addend; + return (0); + } + switch (rtype) { case R_IA64_NONE: break; *************** *** 199,205 **** *where = addr; break; case R_IA64_REL64LSB: /* word64 LSB BD + A */ - *where = relocbase + addend; break; case R_IA64_IPLTLSB: addr = lookup_fdesc(lf, symidx); --- 205,210 ---- *************** *** 215,220 **** --- 220,237 ---- } return (0); + } + + int + elf_reloc(linker_file_t lf, const void *data, int type) + { + return (elf_reloc_internal(lf, data, type, 0)); + } + + int + elf_reloc_local(linker_file_t lf, const void *data, int type) + { + return (elf_reloc_internal(lf, data, type, 1)); } int Index: alpha/alpha/elf_machdep.c =================================================================== RCS file: /usr/ncvs/src/sys/alpha/alpha/elf_machdep.c,v retrieving revision 1.12 diff -c -r1.12 elf_machdep.c *** alpha/alpha/elf_machdep.c 19 Oct 2002 19:16:02 -0000 1.12 --- alpha/alpha/elf_machdep.c 3 Jan 2003 11:21:33 -0000 *************** *** 89,96 **** &freebsd_brand_info); /* Process one elf relocation with addend. */ ! int ! elf_reloc(linker_file_t lf, const void *data, int type) { Elf_Addr relocbase = (Elf_Addr) lf->address; Elf_Addr *where; --- 89,96 ---- &freebsd_brand_info); /* Process one elf relocation with addend. */ ! static int ! elf_reloc_internal(linker_file_t lf, const void *data, int type, int local) { Elf_Addr relocbase = (Elf_Addr) lf->address; Elf_Addr *where; *************** *** 119,124 **** --- 119,133 ---- panic("elf_reloc: unknown relocation mode %d\n", type); } + if (local) { + if (rtype == R_ALPHA_RELATIVE) { + addr = relocbase + addend; + if (*where != addr) + *where = addr; + } + return (0); + } + switch (rtype) { case R_ALPHA_NONE: *************** *** 152,160 **** break; case R_ALPHA_RELATIVE: - addr = relocbase + addend; - if (*where != addr) - *where = addr; break; case R_ALPHA_COPY: --- 161,166 ---- *************** *** 171,176 **** --- 177,194 ---- return -1; } return(0); + } + + int + elf_reloc(linker_file_t lf, const void *data, int type) + { + return (elf_reloc_internal(lf, data, type, 0)); + } + + int + elf_reloc_local(linker_file_t lf, const void *data, int type) + { + return (elf_reloc_internal(lf, data, type, 1)); } int >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 10: 1:13 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51AF337B405 for ; Fri, 3 Jan 2003 10:01:12 -0800 (PST) Received: from mail.gmx.net (mail.gmx.net [213.165.65.60]) by mx1.FreeBSD.org (Postfix) with SMTP id ADB2E43E4A for ; Fri, 3 Jan 2003 10:01:09 -0800 (PST) (envelope-from tmoestl@gmx.net) Received: (qmail 7253 invoked by uid 0); 3 Jan 2003 18:01:07 -0000 Received: from p508e635d.dip.t-dialin.net (HELO galatea.local) (80.142.99.93) by mail.gmx.net (mp010-rz3) with SMTP; 3 Jan 2003 18:01:07 -0000 Received: from localhost ([127.0.0.1] helo=galatea.local) by galatea.local with esmtp (Exim 4.10 #1) id 18UW8i-0000y5-00; Fri, 03 Jan 2003 19:01:49 +0100 Received: (from tmm@localhost) by galatea.local (8.12.6/8.12.6/Submit) id h03I1NAo003724; Fri, 3 Jan 2003 19:01:23 +0100 (CET) Date: Fri, 3 Jan 2003 19:01:23 +0100 From: Thomas Moestl To: Peter Pentchev Cc: Olafur Osvaldsson , "David O'Brien" , freebsd-hackers@FreeBSD.org, freebsd-sparc@FreeBSD.org Subject: Re: Locale errors on 5.0-CURRENT (sparc) Message-ID: <20030103180123.GA284@crow.dom2ip.de> Mail-Followup-To: Peter Pentchev , Olafur Osvaldsson , David O'Brien , freebsd-hackers@freebsd.org, freebsd-sparc@freebsd.org References: <20030103120057.GI74128@isnic.is> <20030103123141.GA45645@straylight.oblivion.bg> <20030103132927.GC45645@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030103132927.GC45645@straylight.oblivion.bg> User-Agent: Mutt/1.4i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 2003/01/03 at 15:29:27 +0200, Peter Pentchev wrote: > On Fri, Jan 03, 2003 at 02:31:41PM +0200, Peter Pentchev wrote: > > FWIW, I can reproduce this on panther.FreeBSD.org, a sparc64 running > > 5.0-CURRENT as of December 6, 2001. All the other machines in the > > FreeBSD cluster that I could test - ref5 (i386), pluto1 (IA-64), and > > beast (alpha) - are able to set both the is_IS.ISO8859-1 and the > > bg_BG.CP1251 locales correctly for both LC_ALL and LC_TIME. Only the > > sparc64 machine is having trouble setting LC_ALL for any locale I tried. > > Actually, I seem to have found the reason: on panther.FreeBSD.org, there > are no LC_CTYPE files for any locale, and setlocale(LC_ALL) attempts to > load, well, *all* locale type definitions, including LC_CTYPE. Thus, it > would (and does) return NULL with errno set to ENOENT for all locales... > > The LC_CTYPE files are not there, because there is an explicit test for > the build architecture in src/share/Makefile, which excludes the > mklocale directory for sparc64; it was introduced in rev. 1.27 by David > O'Brien about 7 months ago. David, what exactly was the 'bad juju' > mentioned in the commit message, and is it still there? A test run of > 'cvs up share/mklocale && cd share/mklocale && make' on panther seemed > to complete OK; I have not yet tested the resulting locale files though. Yeah, I just noticed that, too. As far as I can tell, this is purely historical, if I remember correctly mklocale did crash back then. I will re-enable it. - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 15:10: 6 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A286437B401; Fri, 3 Jan 2003 15:10:05 -0800 (PST) Received: from fang.km.ua (fang.km.ua [217.66.96.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 53F0243ED1; Fri, 3 Jan 2003 15:10:04 -0800 (PST) (envelope-from maxim@fang.km.ua) Received: from fang.km.ua (localhost [127.0.0.1]) by fang.km.ua (8.12.6/8.12.6) with ESMTP id h03NA0Le009753; Sat, 4 Jan 2003 01:10:00 +0200 (EET) (envelope-from maxim@fang.km.ua) Received: (from maxim@localhost) by fang.km.ua (8.12.6/8.12.6/Submit) id h03N9vtG009752; Sat, 4 Jan 2003 01:09:57 +0200 (EET) Date: Sat, 4 Jan 2003 01:09:57 +0200 From: Maxim Mazurok To: Olafur Osvaldsson Cc: Peter Pentchev , "David O'Brien" , freebsd-hackers@FreeBSD.ORG, freebsd-sparc@FreeBSD.ORG Subject: Re: Locale errors on 5.0-CURRENT (sparc) Message-ID: <20030104010956.A5002@km.ua> References: <20030103120057.GI74128@isnic.is> <20030103123141.GA45645@straylight.oblivion.bg> <20030103132927.GC45645@straylight.oblivion.bg> <20030103145332.GN74128@isnic.is> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i In-Reply-To: <20030103145332.GN74128@isnic.is>; from oli@isnic.is on Fri, Jan 03, 2003 at 02:53:32PM +0000 Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Jan 03, 2003 at 02:53:32PM +0000, Olafur Osvaldsson wrote: >Removing the exclude for sparc64 in src/share/Makefile rebuilding/installing >fixes this for me and I see nothing wrong with the is_IS.ISO8859-1 locale so >far. > >Unless there is some real reason for excluding it I suggest that the sparc64 >test is removed from that file. YES! It's worked! I use next: export LANG=C unset LC_ALL export LC_CTYPE=ru_RU.KOI8-R -- Maxim Mazurok (MMP2-RIPE) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 17:50:24 2003 Delivered-To: freebsd-sparc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7ECAB37B401; Fri, 3 Jan 2003 17:50:23 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2BF1D43ED1; Fri, 3 Jan 2003 17:50:23 -0800 (PST) (envelope-from fenner@FreeBSD.org) Received: from freefall.freebsd.org (fenner@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h041oNNS027652; Fri, 3 Jan 2003 17:50:23 -0800 (PST) (envelope-from fenner@freefall.freebsd.org) Received: (from fenner@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h041oNJX027648; Fri, 3 Jan 2003 17:50:23 -0800 (PST) Date: Fri, 3 Jan 2003 17:50:23 -0800 (PST) From: Bill Fenner Message-Id: <200301040150.h041oNJX027648@freefall.freebsd.org> To: fenner@FreeBSD.org, freebsd-sparc@FreeBSD.org, fenner@FreeBSD.org Subject: Re: sparc64/46729: gethostbyname fails for NIS Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Synopsis: gethostbyname fails for NIS Responsible-Changed-From-To: freebsd-sparc->fenner Responsible-Changed-By: fenner Responsible-Changed-When: Fri Jan 3 17:50:22 PST 2003 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=46729 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 18: 1:34 2003 Delivered-To: freebsd-sparc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC36D37B401; Fri, 3 Jan 2003 18:01:33 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89E3243E4A; Fri, 3 Jan 2003 18:01:33 -0800 (PST) (envelope-from jake@FreeBSD.org) Received: from freefall.freebsd.org (jake@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0421XNS031186; Fri, 3 Jan 2003 18:01:33 -0800 (PST) (envelope-from jake@freefall.freebsd.org) Received: (from jake@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0421Xf3031182; Fri, 3 Jan 2003 18:01:33 -0800 (PST) Date: Fri, 3 Jan 2003 18:01:33 -0800 (PST) From: Jake Burkholder Message-Id: <200301040201.h0421Xf3031182@freefall.freebsd.org> To: jake@FreeBSD.org, freebsd-sparc@FreeBSD.org, jake@FreeBSD.org Subject: Re: sparc64/46730: kldxref does not work Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Synopsis: kldxref does not work Responsible-Changed-From-To: freebsd-sparc->jake Responsible-Changed-By: jake Responsible-Changed-When: Fri Jan 3 18:00:28 PST 2003 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=46730 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Fri Jan 3 18: 2:58 2003 Delivered-To: freebsd-sparc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D7F737B401; Fri, 3 Jan 2003 18:02:57 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4868043EB2; Fri, 3 Jan 2003 18:02:57 -0800 (PST) (envelope-from jake@FreeBSD.org) Received: from freefall.freebsd.org (jake@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h0422vNS031261; Fri, 3 Jan 2003 18:02:57 -0800 (PST) (envelope-from jake@freefall.freebsd.org) Received: (from jake@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h0422v7b031257; Fri, 3 Jan 2003 18:02:57 -0800 (PST) Date: Fri, 3 Jan 2003 18:02:57 -0800 (PST) From: Jake Burkholder Message-Id: <200301040202.h0422v7b031257@freefall.freebsd.org> To: jake@FreeBSD.org, freebsd-sparc@FreeBSD.org, jake@FreeBSD.org Subject: Re: sparc64/46732: kernel linker cannot resolve dependencies Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Synopsis: kernel linker cannot resolve dependencies Responsible-Changed-From-To: freebsd-sparc->jake Responsible-Changed-By: jake Responsible-Changed-When: Fri Jan 3 18:02:43 PST 2003 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=46732 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Sat Jan 4 3:29:38 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A069937B401 for ; Sat, 4 Jan 2003 03:29:36 -0800 (PST) Received: from cc-gw.1anetworks.net (cc-gw.1anetworks.net [193.243.179.83]) by mx1.FreeBSD.org (Postfix) with SMTP id 63E2543ED4 for ; Sat, 4 Jan 2003 03:29:35 -0800 (PST) (envelope-from brian@ukip.com) Received: from BRI (brian.1anetworks.net [212.36.98.200]) by parma.1anetworks.net (8.9.3+Sun/8.9.3) with SMTP id LAA05597 for ; Sat, 4 Jan 2003 11:29:26 GMT From: "Bri" To: Subject: Kdump fails to build from lastest sources Date: Sat, 4 Jan 2003 11:23:26 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org ===> alias ===> apply ===> asa ===> at ===> awk ===> banner ===> basename ===> biff ===> brandelf ===> bzip2 ===> bzip2/doc ===> c89 ===> c99 ===> calendar ===> cap_mkdb ===> catman ===> chat ===> checknr ===> chflags ===> chpass ===> cksum ===> cmp ===> col ===> colcrt ===> colldef ===> colrm ===> column ===> comm ===> compile_et ===> compress ===> csplit ===> ctags ===> cut ===> dirname ===> du ===> ee ===> elf2aout ===> enigma ===> env ===> expand ===> false ===> fetch ===> file ===> file2c ===> find ===> finger ===> fmt ===> fold ===> from ===> fstat ===> fsync ===> ftp ===> gcore ===> gencat ===> getconf ===> getopt ===> gprof ===> head ===> hesinfo ===> hexdump ===> id ===> indent ===> ipcrm ===> ipcs ===> join ===> jot ===> kdump cc -O -pipe -I/usr/cvsroot/src/usr.bin/kdump/../ktrace -I/usr/cvsroot/src/u sr.bin/kdump/../.. -c ioctl.c In file included from ioctl.c:73: /usr/include/sys/diskpc98.h:47: redefinition of `struct dos_partition' *** Error code 1 Stop in /usr/cvsroot/src/usr.bin/kdump. *** Error code 1 Stop in /usr/cvsroot/src/usr.bin. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Sat Jan 4 9:25:47 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F1F137B401 for ; Sat, 4 Jan 2003 09:25:46 -0800 (PST) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id B00C343ED1 for ; Sat, 4 Jan 2003 09:25:45 -0800 (PST) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.12.6/8.12.2) with ESMTP id h04HPY1A081207; Sat, 4 Jan 2003 09:25:34 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.6/8.12.6/Submit) id h04HOIup080009; Sat, 4 Jan 2003 09:24:18 -0800 (PST) Date: Sat, 4 Jan 2003 09:24:18 -0800 From: "David O'Brien" To: Piotr Wo?niak Cc: freebsd-sparc@freebsd.org Subject: Re: terminal types - 5.0-RC2 install Message-ID: <20030104172418.GD49923@dragon.nuxi.com> Reply-To: obrien@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Jan 03, 2003 at 01:59:56PM +0100, Piotr Wo?niak wrote: > Hi, > > I'm installing FreeBSD on Ultra5.. > What type of terminal (in the beginning of installation) should I choise > not to get rubbish on the screen? I use the conserver port for my terminal emulator and a terminal type of "vt100". To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message From owner-freebsd-sparc Sat Jan 4 18:32:42 2003 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B7DA637B401 for ; Sat, 4 Jan 2003 18:32:34 -0800 (PST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 514F243E4A for ; Sat, 4 Jan 2003 18:32:33 -0800 (PST) (envelope-from tmoestl@gmx.net) Received: (qmail 4834 invoked by uid 0); 5 Jan 2003 02:32:30 -0000 Received: from p508e5aef.dip.t-dialin.net (HELO galatea.local) (80.142.90.239) by mail.gmx.net (mp013-rz3) with SMTP; 5 Jan 2003 02:32:30 -0000 Received: from localhost ([127.0.0.1] helo=galatea.local) by galatea.local with esmtp (Exim 4.10 #1) id 18V0bb-00023U-00 for ; Sun, 05 Jan 2003 03:33:39 +0100 Received: (from tmm@localhost) by galatea.local (8.12.6/8.12.6/Submit) id h052XabO007903 for freebsd-sparc@FreeBSD.org; Sun, 5 Jan 2003 03:33:37 +0100 (CET) Date: Sun, 5 Jan 2003 03:33:36 +0100 From: Thomas Moestl To: freebsd-sparc@FreeBSD.org Subject: (hopefully) working libc_r for sparc64 Message-ID: <20030105023336.GD279@crow.dom2ip.de> Mail-Followup-To: freebsd-sparc@FreeBSD.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TakKZr9L6Hm6aLOc" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4i Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --TakKZr9L6Hm6aLOc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I think I got libc_r working, after rewriting longjmp() and friends so that they do not require the corresponding setjmp() to be done in an ancestor function in the call graph any more, i.e. it can be used to switch stacks now. This might also get other threading packages to work, e.g. ruby's integrated thread manager. I've attached a diff that contains these changes, and also patches to libc_r to add the necessary MD code. The latter are based on diffs that des posted to this list some time ago. To apply this, you will need to do a 'mkdir libc_r/arch/sparc64' in your src directory before. It would be nice if people could test these changes a bit, both with applications that make extensive use of the *jmp() functions and with libc_r-using programs. Please be aware however that by installing an experimental libc you might hose your system (although things seem to work fine for me). - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C --TakKZr9L6Hm6aLOc Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="pthread.diff" Content-Transfer-Encoding: 8bit Index: Makefile =================================================================== RCS file: /ncvs/src/lib/Makefile,v retrieving revision 1.145 diff -u -r1.145 Makefile --- Makefile 4 Oct 2002 13:40:39 -0000 1.145 +++ Makefile 5 Jan 2003 01:56:45 -0000 @@ -40,7 +40,7 @@ _csu=csu .endif -.if !defined(NOLIBC_R) && ${MACHINE_ARCH} != ia64 && ${MACHINE_ARCH} != sparc64 +.if !defined(NOLIBC_R) && ${MACHINE_ARCH} != ia64 _libc_r= libc_r .endif Index: libc/sparc64/gen/_setjmp.S =================================================================== RCS file: /ncvs/src/lib/libc/sparc64/gen/_setjmp.S,v retrieving revision 1.4 diff -u -r1.4 _setjmp.S --- libc/sparc64/gen/_setjmp.S 29 Jun 2002 03:23:51 -0000 1.4 +++ libc/sparc64/gen/_setjmp.S 5 Jan 2003 00:52:21 -0000 @@ -58,42 +58,26 @@ * will generate a "return(v?v:1)" from * the last call to * _setjmp(a) - * by unwinding the call stack. + * by restoring the previous context. * The previous signal state is NOT restored. */ ENTRY(_setjmp) stx %sp, [%o0 + _JB_SP] stx %o7, [%o0 + _JB_PC] - stx %fp, [%o0 + _JB_FP] retl clr %o0 END(_setjmp) -ENTRY(_longjmp) - mov 1, %g1 - movrnz %o1, %o1, %g1 ! compute v ? v : 1 - mov %o0, %g2 - ldx [%g2 + _JB_FP], %g3 ! fetch callers frame -1: cmp %fp, %g3 ! compare against desired frame - bl,a 1b ! if below, - restore ! pop frame and loop - be,a 2f ! if there, - ldx [%g2 + _JB_SP], %o0 ! fetch return %sp - -.Lbotch: - call CNAME(longjmperror) - nop - call CNAME(abort) - nop - illtrap - -2: cmp %o0, %sp ! %sp must not decrease - bge,a 3f - mov %o0, %sp ! it is OK, put it in place - b,a .Lbotch - nop -3: ldx [%g2 + _JB_PC], %o7 ! fetch return address - retl - mov %g1, %o0 ! return v ? v : 1; + .weak CNAME(_longjmp) + .set CNAME(_longjmp),CNAME(___longjmp) +ENTRY(___longjmp) + save %sp, -CCFSZ, %sp + flushw + ldx [%i0 + _JB_SP], %fp + ldx [%i0 + _JB_PC], %i7 + mov 1, %i0 + movrnz %i1, %i1, %i0 + ret + restore END(_longjmp) Index: libc/sparc64/gen/setjmp.S =================================================================== RCS file: /ncvs/src/lib/libc/sparc64/gen/setjmp.S,v retrieving revision 1.3 diff -u -r1.3 setjmp.S --- libc/sparc64/gen/setjmp.S 29 Jun 2002 03:23:51 -0000 1.3 +++ libc/sparc64/gen/setjmp.S 5 Jan 2003 00:45:56 -0000 @@ -70,7 +70,6 @@ restore stx %sp, [%o0 + _JB_SP] stx %o7, [%o0 + _JB_PC] - stx %fp, [%o0 + _JB_FP] retl clr %o0 END(setjmp) @@ -79,34 +78,15 @@ .set CNAME(longjmp),CNAME(__longjmp) ENTRY(__longjmp) save %sp, -CCFSZ, %sp + flushw mov SIG_SETMASK, %o0 add %i0, _JB_SIGMASK, %o1 call CNAME(sigprocmask) clr %o2 - restore - mov 1, %g1 - movrnz %o1, %o1, %g1 - mov %o0, %g2 - ldx [%g2 + _JB_FP], %g3 -1: cmp %fp, %g3 - bl,a 1b + ldx [%i0 + _JB_SP], %fp + ldx [%i0 + _JB_PC], %i7 + mov 1, %i0 + movrnz %i1, %i1, %i0 + ret restore - be,a 2f - ldx [%g2 + _JB_SP], %o0 - -.Lbotch: - call CNAME(longjmperror) - nop - call CNAME(abort) - nop - illtrap - -2: cmp %o0, %sp - bge,a 3f - mov %o0, %sp - b,a .Lbotch - nop -3: ldx [%g2 + _JB_PC], %o7 - retl - mov %g1, %o0 END(__longjmp) Index: libc/sparc64/gen/sigsetjmp.S =================================================================== RCS file: /ncvs/src/lib/libc/sparc64/gen/sigsetjmp.S,v retrieving revision 1.4 diff -u -r1.4 sigsetjmp.S --- libc/sparc64/gen/sigsetjmp.S 29 Jun 2002 03:23:51 -0000 1.4 +++ libc/sparc64/gen/sigsetjmp.S 4 Jan 2003 21:16:29 -0000 @@ -43,7 +43,9 @@ stx %o1, [%o0 + _JB_SIGFLAG] END(sigsetjmp) -ENTRY(siglongjmp) + .weak CNAME(siglongjmp); + .set CNAME(siglongjmp),CNAME(__siglongjmp); +ENTRY(__siglongjmp) PIC_PROLOGUE(%o3, %o2) SET(CNAME(longjmp), %o2, %o3) SET(CNAME(_longjmp), %o2, %o4) @@ -51,4 +53,4 @@ movrnz %o2, %o3, %o4 jmp %o4 nop -END(siglongjmp) +END(__siglongjmp) Index: libc_r/uthread/pthread_private.h =================================================================== RCS file: /ncvs/src/lib/libc_r/uthread/pthread_private.h,v retrieving revision 1.76 diff -u -r1.76 pthread_private.h --- libc_r/uthread/pthread_private.h 13 Nov 2002 18:13:26 -0000 1.76 +++ libc_r/uthread/pthread_private.h 5 Jan 2003 01:59:21 -0000 @@ -67,6 +67,7 @@ * address in a jmp_buf context. * * XXX - These need to be moved into architecture dependent support files. + * XXX - These need to be documented so porters know what's required. */ #if defined(__i386__) #define GET_STACK_JB(jb) ((unsigned long)((jb)[0]._jb[2])) @@ -101,6 +102,34 @@ (jb)[0]._jb[R_RA + 4] = (long)(ra); \ (jb)[0]._jb[R_T12 + 4] = (long)(ra); \ } while (0) +#elif defined(__sparc64__) +#include + +#define CCFSZ sizeof (struct frame) + +#define GET_STACK_JB(jb) \ + ((unsigned long)((jb)[0]._jb[_JB_SP]) + SPOFF) +#define GET_STACK_SJB(sjb) \ + ((unsigned long)((sjb)[0]._sjb[_JB_SP]) + SPOFF) +#define GET_STACK_UC(ucp) \ + ((ucp)->uc_mcontext.mc_sp + SPOFF) +/* + * XXX: sparc64 _longjmp() expects a register window on the stack + * at the given position, so we must make sure that the space where + * it is expected is readable. Subtracting the frame size here works + * because the SET_STACK macros are only used to set up new stacks + * or signal stacks, but it is a bit dirty. + */ +#define SET_STACK_JB(jb, stk) \ + (jb)[0]._jb[_JB_SP] = (long)(stk - SPOFF - CCFSZ) +#define SET_STACK_SJB(sjb, stk) \ + (sjb)[0]._sjb[_JB_SP] = (long)(stk - SPOFF - CCFSZ) +#define SET_STACK_UC(ucp, stk) \ + (ucp)->uc_mcontext.mc_sp = (unsigned long)(stk - SPOFF - CCFSZ) +#define FP_SAVE_UC(ucp) /* XXX */ +#define FP_RESTORE_UC(ucp) /* XXX */ +#define SET_RETURN_ADDR_JB(jb, ra) \ + (jb)[0]._jb[_JB_PC] = (long)(ra - 8) #else #error "Don't recognize this architecture!" #endif --- /dev/null Sun Jan 5 03:00:01 2003 +++ libc_r/arch/sparc64/_atomic_lock.S Sat Jan 4 21:46:19 2003 @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2002 Dag-Erling Coïdan Smørgrav + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +__FBSDID("$FreeBSD$"); + +/* + * long _atomic_lock(long *) + * + * Atomically acquire a lock by storing a non-zero value in its + * location, provided it is not already locked. Note that we only use + * the first byte of the location provided. + */ +ENTRY(_atomic_lock) + ldstub [%o0], %o1 + membar #LoadLoad | #StoreStore + retl + mov %o1, %o0 +END(_atomic_lock) Index: usr.sbin/Makefile =================================================================== RCS file: /ncvs/src/usr.sbin/Makefile,v retrieving revision 1.240 diff -u -r1.240 Makefile --- usr.sbin/Makefile 30 Dec 2002 10:13:16 -0000 1.240 +++ usr.sbin/Makefile 5 Jan 2003 02:29:38 -0000 @@ -135,7 +135,7 @@ iptest .endif -.if !defined(NOLIBC_R) && ${MACHINE_ARCH} != "ia64" && ${MACHINE_ARCH} != "sparc64" +.if !defined(NOLIBC_R) && ${MACHINE_ARCH} != "ia64" SUBDIR+=pppctl .endif --TakKZr9L6Hm6aLOc-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message