From owner-freebsd-amd64@FreeBSD.ORG Mon Aug 13 11:08:11 2007 Return-Path: Delivered-To: freebsd-amd64@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6370416A496 for ; Mon, 13 Aug 2007 11:08:11 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 520D613C428 for ; Mon, 13 Aug 2007 11:08:11 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l7DB8Bi3047604 for ; Mon, 13 Aug 2007 11:08:11 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l7DB89l1047600 for freebsd-amd64@FreeBSD.org; Mon, 13 Aug 2007 11:08:10 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 13 Aug 2007 11:08:10 GMT Message-Id: <200708131108.l7DB89l1047600@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-amd64@FreeBSD.org X-Mailman-Approved-At: Mon, 13 Aug 2007 11:21:37 +0000 Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2007 11:08:11 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o amd64/89202 amd64 [ufs] [panic] Kernel crash when accessing filesystem w o amd64/112222 amd64 [libc] 32-bit libc incorrectly converts some FP number 2 problems total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o amd64/73322 amd64 [msdosfs] [hang] unarchiving /etc to msdosfs locks up o amd64/74747 amd64 System panic on shutdown when process will not die o amd64/76136 amd64 system halts before reboot o amd64/78406 amd64 [panic]AMD64 w/ SCSI: issue 'rm -r /usr/ports' and sys o amd64/80691 amd64 amd64 kernel hangs on load o amd64/82425 amd64 [fxp] fxp0: device timeout, fxp interface dies on 5.4/ o amd64/85451 amd64 [hang] 6.0-BETA3 lockups on AMD64 (PREEMPTION only) o amd64/86080 amd64 [radeon] [hang] radeon DRI causes system hang on amd64 o amd64/87258 amd64 [smp] [boot] cannot boot with SMP and Areca ARC-1160 r o amd64/87305 amd64 [smp] Dual Opteron / FreeBSD 5 & 6 / powerd results in o amd64/87316 amd64 [vge] "vge0 attach returned 6" on FreeBSD 6.0-RC1 amd6 o amd64/87689 amd64 [powerd] [hang] powerd hangs SMP Opteron 244 5-STABLE o amd64/87977 amd64 [busdma] [panic] amd64 busdma dflt_lock called (by ata o amd64/88568 amd64 [panic] 6.0-RELEASE install cd does not boot with usb o amd64/88790 amd64 kernel panic on first boot (after the FreeBSD installa o amd64/89501 amd64 System crashes on install using ftp on local subnet o amd64/89503 amd64 Cant Boot Installation Disk o amd64/89546 amd64 [geom] GEOM error o amd64/91405 amd64 [asr] [panic] Kernel panic caused by asr on 6.0-amd64 o amd64/91492 amd64 BTX halted o amd64/92337 amd64 [em] FreeBSD 6.0 Release Intel Pro 1000 MT em1 no buff o amd64/92889 amd64 [libc] xdr double buffer overflow o amd64/93961 amd64 [busdma] Problem in bounce buffer handling in sys/amd6 o amd64/94677 amd64 panic in amd64 install at non-root user creation o amd64/94989 amd64 BTX Halts on Sun Fire X2100 w/6.1-BETA4 (amd64) and 5. f amd64/95414 amd64 kernel crashes during install o amd64/95888 amd64 kernel: ad2: TIMEOUT - WRITE_DMA retrying on HP DL140G a amd64/96981 amd64 reproducible instant reboot by unprivileged user o amd64/97075 amd64 Panic, Trap 12 o amd64/97337 amd64 [dri] xorg reboots system if dri module is enabled o amd64/102122 amd64 6.1-RELEASE amd64 Install Media panics on boot. s amd64/104311 amd64 ports/wine should be installable on amd64 o amd64/105514 amd64 FreeBSD/amd64 - Fails to boot on HP Pavilion dv8000 La o amd64/105531 amd64 [sata] gigabyte GA-M51GM-S2G / nVidia nForce 430 - doe o amd64/105629 amd64 [re] TrendNet TEG-BUSR 10/100/1000 disables itself on o amd64/106604 amd64 saslauthd crashes with signal 6 on FreeBSD 6.2-PREREL o amd64/106918 amd64 [re] Asus P5B with internal RealTek PCIe Ethernet gets o amd64/108861 amd64 [nve] nve(4) driver on FreeBSD 6.2 AMD64 does not work f amd64/109584 amd64 zdump doesn't work o amd64/110655 amd64 [threads] 32 bit threaded applications crash on amd64 o amd64/111955 amd64 [install] Install CD boot panic due to missing BIOS sm o amd64/111992 amd64 BTX failed - HP Laptop dv2315nr s gnu/112215 amd64 [patch] gcc(1): "gcc -m32" attempts to link against 64 o amd64/112677 amd64 [aac] Adaptec 4805SAS causes 6.2 (AMD64) to panic (amd f amd64/112828 amd64 Complete data loss after upgrade 6.1 -> 6.2 (Amd64) o amd64/113021 amd64 [re] ASUS M2A-VM onboard NIC does not work o amd64/114111 amd64 [nfs] System crashes while writing on NFS-mounted shar o amd64/115194 amd64 LCD screen remains blank after Dell XPS M1210 lid is c 48 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o amd64/74608 amd64 [mpt] [hang] mpt hangs 5 minutes when booting o amd64/74811 amd64 [nfs] df, nfs mount, negative Avail -> 32/64-bit confu s amd64/85273 amd64 FreeBSD (NetBSD or OpenBSD) not install on laptop Comp o amd64/88730 amd64 kernel panics during booting from the installation CD o amd64/91195 amd64 FreeBSD 6.0(amd64) and Asus A8R-MVP a amd64/93002 amd64 amd64 (6.0) coredumps at unpredictable times a amd64/93090 amd64 [nve] NIC on GA-K8NF-9 motherboard is recognized, but o amd64/97489 amd64 [ata] nForce 410 ATA controller dma time out (ASUS K8N o amd64/100326 amd64 [fdc] /dev/fd0 not created after installation FreeBSD o amd64/100838 amd64 [powerd] FreeBSD 6.0/6.1 kernel panics when booting wi f amd64/101132 amd64 [smp] Incorrect cpu idle and usage statistics in top a o amd64/102716 amd64 ex with no argument in an xterm gets SIGSEGV o amd64/103259 amd64 [ar] Cannot use ataraid on nvidia nForce4+amd64 o amd64/106186 amd64 [panic] panic in swap_pager_swap_init (amd64/smp/6.2-p o amd64/107858 amd64 ASRock Conroe-945G-DVI motherboard: non-working sound f amd64/108345 amd64 6.2-* GENERIC will not boot Intel PD EMT64 w/ ACPI o amd64/110599 amd64 [geli] geli attach to gmirror device hangs and cannot o amd64/111096 amd64 motherboard ASRock AM2NF6G-VSTA not supported f amd64/113111 amd64 Potentially wrong instructions will be produced for EM o amd64/114270 amd64 [cpufreq] cpufreq doesnt work when compiled in to kern 20 problems total. From owner-freebsd-amd64@FreeBSD.ORG Mon Aug 13 20:54:28 2007 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 968F216A417; Mon, 13 Aug 2007 20:54:28 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 83B1B13C465; Mon, 13 Aug 2007 20:54:28 +0000 (UTC) (envelope-from kris@obsecurity.org) Received: from rot26.obsecurity.org (elvis.mu.org [192.203.228.196]) by elvis.mu.org (Postfix) with ESMTP id C61781A4D7C; Mon, 13 Aug 2007 13:53:08 -0700 (PDT) Received: by rot26.obsecurity.org (Postfix, from userid 1001) id AF8EDBB9E; Mon, 13 Aug 2007 16:54:27 -0400 (EDT) Date: Mon, 13 Aug 2007 16:54:27 -0400 From: Kris Kennaway To: John Baldwin Message-ID: <20070813205427.GA1368@rot26.obsecurity.org> References: <20070625191118.U24808@fw.reifenberger.com> <20070729181507.GA85534@rot26.obsecurity.org> <200708131635.05514.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708131635.05514.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-amd64@freebsd.org, Kris Kennaway Subject: Re: i386-RELENG_6 jail under amd64-current? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2007 20:54:28 -0000 On Mon, Aug 13, 2007 at 04:35:05PM -0400, John Baldwin wrote: > On Sunday 29 July 2007 02:15:07 pm Kris Kennaway wrote: > > On Mon, Jun 25, 2007 at 07:24:50PM +0200, Michael Reifenberger wrote: > > > Hi, > > > has anybody managed to set up an jail under amd64-current (64bit) > > > which runs i386-RELENG_6 (32bit) binaries. > > > > > > My intention would be to compile 32bit ports on the bigger 64bit box too. > > > > > > When trying I get messages about missing shared libs... > > > > Either just symlink lib32 where the linker is looking for them, or set > > the LD_32_LIBRARY_PATH or similar. It would be nice if the rtld > > recognized it was living in an i386 world automatically. > > You could try copying an i386 /libexec/ld-elf.so.1 to /libexec/ld-elf32.so.1 > inside the chroot. Come to think of it that might have been the solution I used. Kris From owner-freebsd-amd64@FreeBSD.ORG Mon Aug 13 21:00:34 2007 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E2C316A41B for ; Mon, 13 Aug 2007 21:00:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 3362813C48A for ; Mon, 13 Aug 2007 21:00:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8k) with ESMTP id 203155193-1834499 for multiple; Mon, 13 Aug 2007 16:53:04 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l7DKhCPd016648; Mon, 13 Aug 2007 16:43:12 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-amd64@freebsd.org Date: Mon, 13 Aug 2007 16:35:05 -0400 User-Agent: KMail/1.9.6 References: <20070625191118.U24808@fw.reifenberger.com> <20070729181507.GA85534@rot26.obsecurity.org> In-Reply-To: <20070729181507.GA85534@rot26.obsecurity.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200708131635.05514.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 13 Aug 2007 16:43:12 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3947/Mon Aug 13 11:25:28 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Kris Kennaway Subject: Re: i386-RELENG_6 jail under amd64-current? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2007 21:00:34 -0000 On Sunday 29 July 2007 02:15:07 pm Kris Kennaway wrote: > On Mon, Jun 25, 2007 at 07:24:50PM +0200, Michael Reifenberger wrote: > > Hi, > > has anybody managed to set up an jail under amd64-current (64bit) > > which runs i386-RELENG_6 (32bit) binaries. > > > > My intention would be to compile 32bit ports on the bigger 64bit box too. > > > > When trying I get messages about missing shared libs... > > Either just symlink lib32 where the linker is looking for them, or set > the LD_32_LIBRARY_PATH or similar. It would be nice if the rtld > recognized it was living in an i386 world automatically. You could try copying an i386 /libexec/ld-elf.so.1 to /libexec/ld-elf32.so.1 inside the chroot. -- John Baldwin From owner-freebsd-amd64@FreeBSD.ORG Tue Aug 14 06:15:16 2007 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FCE116A41A for ; Tue, 14 Aug 2007 06:15:16 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 397B713C442 for ; Tue, 14 Aug 2007 06:15:16 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id CAB7920B5; Tue, 14 Aug 2007 07:57:21 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.2.1 (2007-05-02) on tim.des.no Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 4E2DB208A; Tue, 14 Aug 2007 07:57:21 +0200 (CEST) Received: by ds4.des.no (Postfix, from userid 1001) id 36C0184462; Tue, 14 Aug 2007 07:57:21 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin References: <20070625191118.U24808@fw.reifenberger.com> <20070729181507.GA85534@rot26.obsecurity.org> <200708131635.05514.jhb@freebsd.org> Date: Tue, 14 Aug 2007 07:57:21 +0200 In-Reply-To: <200708131635.05514.jhb@freebsd.org> (John Baldwin's message of "Mon\, 13 Aug 2007 16\:35\:05 -0400") Message-ID: <86eji6irpa.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-amd64@freebsd.org, Kris Kennaway Subject: Re: i386-RELENG_6 jail under amd64-current? X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 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 Aug 2007 06:15:16 -0000 John Baldwin writes: > On Sunday 29 July 2007 02:15:07 pm Kris Kennaway wrote: > > On Mon, Jun 25, 2007 at 07:24:50PM +0200, Michael Reifenberger wrote: > > > has anybody managed to set up an jail under amd64-current (64bit) > > > which runs i386-RELENG_6 (32bit) binaries. > > Either just symlink lib32 where the linker is looking for them, or set > > the LD_32_LIBRARY_PATH or similar. It would be nice if the rtld > > recognized it was living in an i386 world automatically. > You could try copying an i386 /libexec/ld-elf.so.1 to /libexec/ld-elf32.s= o.1=20 > inside the chroot. Or just symlinking it; works fine for me. I was even able to upgrade the chroot from source (from within itself) by adding MACHINE=3Di386 and MACHINE_ARCH=3Di386 to /etc/make.conf and using the following patch: Index: Makefile.inc1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.584 diff -u -r1.584 Makefile.inc1 --- Makefile.inc1 10 Jul 2007 10:19:45 -0000 1.584 +++ Makefile.inc1 29 Jul 2007 19:23:35 -0000 @@ -143,6 +143,9 @@ .endif .if make(buildworld) BUILD_ARCH!=3D uname -p +.if ${MACHINE_ARCH} =3D=3D i386 && ${BUILD_ARCH} =3D=3D amd64 +BUILD_ARCH=3D i386 +.endif .if ${MACHINE_ARCH} !=3D ${BUILD_ARCH} .error To cross-build, set TARGET_ARCH. .endif In my case, the chroot is actually the NFS-exported file system for my diskless crash boxen (which are the only 32-bit systems I have left) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-amd64@FreeBSD.ORG Wed Aug 15 06:38:41 2007 Return-Path: Delivered-To: freebsd-amd64@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D406F16A417; Wed, 15 Aug 2007 06:38:41 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.freebsd.org (Postfix) with ESMTP id 8DC1413C468; Wed, 15 Aug 2007 06:38:41 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1ILCWd-0002bp-OZ; Wed, 15 Aug 2007 09:38:39 +0300 X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.2 To: am-utils@fsl.cs.sunysb.edu In-reply-to: Your message of Mon, 06 Aug 2007 13:40:59 +0300 . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 15 Aug 2007 09:38:39 +0300 From: Danny Braniss Message-ID: Cc: freebsd-current@FreeBSD.org, freebsd-amd64@FreeBSD.org Subject: Re: amd crashes when memory is low X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2007 06:38:42 -0000 > > Hi, > > This is not new, but now that freebsd current is almost out, I'm > > trying it out again. amd (am-utils version 6.1.5) on an amd64 will crash when > > vm memory is low. In the past it was suggested to add 'plock=no' to > > /etc/amd.conf, but I have to check if it's read since I still see: > > Couldn't lock process pages in memory using mlockall(): \ > > Resource temporarily unavailable > > > > I'll try it out under i386 and report later. > > ok, it works under i386, because mlockall() does not fail, and hence > amd is locked in core, while it failes under amd64. this does not explain > why it crashes when swapped out, but that is another problem? > to the am-utils maintainers: changing the call to mlockall, from mlockall(MCL_FUTURE|MCL_CURRENT) to mlockall(MCL_FUTURE) solves the problem. danny From owner-freebsd-amd64@FreeBSD.ORG Thu Aug 16 16:50:02 2007 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 362A616A41B for ; Thu, 16 Aug 2007 16:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1506A13C4A3 for ; Thu, 16 Aug 2007 16:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l7GGo1AJ052995 for ; Thu, 16 Aug 2007 16:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l7GGo13e052994; Thu, 16 Aug 2007 16:50:01 GMT (envelope-from gnats) Resent-Date: Thu, 16 Aug 2007 16:50:01 GMT Resent-Message-Id: <200708161650.l7GGo13e052994@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Simun Mikecin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50C7016A418 for ; Thu, 16 Aug 2007 16:42:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3FF5713C428 for ; Thu, 16 Aug 2007 16:42:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l7GGg078056253 for ; Thu, 16 Aug 2007 16:42:00 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l7GGg0Vu056249; Thu, 16 Aug 2007 16:42:00 GMT (envelope-from nobody) Message-Id: <200708161642.l7GGg0Vu056249@www.freebsd.org> Date: Thu, 16 Aug 2007 16:42:00 GMT From: Simun Mikecin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Thu, 16 Aug 2007 17:01:41 +0000 Cc: Subject: amd64/115581: [fix] -mfancy-math-387 has no effect X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Aug 2007 16:50:02 -0000 >Number: 115581 >Category: amd64 >Synopsis: [fix] -mfancy-math-387 has no effect >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 16 16:50:01 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Simun Mikecin >Release: FreeBSD/amd64 7-CURRENT >Organization: >Environment: >Description: 32-bit compatibility libraries on FreeBSD/amd64 are compiled using -mfancy-math-387 gcc option. As stated in gcc(1): -mno-fancy-math-387 Some 387 emulators do not support the "sin", "cos" and "sqrt" instructions for the 387. Specify this option to avoid generating those instructions. This option is the default on FreeBSD, OpenBSD and NetBSD. This option is overridden when -march indicates that the target cpu will always have an FPU and so the instruction will not need emulation. As of revision 2.6.1, these instructions are not generated unless you also use the -funsafe-math-optimizations switch. So, using just -mfancy-math-387 has no effect. It should be used in combination with -funsafe-math-optimizations or it should not be used. >How-To-Repeat: double test(double x) { return sin(x); } Try to compile using: gcc -m32 -S -mfancy-math-387 -funsafe-math-optimizations -O2 -march=athlon64 test.c and with: gcc -m32 -S -mfancy-math-387 -O2 -march=athlon64 test.c There will be a difference in assembler output. First one will use machine instruction 'fsin' and the second one will use a libm routine called 'sin'. >Fix: Patch attached with submission follows: --- Makefile.inc1.orig Tue Jul 10 18:39:36 2007 +++ Makefile.inc1 Thu Aug 16 18:30:44 2007 @@ -238,7 +238,7 @@ .else LIB32CPUTYPE= ${TARGET_CPUTYPE} .endif -LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \ +LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -funsafe-math-optimizations -DCOMPAT_32BIT \ -iprefix ${LIB32TMP}/usr/ \ -L${LIB32TMP}/usr/lib32 \ -B${LIB32TMP}/usr/lib32 >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-amd64@FreeBSD.ORG Fri Aug 17 06:50:08 2007 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 844F616A468 for ; Fri, 17 Aug 2007 06:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 711AC13C45A for ; Fri, 17 Aug 2007 06:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l7H6o8eC004279 for ; Fri, 17 Aug 2007 06:50:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l7H6o8uR004278; Fri, 17 Aug 2007 06:50:08 GMT (envelope-from gnats) Date: Fri, 17 Aug 2007 06:50:08 GMT Message-Id: <200708170650.l7H6o8uR004278@freefall.freebsd.org> To: freebsd-amd64@FreeBSD.org From: Bruce Evans Cc: Subject: Re: amd64/115581: [fix] -mfancy-math-387 has no effect X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Bruce Evans List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Aug 2007 06:50:08 -0000 The following reply was made to PR amd64/115581; it has been noted by GNATS. From: Bruce Evans To: Simun Mikecin Cc: freebsd-gnats-submit@freebsd.org, freebsd-amd64@freebsd.org Subject: Re: amd64/115581: [fix] -mfancy-math-387 has no effect Date: Fri, 17 Aug 2007 16:49:04 +1000 (EST) On Thu, 16 Aug 2007, Simun Mikecin wrote: >> Description: > 32-bit compatibility libraries on FreeBSD/amd64 are compiled using -mfancy-math-387 gcc option. As stated in gcc(1): > > -mno-fancy-math-387 > Some 387 emulators do not support the "sin", "cos" and "sqrt" > instructions for the 387. Specify this option to avoid generating > those instructions. This option is the default on FreeBSD, OpenBSD > and NetBSD. This option is overridden when -march indicates that > the target cpu will always have an FPU and so the instruction will > not need emulation. As of revision 2.6.1, these instructions are > not generated unless you also use the -funsafe-math-optimizations > switch. > > So, using just -mfancy-math-387 has no effect. It should be used in combination with -funsafe-math-optimizations or it should not be used. It should not be used, especially on amd64 systems since basic FP instructions are relatively fast compared with the fancy instructions (except for sqrt). The 64-bit amd64 libm intentionally never uses the fancy instructions (except for sqrt), partly because they are not much faster and partly because they are much less accurate. The fancy instructions are not used for float precision (unless you pessimize things using -mfancy-math-387) since they are about 3 times slower than the library versions on small args. Is -mno-fancy-math-387 still actually the default on FreeBSD (with FreeBSD's config/i386/freebsd.h which is quite different (mostly gratuitously different) from the distribution one)? FreeBSD hasn't supported the math emulator for about 10 years. > --- Makefile.inc1.orig Tue Jul 10 18:39:36 2007 > +++ Makefile.inc1 Thu Aug 16 18:30:44 2007 > @@ -238,7 +238,7 @@ > .else > LIB32CPUTYPE= ${TARGET_CPUTYPE} > .endif > -LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \ > +LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -funsafe-math-optimizations -DCOMPAT_32BIT \ > -iprefix ${LIB32TMP}/usr/ \ > -L${LIB32TMP}/usr/lib32 \ > -B${LIB32TMP}/usr/lib32 -unsafe-math-optimizations should be named -broken-floating-point-optimizations and should almost never be used. It should never be used for compiling FreeBSD's math library, since the library depends on floating point not being very broken. gcc-4.2 still says the above, but doesn't actually do the above for sqrt. It inlines sqrt (but not cos or sin) without -funsafe-math-optimizations. I think the difference is just due to inlining sqrt not actually being unsafe and the documentation of -ffancy-math-387 being many years out of date (this difference is not new). Inlining cos and sin would be safe if the inline code were large enough to detect the unsafe cases, but the inline code only checks for the result being a NaN (?), which is more than enough for sqrt but not enough for cos or sin. gcc (at least in 4.2) has a -fno-math-errno option which defaults to the wrong thing for FreeBSD (-fmath-errno) but the correct think on Darwin. -funsafe-math-optimizations apparently has the apparently-undocumented effect of turning off on -fno-math-errno. So -march=pentium4 gives the following inlining of the fancy functions: Default: sqrt: inlined, bogus errno handing cos, sin: not inlined with -fno-math-errno: sqrt: inlined, optimal cos, sin: not inlined with -funsafe-math-optimizations: sqrt: inlined, optimal cos, sin: inlined, broken (additional breakage only for large args) cosf: inlined, optimal cosf, sinf: inlined, broken (for large args, and small args near a multiple of pi/2), pessimized (only for small args) Bruce From owner-freebsd-amd64@FreeBSD.ORG Fri Aug 17 20:56:44 2007 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0108216A418 for ; Fri, 17 Aug 2007 20:56:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx03.syd.optusnet.com.au (fallbackmx03.syd.optusnet.com.au [211.29.133.136]) by mx1.freebsd.org (Postfix) with ESMTP id 8D12113C478 for ; Fri, 17 Aug 2007 20:56:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by fallbackmx03.syd.optusnet.com.au (8.12.11.20060308/8.12.11) with ESMTP id l7H6nEfT012276 for ; Fri, 17 Aug 2007 16:49:14 +1000 Received: from c220-239-235-248.carlnfd3.nsw.optusnet.com.au (c220-239-235-248.carlnfd3.nsw.optusnet.com.au [220.239.235.248]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id l7H6n4xH009632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Aug 2007 16:49:06 +1000 Date: Fri, 17 Aug 2007 16:49:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Simun Mikecin In-Reply-To: <200708161642.l7GGg0Vu056249@www.freebsd.org> Message-ID: <20070817150656.V27406@delplex.bde.org> References: <200708161642.l7GGg0Vu056249@www.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-gnats-submit@freebsd.org, freebsd-amd64@freebsd.org Subject: Re: amd64/115581: [fix] -mfancy-math-387 has no effect X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Aug 2007 20:56:44 -0000 On Thu, 16 Aug 2007, Simun Mikecin wrote: >> Description: > 32-bit compatibility libraries on FreeBSD/amd64 are compiled using -mfancy-math-387 gcc option. As stated in gcc(1): > > -mno-fancy-math-387 > Some 387 emulators do not support the "sin", "cos" and "sqrt" > instructions for the 387. Specify this option to avoid generating > those instructions. This option is the default on FreeBSD, OpenBSD > and NetBSD. This option is overridden when -march indicates that > the target cpu will always have an FPU and so the instruction will > not need emulation. As of revision 2.6.1, these instructions are > not generated unless you also use the -funsafe-math-optimizations > switch. > > So, using just -mfancy-math-387 has no effect. It should be used in combination with -funsafe-math-optimizations or it should not be used. It should not be used, especially on amd64 systems since basic FP instructions are relatively fast compared with the fancy instructions (except for sqrt). The 64-bit amd64 libm intentionally never uses the fancy instructions (except for sqrt), partly because they are not much faster and partly because they are much less accurate. The fancy instructions are not used for float precision (unless you pessimize things using -mfancy-math-387) since they are about 3 times slower than the library versions on small args. Is -mno-fancy-math-387 still actually the default on FreeBSD (with FreeBSD's config/i386/freebsd.h which is quite different (mostly gratuitously different) from the distribution one)? FreeBSD hasn't supported the math emulator for about 10 years. > --- Makefile.inc1.orig Tue Jul 10 18:39:36 2007 > +++ Makefile.inc1 Thu Aug 16 18:30:44 2007 > @@ -238,7 +238,7 @@ > .else > LIB32CPUTYPE= ${TARGET_CPUTYPE} > .endif > -LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -DCOMPAT_32BIT \ > +LIB32FLAGS= -m32 -march=${LIB32CPUTYPE} -mfancy-math-387 -funsafe-math-optimizations -DCOMPAT_32BIT \ > -iprefix ${LIB32TMP}/usr/ \ > -L${LIB32TMP}/usr/lib32 \ > -B${LIB32TMP}/usr/lib32 -unsafe-math-optimizations should be named -broken-floating-point-optimizations and should almost never be used. It should never be used for compiling FreeBSD's math library, since the library depends on floating point not being very broken. gcc-4.2 still says the above, but doesn't actually do the above for sqrt. It inlines sqrt (but not cos or sin) without -funsafe-math-optimizations. I think the difference is just due to inlining sqrt not actually being unsafe and the documentation of -ffancy-math-387 being many years out of date (this difference is not new). Inlining cos and sin would be safe if the inline code were large enough to detect the unsafe cases, but the inline code only checks for the result being a NaN (?), which is more than enough for sqrt but not enough for cos or sin. gcc (at least in 4.2) has a -fno-math-errno option which defaults to the wrong thing for FreeBSD (-fmath-errno) but the correct think on Darwin. -funsafe-math-optimizations apparently has the apparently-undocumented effect of turning off on -fno-math-errno. So -march=pentium4 gives the following inlining of the fancy functions: Default: sqrt: inlined, bogus errno handing cos, sin: not inlined with -fno-math-errno: sqrt: inlined, optimal cos, sin: not inlined with -funsafe-math-optimizations: sqrt: inlined, optimal cos, sin: inlined, broken (additional breakage only for large args) cosf: inlined, optimal cosf, sinf: inlined, broken (for large args, and small args near a multiple of pi/2), pessimized (only for small args) Bruce