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

[PATCH v0 3/3] config.mak.uname: Activate ICONV_RESTART_RESET if needed

From
tboegi@web.de <tboegi@web.de>
Date
Dec 15, 2025, 20:45 UTC
Message-ID
<20251215204524.1946518-1-tboegi@web.de>
From: Torsten Bögershausen <tboegi@web.de>

utf8.c needs a tweak when calling the iconv library shipped with later macOS versions (14,15): '#define ICONV_RESTART_RESET' is needed, or 'BASIC_CFLAGS += -DICONV_RESTART_RESET' in Makefile language.

The tweak is not needed when Git is linked against iconv from Fink or MacPorts or homebrew. Neither when Git is compiled under older macOS versions.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 config.mak.uname | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/config.mak.uname b/config.mak.uname
index 44252dabcc..b76a51e22b 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -174,9 +174,11 @@ ifeq ($(uname_S),Darwin)
 
         ifeq ($(shell test -d /usr/local/opt/libiconv/ && echo y),y)
 		HOMEBREW_ICONVDIR = /usr/local/opt/libiconv
+		HAS_GOOD_ICONV = Yes
         endif
         ifeq ($(shell test -d /opt/homebrew/opt/libiconv/ && echo y),y)
 		HOMEBREW_ICONVDIR = /opt/homebrew/opt/libiconv
+		HAS_GOOD_ICONV = Yes
         endif
 
 	# The builtin FSMonitor on MacOS builds upon Simple-IPC.  Both require
@@ -193,12 +195,14 @@ ifeq ($(uname_S),Darwin)
 		ifeq ($(shell test -d /sw/lib && echo y),y)
 			BASIC_CFLAGS += -I/sw/include
 			BASIC_LDFLAGS += -L/sw/lib
+			HAS_GOOD_ICONV = Yes
 		endif
 	endif
 	ifndef NO_DARWIN_PORTS
 		ifeq ($(shell test -d /opt/local/lib && echo y),y)
 			BASIC_CFLAGS += -I/opt/local/include
 			BASIC_LDFLAGS += -L/opt/local/lib
+			HAS_GOOD_ICONV = Yes
 		endif
 	endif
 	ifndef NO_APPLE_COMMON_CRYPTO
@@ -206,6 +210,12 @@ ifeq ($(uname_S),Darwin)
 		APPLE_COMMON_CRYPTO = YesPlease
 		COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
 	endif
+	ifndef HAS_GOOD_ICONV
+		ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1)
+		# utf8.c needs a tweak when using iconv from os
+			BASIC_CFLAGS += -DICONV_RESTART_RESET
+		endif
+	endif
 	PTHREAD_LIBS =
 endif
 ifeq ($(uname_S),SunOS)
-- 
2.50.0.rc0.46.g7014b55638.dirty
Message 1 of 1 in “config.mak.uname: Activate ICONV_RESTART_RESET if needed”
  1. 3/3 config.mak.uname: Activate ICONV_RESTART_RESET if neededtboegi@web.de, Dec 15, 2025

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.