This adds support for missing architectures in widl, providing full coverage of current Debian architectures and ports.
I’m aware this restores SPARC which was removed in 2017; if that’s a problem I can remove that part of the patch.
From: Stephen Kitt steve@sk2.org
Based on http://wiki.debian.org/ArchitectureSpecificsMemo
Signed-off-by: Stephen Kitt steve@sk2.org --- include/basetsd.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/basetsd.h b/include/basetsd.h index 55e900d4f8e..1935648b652 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -36,7 +36,7 @@ extern "C" { * 64-bit. */
-#if (defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__)) && !defined(_WIN64) +#if (defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__) || defined(__sparc64__) || defined(__ia64__) || defined(__s390x__)) && !defined(_WIN64) #define _WIN64 #endif
@@ -323,6 +323,10 @@ typedef ULONG_PTR KAFFINITY, *PKAFFINITY; # define WORDS_BIGENDIAN #elif defined(__MIPSEL__) # undef WORDS_BIGENDIAN +#elif defined(__ia64__) +# undef WORDS_BIGENDIAN +#elif defined(__s390__) || defined(__s390x__) +# define WORDS_BIGENDIAN #elif !defined(RC_INVOKED) && !defined(__WIDL__) && !defined(__midl) # error Unknown CPU architecture! #endif
From: John David Anglin dave.anglin@bell.net
Signed-off-by: Stephen Kitt steve@sk2.org --- include/basetsd.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/basetsd.h b/include/basetsd.h index 1935648b652..3c408b4d404 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -327,6 +327,8 @@ typedef ULONG_PTR KAFFINITY, *PKAFFINITY; # undef WORDS_BIGENDIAN #elif defined(__s390__) || defined(__s390x__) # define WORDS_BIGENDIAN +#elif defined(__hppa__) +# undef WORDS_BIGENDIAN #elif !defined(RC_INVOKED) && !defined(__WIDL__) && !defined(__midl) # error Unknown CPU architecture! #endif
From: Stephen Kitt steve@sk2.org
Signed-off-by: Stephen Kitt steve@sk2.org --- include/basetsd.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/basetsd.h b/include/basetsd.h index 3c408b4d404..c9c1259062e 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -309,7 +309,7 @@ typedef ULONG_PTR KAFFINITY, *PKAFFINITY; # undef WORDS_BIGENDIAN #elif defined(__powerpc__) # define WORDS_BIGENDIAN -#elif defined(__ALPHA__) +#elif defined(__ALPHA__) || defined(__alpha__) # undef WORDS_BIGENDIAN #elif defined(__ARMEB__) # define WORDS_BIGENDIAN @@ -329,6 +329,14 @@ typedef ULONG_PTR KAFFINITY, *PKAFFINITY; # define WORDS_BIGENDIAN #elif defined(__hppa__) # undef WORDS_BIGENDIAN +#elif defined(__m68k__) +# define WORDS_BIGENDIAN +#elif defined(__riscv) && __riscv_xlen == 64 +# undef WORDS_BIGENDIAN +#elif defined(__sh__) +# undef WORDS_BIGENDIAN +#elif defined(__sparc__) && defined(__arch64__) +# define WORDS_BIGENDIAN #elif !defined(RC_INVOKED) && !defined(__WIDL__) && !defined(__midl) # error Unknown CPU architecture! #endif
From: JiaLing Zhang zhangjialing@loongson.cn
Signed-off-by: Stephen Kitt steve@sk2.org --- include/basetsd.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/basetsd.h b/include/basetsd.h index c9c1259062e..6bf63df840d 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -329,6 +329,8 @@ typedef ULONG_PTR KAFFINITY, *PKAFFINITY; # define WORDS_BIGENDIAN #elif defined(__hppa__) # undef WORDS_BIGENDIAN +#elif defined(__loongarch__) && defined(__loongarch64) +# undef WORDS_BIGENDIAN #elif defined(__m68k__) # define WORDS_BIGENDIAN #elif defined(__riscv) && __riscv_xlen == 64
We can probably remove the whole thing, this doesn't belong in a Windows header, and we don't support big-endian anyway.
Yes, that would make more sense.
Does “we don’t support big-endian anyway” include tools such as `widl`? That’s where this stuff gets used on BE systems (see for example the SHA1 algorithm in https://gitlab.winehq.org/wine/wine/-/blob/3db7506221e44e8091887d7eb42fe1666...) — or perhaps more accurately, gets built, I’m not sure anyone actually uses `widl` on a BE system.
There are many more places in widl that assume little-endian, so no, it wouldn't be very useful on a BE system.
This merge request was closed by Stephen Kitt.
FYI, note that 3bb752736c4743754a6203293dcb62b52a1757c5 removed the relevant code, and mingw-w64 just imported a new version of widl that includes this change, so now Debian shouldn't need to patch widl in order to build it on exotic architectures.
When running on big endian, the binary IO in widl probably isn't correct, but one could probably expect the idl->h generation to work at least.