Sun 30 May 2010 03:48:11 PM UTC, original submission:
In the OpenBSD ports tree there exists a patch against Source/NSObject.m to fix a problem on i386:
--- Source/NSObject.m.orig Fri Dec 19 10:06:14 2008
+++ Source/NSObject.m Tue Dec 23 14:00:22 2008
@@ -1127,7 +1127,7 @@ GSDescriptionForClassMethod(pcl self, SEL aSel)
#endif
#endif
-#if defined(_FreeBSD_) && defined(_i386_)
+#if defined(_FreeBSD_) || defined(_OpenBSD_) && defined(_i386_)
// Manipulate the FPU to add the exception mask. (Fixes SIGFPE
// problems on *BSD)
// Note this only works on x86
The following code from 1.18:
+ {
+ volatile short cw;
+
+ _asm_ volatile ("fstcw (%0)" : : "g" (&cw));
+ cw |= 1; /* Mask 'invalid' exception */
+ _asm_ volatile ("fldcw (%0)" : : "g" (&cw));
+ }
was replaced in 1.20 with:
fedisableexcept(FE_INVALID);
That worked well with gnustep-base-1.18.0. But now in gnustep-base-1.20.0, the compilation fails because FE_INVALID is not defined on OpenBSD. Therefore I reverted it back to use the old code, see the appended patch.
Otherwise the new code could stay as it is, and a unique
#if defined defined(_OpenBSD_) && defined(_i386_)
for OpenBSD could be introduced, to not mix up the FreeBSD with OpenBSD stuff, don't know what is better.
I've just seen in the svn changes, that Richard is preparing a stable bugfix release. Would be great if a solution to this one could also go in there.
Sebastian
|