[erlang-questions] Checking for FPE on glibc 2.7

Sergei Golovan sgolovan@REDACTED
Tue Jan 1 11:57:27 CET 2008


Hi!

When building Erlang/OTP R12-B using glibc 2.7 (Debian GNU/Linux on
x86 architecture) I've noticed that checking floating point exceptions
fails, making HiPE build unavailable.

Looking closer at the checking rotines shows the following
compile-time error messages:

% gcc fpe-test-12.c
In file included from /usr/include/asm/sigcontext.h:7,
                 from fpe-test-12.c:268:
/usr/include/asm-i386/sigcontext.h:19: error: redefinition of 'struct _fpreg'
/usr/include/asm-i386/sigcontext.h:24: error: redefinition of 'struct _fpxreg'
/usr/include/asm-i386/sigcontext.h:30: error: redefinition of 'struct _xmmreg'
/usr/include/asm-i386/sigcontext.h:34: error: redefinition of 'struct _fpstate'
/usr/include/asm-i386/sigcontext.h:58: error: redefinition of 'struct
sigcontext'

Appears that in glibc 2.7 file /usr/include/bits/sigcontext.h already
contains the definitions of these structures.

But simple commenting out "#include <asm/sigcontext.h>" in line 268
doesn't help because it leaves X86_FXSR_MAGIC undefined. After
replacing it by 0x0000 (its definition from sigcontext.h) all works
fine. Moreover, the changed test works in older glibc as well.

Could someone look into this problem and help me to resolve this issue
properly? Or my changes are acceptable?

Cheers!
-- 
Sergei Golovan



More information about the erlang-questions mailing list