git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] sha1dc: fix for compiling on AIX using IBM XLC compiler

From
JPjens persson <jens@persson.cx>
Date
May 9, 2018, 11:27 UTC
Message-ID
<CAEoyyNJPZXUKi3W=Gs=3v8i4YnTL47G9oaHDoV5pvCLx78jUVQ@mail.gmail.com>

Hello, first patch. I'm having trouble compiling on AIX using IBMs compiler, leading to unusable binaries. The following patch solved the problem for 2.17.0. The patch below is cut&pasted via gmail to allow for firewalls, but exists in an unmolested form on github: https://github.com/MrShark/git/commit/44bfcaca6637e24548ec06f46fb6035a846b14af

Best regards /jp

Building on AIX using XLC every checkout gives an error: fatal: pack is corrupted (SHA1 mismatch) fatal: index-pack failed

Back tracking it was introduced in 2.13.2, most likely in [1]
Add a #ifdef guard based on macros defined at [2] and [3].

Should perhaps __xlc__ should should be changed to or combined with _AIX based on the behavour of GCC on AIX or XL C on Linux.

1. https://github.com/git/git/commit/6b851e536b05e0c8c61f77b9e4c3e7cedea39ff8
2. https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.3/com.ibm.xlc1313.aix.doc/compiler_ref/macros_platform.html
3. https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.3/com.ibm.xlc1313.aix.doc/compiler_ref/xlmacros.html
Signed-off-by: jens persson <jens@persson.cx>
---
 sha1dc/sha1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
index 25eded139..68a8a0180 100644
--- a/sha1dc/sha1.c
+++ b/sha1dc/sha1.c
@@ -84,7 +84,7 @@
 /* Not under GCC-alike or glibc or *BSD or newlib */
 #elif (defined(__ARMEB__) || defined(__THUMBEB__) ||
defined(__AARCH64EB__) || \
        defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || \
-       defined(__sparc))
+       defined(__sparc) || (defined(__powerpc) && defined(__xlc__)))
 /*
  * Should define Big Endian for a whitelist of known processors. See
  * https://sourceforge.net/p/predef/wiki/Endianness/ and
-- 
2.11.0

-- 
jens persson
<jens@persson.cx>
Mäster Olofsväg 24
S-224 66 LUND;SWEDEN
Next: Ævar Arnfjörð Bjarmason
Message 1 of 4 in “sha1dc: fix for compiling on AIX using IBM XLC compiler”
  1. sha1dc: fix for compiling on AIX using IBM XLC compilerjens persson, May 9, 2018
  2. Ævar Arnfjörð BjarmasonMay 9, 2018
  3. Jonathan NiederMay 9, 2018
  4. Jonathan NiederMay 10, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.