All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH v2] config.mak.uname: avoid macOS linker warning on Xcode 16.3+
Date: Tue, 02 Jun 2026 07:41:59 +0900	[thread overview]
Message-ID: <xmqqzf1d2894.fsf@gitster.g> (raw)
In-Reply-To: <pull.2313.v2.git.git.1780065163866.gitgitgadget@gmail.com> (Harald Nordgren via GitGitGadget's message of "Fri, 29 May 2026 14:32:43 +0000")

"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> diff --git a/config.mak.uname b/config.mak.uname
> index ce5e7de779..d4d55cb324 100644
> --- a/config.mak.uname
> +++ b/config.mak.uname
> @@ -163,6 +163,12 @@ ifeq ($(uname_S),Darwin)
>  		NEEDS_GOOD_LIBICONV = UnfortunatelyYes
>          endif
>  
> +	# Silence Xcode 16.3+ linker warning about __DATA,__common alignment.
> +	LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:ld-\([0-9]*\).*/\1/p')

If LD_MAJOR_VERSION ever ends up being an empty string, then ...

> +        ifeq ($(shell test "$(LD_MAJOR_VERSION)" -ge 1167 && echo 1),1)

... this "test" would see

	test "" -ge 1167

that would result in errors like

	/bin/bash: line 1: test: : integer expected
	dash: 1: test: Illegal number: 

While this won't break the build (the `ifeq` will just evaluate to
false), it can be noisy.

Perhaps

	test -n "$(LD_MAJOR_VERSION)" &&

in front?  We know from your "sed" invocation that we won't see
anything other than an empty string that is not a number, so I do
not think we have to worry about feeding a non-number to the
comparison against 1167 except for the "ah, no match, empty string"
case.

Other than that, looking good.  Thanks.

> +		BASIC_CFLAGS += -fno-common
> +        endif
> +
>  	# The builtin FSMonitor on MacOS builds upon Simple-IPC.  Both require
>  	# Unix domain sockets and PThreads.
>          ifndef NO_PTHREADS
>
> base-commit: c69baaf57ba26cf117c2b6793802877f19738b0d

  reply	other threads:[~2026-06-01 22:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 17:11 [PATCH] pkt-line: initialize packet_buffer to avoid macOS linker warning Harald Nordgren via GitGitGadget
2026-05-28  3:04 ` Junio C Hamano
2026-05-28  7:40   ` Harald Nordgren
2026-05-28  8:14     ` Harald Nordgren
2026-05-28 20:12       ` Junio C Hamano
2026-05-29 14:32 ` [PATCH v2] config.mak.uname: avoid macOS linker warning on Xcode 16.3+ Harald Nordgren via GitGitGadget
2026-06-01 22:41   ` Junio C Hamano [this message]
2026-06-02  7:37   ` [PATCH v3] " Harald Nordgren via GitGitGadget

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=xmqqzf1d2894.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=haraldnordgren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.