[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#212912: gcc-3.3: [alpha] Linux linker/loader does not support -mieee-conformant



Package: gcc-3.3
Version: 1:3.3.2-0pre4
Severity: normal
Tags: patch

DEC Unix provides both IEEE conformant and IEEE nonconformant
libraries, and links against the appropriate libraries based on the
setting of eflag 48 (set implicitly by specifying -mieee or explicitly
by specifying -mieee-conformant).

Linux neither supports linking based on eflag 48, nor does it provide
IEEE nonconformant libraries (the GNU math libraries are conformant,
and the maintainers/developers seem to have no intent of ever
releasing a special nonconformant version for the Alpha).  As a
result, under Linux (and any other GNU based system), programs must be
IEEE conformant (compiled with -mieee) in order to work with the
system libraries in all circumstances.

This fact is frequently overlooked (or not known) by most package
maintainers, and has result in numerous packages that SIGFPE for no
apparent reason.  Well many of these packages can be 'fixed' (and
several have been) by adding a lines to the effect of

ifeq ($(DEB_TARGET_ARCH),alpha)
  CFLAGS += -mieee 
  CXXFLAGS += -mieee
endif

to the appropriate package's debian/rules file, this is not really a
satisfactory solution.  It creates a situation where users of the
Debian Alpha distribution are continuously having to file yet another
Alpha SIGFPE bug against some new package.

In reality, the real problem is that GCC's defaults, not generating
IEEE conformant code, do not match Linux's defaults, IEEE conformant
libraries.  The easiest way to rectify this situation is to change
GCC's default behavior.

Attached is a dpatch file that does this, updates the documentation,
and adds a switch (-mno-ieee) to make it possible to still generate
IEEE nonconformant code for those who desire to do so.  In addition to
adding it to the debian/patches directory, the Alpha specific section
of debian/rules.patch has to be modified to include it

ifeq ($(DEB_TARGET_ARCH),alpha)
  debian_patches += alpha-ieee
endif

The very very few apps whos performance this impacts negatively
(possibly the FFTW libraries, not LAPACK of BLAS though, they require
IEEE conformance) can have full performance restored by updating the
Alpha specific portion of their debian/rules file to include the
-mno-ieee flag.  This represents significantly less work (by several
orders of magnitude) then the current practice of continually having
to add the -mieee flag all the other packages. :)


NOTES ON PERFORMANCE IMPACT:
Obviously this will not 'break' existing applications.  Less obvious
is that it does not impose a serious performance penalty on pre-EV6
architectures for the vast majority of applications.

Testing on an Alpha EV56 CPU reveals that intensive tightly looped
math operations [FFT transforms] run at most 20% slower, while
intensive numerical simulations [Molecular Dynamics, MC Option
pricing] run between 1% to 5% slower.  The effect on other
applications (i.e. 99.99% of packages) is not measurable.


SOME BROKEN COMMON APPLICATIONS CURRENTLY NOT COMPILED WITH -mieee:
python: type 1e-320 at the prompt
kspread: type =erfc(27) in a cell
mpg321: play a mp3 file back through the ARTS backend
konqueror: goto http://news.independent.co.uk

A quick scan of the /usr/lib on a local Beowulf cluster reveals just
how wide spread the requirement for -mieee is.  Of the 589 installed
libraries in /usr/lib that use the FPU, only 98 have have not been
compiled with -mieee.  Of all the numerics relates libraries installed
(LAPACK, BLAS, etc), the only one compiled without -mieee is the GNU
multi-precision library


-- System Information:
Debian Release: testing/unstable
Architecture: alpha
Kernel: Linux whitehead 2.4.21 #26 Wed Jun 25 12:35:13 EDT 2003 alpha
Locale: LANG=C, LC_CTYPE=C

Versions of packages gcc-3.3 depends on:
ii  binutils                   2.14.90.0.6-2 The GNU assembler, linker and bina
ii  cpp-3.3                    1:3.3.2-0pre4 The GNU C preprocessor
ii  gcc-3.3-base               1:3.3.2-0pre4 The GNU Compiler Collection (base 
ii  libc6.1                    2.3.2-8       GNU C Library: Shared libraries an
ii  libgcc1                    1:3.3.2-0pre4 GCC support library

-- no debconf information

Attachment: /usr/src/alpha-ieee.dpatch
Description: application/shellscript


Reply to: