pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lang/perl5 broken Makefile



On Fri, 3 May 2019 13:15:45 +0200
Martin Husemann <martin%duskware.de@localhost> wrote:

> On Fri, May 03, 2019 at 12:04:19PM +0100, Sad Clouds wrote:
> > #ifndef U32_ALIGNMENT_REQUIRED
> >   #if (BYTEORDER == 0x1234 || BYTEORDER == 0x12345678)
> >     #define U8TO16_LE(ptr)   (*((const U16*)(ptr)))
> >     #define U8TO32_LE(ptr)   (*((const U32*)(ptr)))
> >     #define U8TO64_LE(ptr)   (*((const U64*)(ptr)))
> >   #elif (BYTEORDER == 0x4321 || BYTEORDER == 0x87654321)
> >     #if defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 &&
> >     #__GNUC_MINOR__>=3))
> >       #define U8TO16_LE(ptr)   (__builtin_bswap16(*((U16*)(ptr))))
> >       #define U8TO32_LE(ptr)   (__builtin_bswap32(*((U32*)(ptr))))
> >       #define U8TO64_LE(ptr)   (__builtin_bswap64(*((U64*)(ptr))))
> >     #endif
> >   #endif
> > #endif
> 
> This is wrong.
> 
> > This is from config.h
> > 
> > /* U32_ALIGNMENT_REQUIRED:
> >  *      This symbol, if defined, indicates that you must access
> >  *      character data through U32-aligned pointers.
> >  */
> > #ifndef U32_ALIGNMENT_REQUIRED
> > /*#define U32_ALIGNMENT_REQUIRED        / **/
> > #endif
> > 
> > Anyone knows why the above ends up commented out on SPARC?
> 
> Sparc can do character access just fine (unlike early alpha models).
> 
> The test in the above code is plain wrong, it is totally unrelated to
> character access.
> 
> Martin

But it's not accessing characters in the usual way, what it tries to do
is access them as 32-bit integers and then do byte-swapping on those
integers, which fails on SPARC due to alignment restrictions. 


Home | Main Index | Thread Index | Old Index