OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Problems with 2.2.10 on HP-UX 11.23/IA

From: Albert Chin (postfix-usersmlists.thewrittenword.com)
Date: Tue May 16 2006 - 09:55:13 CDT


On Tue, May 16, 2006 at 10:21:50AM -0400, Victor Duchovni wrote:
> On Tue, May 16, 2006 at 09:10:50AM -0500, Albert Chin wrote:
>
> > > > On this platform,
> > > > typedef __float80 jmp_buf[320/4];
> > >
> > > What is the data type of a __float80? What are its alignment
> > > requirements?
> >
> > __float80 is a native type.
> >
> > > > #ifndef ALIGN_TYPE
> > > > # if defined(__ia64__) || defined(__ia64)
> > > > # define ALIGN_TYPE long double
> > > > # else
> > > > # define ALIGN_TYPE double
> > > > # endif
> > > > #endif
> > >
> > > Is a long double actually longer than a double with this compiler?
> >
> > Yes. sizeof(double) == 8, sizeof(long double) == 16,
> > sizeof(__float80) == 16.
>
> Those are the sizes, but what are the alignment requirements for these
> data types? You may need something along the lines of:
>
> #if defined(__ia64)
> # if defined(_some_macro_that_ensures_that_this_system_has__float80)
> # define ALIGN_TYPE __float80
> # else
> # define ALIGN_TYPE long double
> # fi
> #fi
>
> "__ia64" alone is likely not a unique characteristic of this system...

Yep, thanks.

> > > > However, the signal 10 error from postfix/master did not go away.
> > > >
> > > > So, seems something in mymalloc() is causing the problem. Anyone have
> > > > ideas?
> > > >
> > >
> > > No, properly aligned, mymalloc() should be fine.
> >
> > Yeah. I'll try to figure out the correct alignment.
>
> Likely "long double" is not actually 16 byte aligned, but __float80 is.

Ahh. The patch below works.

--
albert chin (chinathewrittenword.com)

-- snip snip
Index: src/util/sys_defs.h
===================================================================
--- src/util/sys_defs.h.orig 2006-01-03 15:52:17.000000000 -0600
+++ src/util/sys_defs.h 2006-05-16 09:47:50.116348000 -0500
-1221,7 +1221,9
   * doubles.
   */
 #ifndef ALIGN_TYPE
-# ifdef __ia64__
+# if defined(__hpux) && defined(__ia64)
+# define ALIGN_TYPE __float80
+# elif defined(__ia64__)
 # define ALIGN_TYPE long double
 # else
 # define ALIGN_TYPE double