Skip to content

Commit 3d6b0e5

Browse files
committed
Big Endian Detection: Add a whitelist of always BE OSs
Hopefully fix the issue with AIX falling through this detection logic and being detected as Little Endian reported on the Git mailing list, see https://public-inbox.org/git/[email protected]/ Attempt to solve this by extending the existing fallback we have for detecting always Big Endian processors to also detecting always Big Endian OSs. See the public-inbox link in the comment I'm adding for why this should work. I have not tested this myself, since I have no access to AIX. I'll be pointing Michael Felt to the relevant MR so he can test it before this is merged.
1 parent c3e1304 commit 3d6b0e5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎lib/sha1.c‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,23 @@
9393
#defineSHA1DC_BIGENDIAN
9494

9595
/* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> */
96+
#elif (defined(_AIX))
97+
98+
/*
99+
* Defines Big Endian on a whitelist of OSs that are known to be Big
100+
* Endian-only. See
101+
* https://public-inbox.org/git/[email protected]/
102+
*/
103+
#defineSHA1DC_BIGENDIAN
104+
105+
/* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> or <os whitelist> */
96106
#elif defined(SHA1DC_ON_INTEL_LIKE_PROCESSOR)
97107
/*
98108
* As a last resort before we do anything else we're not 100% sure
99109
* about below, we blacklist specific processors here. We could add
100110
* more, see e.g. https://wiki.debian.org/ArchitectureSpecificsMemo
101111
*/
102-
#else/* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> or <processor blacklist> */
112+
#else/* Not under GCC-alike or glibc or *BSD or newlib or <processor whitelist> or <os whitelist> or <processor blacklist> */
103113

104114
/* We do nothing more here for now */
105115
/*#error "Uncomment this to see if you fall through all the detection"*/

0 commit comments

Comments
(0)