libvorbis patch for armel

2009-03-19 Thread Martin Guy
Of the flags that -ffast-math sets, turning -ffinite-math-only off
again avoids the erroneous optimization. With the attached patch,
libvorbis's examples/encoder_example produces the same (correct)
output as on arm-oldabi and it makes oggenc work on armel too.

 M
On armel, oggenc creates short output files that decode to the correct amount
of silence. This is caused by an optimization bug present in gcc 4.[123] that
miscompiles the MAX(x,y) macro, optimizing it away completely.
Fixes: http://bugs.debian.org/515949
Analysis: https://trac.xiph.org/ticket/1526

 Martin Guy martinw...@yahoo.it March 2009

--- libvorbis-1.2.0.dfsg/configure.in.old	2007-07-25 17:27:00.0 +0100
+++ libvorbis-1.2.0.dfsg/configure.in	2009-03-19 07:44:38.0 +
@@ -168,6 +168,12 @@
 		CFLAGS=-O20 -D__NO_MATH_INLINES -fsigned-char
 		PROFILE=-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char ;;
 esac
+
+	# Avoid an optimization bug in gcc-4.[123]
+	case $host in 
+	arm*-*-linux-gnueabi)
+		CFLAGS+= -fno-finite-math-only ;;
+	esac
 fi
 CFLAGS=$CFLAGS $cflags_save
 
--- libvorbis-1.2.0.dfsg/configure.old	2007-07-25 17:46:37.0 +0100
+++ libvorbis-1.2.0.dfsg/configure	2009-03-19 07:45:54.0 +
@@ -19484,6 +19484,12 @@
 		CFLAGS=-O20 -D__NO_MATH_INLINES -fsigned-char
 		PROFILE=-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char ;;
 esac
+
+	# Avoid an optimization bug in gcc-4.[123]
+	case $host in 
+	arm*-*-linux-gnueabi)
+		CFLAGS+= -fno-finite-math-only ;;
+	esac
 fi
 CFLAGS=$CFLAGS $cflags_save
 


Re: GCC bug when -ffast-math is set on armel

2009-03-19 Thread Riku Voipio
On Thu, Mar 19, 2009 at 09:40:47AM +, Martin Guy wrote:
   I thought I should mention this here too in case anyone else gets
 bitten by this armel-specific bug.

A GCC bug has just turned up that affects the arm-*-gnueabi
 architecture in gcc-4.[123]. While debugging libvorbisenc (which
 produces silent output files on armel), it turns out that when -O
 -ffast-math are set, GCC can produce incorrect code for the max(x,y)
 macro applied to floating point values.

Thanks for finding this out. Has a bug been filed to the GCC bugtracker?

   Thanks to Erik de Castro Lopo for some incisive debugging and for
 producing a minimal example (should print 0 0 but doesn't)
 
 /*
 **This file is in the Public Domain.
 **
 **This program demonstrates a bug in the -ffast-math option of the gcc
 **armel compiler : gcc version 4.3.2 (Debian 4.3.2-1.1)
 **
 **This works as expected:
 **
 ** gcc -Wall -O3 gcc-test.c -o gcc-test  ./gcc-test
 **min :   0.max :   0.
 **
 **Compile with -ffast-math and things goes screwy.
 **
 ** gcc -Wall -O3 -ffast-math gcc-test.c -o gcc-test  ./gcc-test
 **min :   9.max :   0.
 */
 
 #include stdio.h
 
 #define   COUNT   10
 
 #define test_max(x,y)   ((x)   (y) ? (y) : (x))
 #define test_min(x,y)   ((x)   (y) ? (y) : (x))
 
 int
 main (void)
 { /* C Standard says static data gets initialized to zero. */
   static float data [COUNT] ;
   float max = -9.0, min = 9.0 ;
   int k ;
 
   for (k = 0 ; k  COUNT ; k++)
   {   max = test_max (max, data [k]) ;
   min = test_min (min, data [k]) ;
   } ;
 
   printf (min : %12.4fmax : %12.4f\n, min, max) ;
 
   return 0 ;
 }
 
 Full details at http://bugs.debian.org/515949
 
  M
 
 
 -- 
 To UNSUBSCRIBE, email to debian-arm-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

-- 
rm -rf only sounds scary if you don't have backups


-- 
To UNSUBSCRIBE, email to debian-arm-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: GCC bug when -ffast-math is set on armel

2009-03-19 Thread Martin Guy
 Thanks for finding this out. Has a bug been filed to the GCC bugtracker?

You're welcome, and yes: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501

 M


-- 
To UNSUBSCRIBE, email to debian-arm-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



RE: GCC bug when -ffast-math is set on armel

2009-03-19 Thread David Rusling
We're working on a fix


David A Rusling, ARM Fellow
Processor Division Tools
ARM Limited
110 Fulbourn Road, Cambridge, CB1 9NJ
Tel: +44 1223 400424


 -Original Message-
 From: martinw...@gmail.com [mailto:martinw...@gmail.com] On Behalf Of
 Martin Guy
 Sent: Thursday, March 19, 2009 4:35 PM
 To: Riku Voipio
 Cc: debian-arm@lists.debian.org
 Subject: Re: GCC bug when -ffast-math is set on armel
 
  Thanks for finding this out. Has a bug been filed to the GCC
bugtracker?
 
 You're welcome, and yes:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39501
 
  M
 
 
 --
 To UNSUBSCRIBE, email to debian-arm-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact
 listmas...@lists.debian.org

-- 
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.


--
To UNSUBSCRIBE, email to debian-arm-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: GCC bug when -ffast-math is set on armel

2009-03-19 Thread Martin Guy
In case anyone's in a hurry for a working oggenc (libvorbis) or lame
on armel, I've dumped fixed
packages under
http://martinwguy.co.uk/martin/debian/no-finite-math-only
I haven't changed the version numbers on the packages, so you need to
download and dpkg -i them and they will get replaced automatically
by the fixed mainline versions when they are ready and you next
upgrade.

 M


-- 
To UNSUBSCRIBE, email to debian-arm-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



NSLU2 Lenny install problem

2009-03-19 Thread MagnusP

Hi,

I have tried to install Debian Lenny on my second NSLU2 using a USB stick. I
followed the instructions here: http://www.cyrius.com/debian/nslu2/
During boot the following error is seen on the serial console:

[42949405.56] sd 0:0:0:0: [sda] Result: hostbyte=0x01 driverbyte=0x00
[42949405.57] end_request: I/O error, dev sda, sector 1246395
[42949405.57] sd 0:0:0:0: [sda] Result: hostbyte=0x01 driverbyte=0x00
[42949405.58] end_request: I/O error, dev sda, sector 1225939
[42949405.59] EXT3-fs error (device sda2): ext3_find_entry: reading
directory #24327 offset 0
[42949405.61] EXT3-fs error (device sda2): ext3_find_entry: reading
directory #24825 offset 0
[42949405.63] EXT3-fs error (device sda2): ext3_find_entry: reading
directory #24001 offset 0
[42949405.64] EXT3-fs error (device sda2): ext3_find_entry: reading
directory #24325 offset 0
[42949405.65] EXT3-fs error (device sda2): ext3_find_entry: reading
directory #8001 offset 0
[42949405.67] EXT3-fs error (device sda2): ext3_find_entry: reading
directory #24690 offset 0
[42949405.69] EXT3-fs error (device sda2): ext3_find_entry: reading
directory #24690 offset 0
[42949405.70] ehci_hcd :00:01.2: USB 2.0 started, EHCI 1.00, driver
10 Dec 2004
[42949405.70] usb usb3: configuration #1 chosen from 1 choice

I have tried using a second USB stick with the same result.

Any ideas are welcome!

/Magnus

See full console log here:
http://www.nabble.com/file/p22608464/capture.TXT capture.TXT 
-- 
View this message in context: 
http://www.nabble.com/NSLU2-Lenny-install-problem-tp22608464p22608464.html
Sent from the debian-arm mailing list archive at Nabble.com.


-- 
To UNSUBSCRIBE, email to debian-arm-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org