Sunday, October 10, 2021

Re: UPDATE: libstrophe - endian issue build fix for sparc64

On 10/10/2021 3:09 PM, Florian Viehweger wrote:

> Hi Brad,
>
> thank you for your patch. Unfortunately I do not have working big
> endian hardware right now, so I cannot test it myself.
>
> Can somebody with such a machine test this?
>
> Thank you!

It's not a matter of big vs little. It already builds on big endian machines
with Clang. It'll fail with either endian if using base-gcc. It has
already been
build tested on sparc64.


>> Fix build issue on sparc64.
>>
>> http://build-failures.rhaalovely.net/sparc64/2021-09-18/net/libstrophe.log
>>
>>
>> In file included from src/sha256.c:6:
>> src/sha.h:90:2: error: #error Unknown endianness not supported
>> src/sha256.c: In function 'sha256_compress':
>> src/sha256.c:30: warning: implicit declaration of function 'LOAD32H'
>> src/sha256.c: In function 'sha256_done':
>> src/sha256.c:195: warning: implicit declaration of function 'STORE64H'
>> src/sha256.c:200: warning: implicit declaration of function 'STORE32H'
>>
>>
>> Index: Makefile
>> ===================================================================
>> RCS file: /cvs/ports/net/libstrophe/Makefile,v
>> retrieving revision 1.5
>> diff -u -p -u -p -r1.5 Makefile
>> --- Makefile 10 Sep 2021 04:30:50 -0000 1.5
>> +++ Makefile 20 Sep 2021 04:55:30 -0000
>> @@ -4,6 +4,7 @@ COMMENT = simple, lightweight XMPP C lib
>>
>> V = 0.10.1
>> DISTNAME = libstrophe-${V}
>> +REVISION = 0
>>
>> SHARED_LIBS = strophe 3.0 # 1.0
>>
>> Index: patches/patch-src_sha_h
>> ===================================================================
>> RCS file: patches/patch-src_sha_h
>> diff -N patches/patch-src_sha_h
>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-src_sha_h 20 Sep 2021 04:55:30 -0000
>> @@ -0,0 +1,35 @@
>> +$OpenBSD$
>> +
>> +Index: src/sha.h
>> +--- src/sha.h.orig
>> ++++ src/sha.h
>> +@@ -8,6 +8,7 @@
>> + #ifndef __LIBSTROPHE_SHA_H__
>> + #define __LIBSTROPHE_SHA_H__
>> +
>> ++#include <endian.h>
>> + #include <string.h>
>> +
>> + #ifdef __cplusplus
>> +@@ -19,7 +20,9 @@ extern "C" {
>> +
>> + #if defined(__BIG_ENDIAN__) || \
>> + (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
>> +- __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
>> ++ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || \
>> ++ (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && \
>> ++ BYTE_ORDER == BIG_ENDIAN)
>> +
>> + #define STORE32H(x, y) \
>> + do { \
>> +@@ -46,7 +49,9 @@ extern "C" {
>> +
>> + #elif defined(__LITTLE_ENDIAN__) ||
>> \
>> + (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) &&
>> \ +- __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
>> ++ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \
>> ++ (defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && \
>> ++ BYTE_ORDER == LITTLE_ENDIAN)
>> +
>> + #define STORE32H(x, y) \
>> + do { \
>>
>
>

No comments:

Post a Comment