Git Mailing List Archive on
 help / color / Atom feed
From: Jeff King <>
To: "Daniel Richard G." <skunk@iSKUNK.ORG>
Subject: Re: Minor portability issues + fixes
Date: Mon, 18 May 2020 22:49:45 -0400
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, May 18, 2020 at 09:15:58PM -0400, Daniel Richard G. wrote:

> I am building Git 2.26.2 on AIX. A few compilation errors arose, but
> they are resolvable with a few minor changes that will improve overall
> portability.
> There were a few errors of this form:
>     sha1-file.c: In function 'mmap_limit_check':
>     sha1-file.c:940:12: error: 'SIZE_MAX' undeclared (first use in this function)
>     sha1-file.c:940:12: note: each undeclared identifier is reported only once for each function it appears in
> SIZE_MAX is defined in stdint.h, and adding that #include fixes this. It
> is likely that this header is being pulled in on other platforms due to
> transitive dependencies, but that does not occur on AIX.

All system defines in Git should be pulled in via git-compat-util.h.
That does include stdint.h, but only if NO_INTTYPES_H is defined
(otherwise we prefer inttypes.h). And POSIX (2004) says:

  The <inttypes.h> header shall include the <stdint.h> header.

But perhaps that is not so on AIX (it wouldn't be the first time we've
seen a platform that does not strictly follow POSIX).

Does building with:

  make NO_INTTYPES_H=YesPlease


If so, then perhaps it should be added to the AIX defines in

> The problem is, in this case, CC_LD_DYNPATH is set to an empty value---
> which is incorrect, in light of how it is used in the Makefile. Here is
> a typical example:
>     ifdef ZLIB_PATH
>             BASIC_CFLAGS += -I$(ZLIB_PATH)/include
>             EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
>     endif
>     EXTLIBS += -lz
> Setting that variable to an empty value causes a bare directory to be
> passed to the linker, which of course then errors out. I would suggest
> setting it to "-L" instead.

That would just be redundant with the earlier argument. That might be
the easiest way to turn it into a noop, but we can probably do better
with $(if) or similar, which would allow somebody to build with:


even without using the autoconf script.

I do wonder, though, if could be extended for AIX to
support whatever syntax the system linker uses for setting the run-path.
I understand that you don't care either way about this feature, but this
might be a good opportunity to fix it.


  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19  1:15 Daniel Richard G.
2020-05-19  2:49 ` Jeff King [this message]
2020-05-19  4:22   ` Daniel Richard G.
2020-05-20  4:28     ` Jeff King
2020-05-21  4:29       ` Daniel Richard G.
2020-05-22 20:03         ` Jeff King
2020-05-19  3:04 ` Carlo Marcelo Arenas Belón
2020-05-19  4:26   ` Daniel Richard G.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --cc=skunk@iSKUNK.ORG \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Mailing List Archive on

Archives are clonable:
	git clone --mirror git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ \
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone