Re: [Gc] Re: Problem: FPE mask reset by GC. Versions 7.X on x86_64 Linux.

Ivan Maidanski ivmai at mail.ru
Sat Jan 22 10:09:22 PST 2011


Hi Jean-Claude,

Some comments follow.

Sat, 22 Jan 2011 01:25:57 -0500 письмо от Jean-Claude Beaudoin <jean.claude.beaudoin at gmail.com>:
> Ivan Maidanski wrote:
> > Hi,
> > 
> > Some notes about the patch:
> > 1. LINUX macro should be tested instead if linux;
> 
> Sure. I kicked that patch out your way a bit too quickly it seems.
> I did not think enough beyond my own working context when I did it.
> It probably is not suitable for general/portable use.
> 
> > 2. IFAIK this requires -lm linker option (alternatively we could load it
> dynamically to avoid possible changes of makefiles of the client applications)
> ;
> 
> Yes it does require -lm since fegetexcept() and feenableexcept() are both in
> that library.
> The alternative would be inline assembly and I am not fluent enough in that to
> cook it up
> quickly. On top of it my app links -lm anyway. But you are right to consider
> this a problem
> in a more general context.

This is the major problem. There are 3 ways:
- use assembly if possible (this is preferred but I'm not a guru in it neither);
- use dynamic loading;
- dont define GETCONTEXT_FPU_EXCMASK_BUG at all (in gcconfig.h) but test it in mach_dep.c.

> 
> > 3. These functions are available only starting from some Glib version (the
> corresponding macro should be tested).
> 
> The man page seems to indicate that they started their career with Glibc 2.2
> which is somewhat
> ancient from my point of view. As for the macro to test that is way above my
> head.

# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 2 || __GLIBC__ > 2

> 
> > 4. Should we define _GNU_SOURCE before include fenv.h or not?
> 
> Yes, define _GNU_SOURCE as you say. My mistake, the man page says to define it
> and it should be,
> sorry about that.

Ok.

Regards.

> 
> > 5. It's better to test GETCONTEXT_FPU_EXCMASK_BUG in mach_dep.c and set it
> in gcconfig.h (please also let me when the bug in glib will be fixed to adjust
> gcconfig.h then).
> 
> Sure. I will keep you posted on the evolution of my bug report but jugging
> from the activity on
> my bugzilla entry you should not hold you breath, they sure don't seem in any
> rush about it...

Not a problem.

> 
> > 
> > Regards.
> > 
> 
> Cheers.



More information about the Gc mailing list