Description: Fix FTBFS (testsuite failure) on sparc64.
 Some tests crash with SIGBUS due to unaligned access.  The backtrace
 shows the culprit is CFTimeZoneCreate.c:171 where a pointer is
 dereferenced.  This is undefined behavior for all platforms that is
 just exhibited on sparc64 so let it apply to all architectures.
 .
 Skip a failing test which crashes with SIGSEGV in the PASS_CFEQ macro.
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2024-09-20
---

--- gnustep-corebase.orig/Source/CFTimeZone.c
+++ gnustep-corebase/Source/CFTimeZone.c
@@ -262,7 +262,7 @@
   UInt8  type;
   struct _ttinfo ttinfo;
   char   abbrev[10]; /* 10 = max number of characters, ie 'GMT+01:00\0'. */
-} __attribute__((packed));
+};
 
 CFTimeZoneRef
 CFTimeZoneCreateWithTimeIntervalFromGMT (CFAllocatorRef alloc,
--- gnustep-corebase.orig/Tests/CFTimeZone/bridge.m
+++ gnustep-corebase/Tests/CFTimeZone/bridge.m
@@ -1,3 +1,4 @@
+#import <Foundation/NSAutoreleasePool.h>
 #import <Foundation/NSTimeZone.h>
 #include "CoreFoundation/CFTimeZone.h"
 #include "../CFTesting.h"
@@ -7,8 +8,10 @@
 
 int main(void)
 {
+  ENTER_POOL
   testNSonCF();
   testCFonNS();
+  LEAVE_POOL
   return 0;
 }
 
@@ -52,9 +55,11 @@
   PASS_CF(CFTimeZoneIsDaylightSavingTime(cftz, CFAbsoluteTimeGetCurrent()) == [nstz isDaylightSavingTime],
     "CFTimeZoneIsDaylightSavingTime() works on an NSTimeZone");
   
+#if !__sparc__
   abbrev = CFTimeZoneCopyAbbreviation(cftz, CFAbsoluteTimeGetCurrent());
   PASS_CFEQ([nstz abbreviation], abbrev,
     "CFTimeZoneCopyAbbreviation() works on an NSTimeZone");
   CFRelease(abbrev);
+#endif
 }
 
