Correct define for Big-endian in wifn.h?
Could someone help with fixing this in Wi/wifn.h for Big-endian please?
#if WORDS_BIGENDIAN
#error DV_EQ must have big endia def
#else
#define DV_EQ(p1, p2, neq) \
{ \
db_buf_t dv1 = (db_buf_t)p1, dv2 = (db_buf_t)p2; \
uint64 w1 = *(int64*)dv1; \
uint64 xo = w1 ^ *(int64*)dv2; \
int l = db_buf_const_length[(dtp_t)w1]; \
if (l < 0) \
{ \
l = 2 + (int)(dtp_t)(w1 >> 8); \
} \
else if (l == 0) \
{ long l2, hl2; \
db_buf_length (dv1, &l2, &hl2); \
l = l2 + hl2; \
} \
if (l >= 8) \
{ \
if (xo) goto neq; \
dv1 += 8; \
dv2 += 8; \
l -= 8; \
memcmp_8 (dv1, dv2, l, neq); \
} \
else \
{ \
if (xo & (((int64)1 << (l << 3)) - 1)) \
goto neq; \
} \
}
#endif
https://github.com/openlink/virtuoso-opensource/blob/develop/7/libsrc/Wi/wifn.h
Can you provide us with some more information:
- short description of what kind of project you are working
- machine specification such as CPU
- OS version + distribution
Please feel free to contact me via email [email protected] if you do not want to share this information with the general public.
It has been a while since we had any dealings with big-endian machines, so there are some other areas which may have a problem besides this function in wifn.h, but we can give you some assistance.
@pkleef Thank you very much for responding.
I am a contributor to Macports and one of the few to work on PowerPC support. I have found out that virtuoso is a dependency for KDE, which we would want to be fixed for PPC. Currently virtuoso is set to build only for arm64 and x86_64. I started fixing it for ppc, and after a few minor fixes bumped into this issue, which is not as obvious how to fix. It is probably rather trivial for someone who understands what the source code does here, and I can do testing on my end.
If you or someone is willing to help with a PPC (or specifically Big-endian, which will be relevant for BSD and Linux too, as both systems currently support ppc32 and ppc64) port, it would be very much appreciated. If it is done, it can be also submitted to FreeBSD ports etc.
I have had an initial discussion within development about the state of our big-endian patches and unfortunately there has not been much commercial interest in these platforms over the last decade(s). A lot of the new code that was written for Virtuoso 7.x has therefore not been tested on such machines. As you discovered some of this code has been tagged with an #ifdef BIG_ENDIAN and an #error .... so it will stop at compile time, but we feel there are more places which need to be examined and rewritten before Virtuoso 7 is able to run again on big-endian machines.
Since i know KDE used to have a dependency on the Virtuoso v6.x engine, perhaps you can try porting the develop/6.x tree first and see if that still works on a big-endian machine.
I will have a discussion with our management to see if we could get a budget and time to work on this issue.
@pkleef Thank you very much! If you discuss the matter with management, perhaps worth stressing more *BSD and Linux cases (of which there are quite a few distributions currently supporting Big-endian platforms), since macOS PPC may not be met with much of enthusiasm (sadly, but realistically).
Use Indian instead of Endian
On Thu, Mar 2, 2023, 4:37 AM Patrick van Kleef @.***> wrote:
Can you provide us with some more information:
- short description of what kind of project you are working
- machine specification such as CPU
- OS version + distribution
Please feel free to contact me via email @.*** if you do not want to share this information with the general public.
It has been a while since we had any dealings with big-endian machines, so there are some other areas which may have a problem besides this function in wifn.h, but we can give you some assistance.
— Reply to this email directly, view it on GitHub https://github.com/openlink/virtuoso-opensource/issues/1107#issuecomment-1451802065, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALYOCCNYRMXWNQT476ZTMTW2CH7NANCNFSM6AAAAAAVMUWH6Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>