Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Dec 2025 18:19:08 +0000
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Cc:        John Baldwin <jhb@FreeBSD.org>
Subject:   git: 4aa306667080 - stable/13 - cross-build: Workaround system-provided strchrnul on macOS 15.4+
Message-ID:  <6940511c.235cc.4d9dcae4@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/13 has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=4aa306667080dc2dc77ecbb146eccb081f9e63b2

commit 4aa306667080dc2dc77ecbb146eccb081f9e63b2
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-04-28 17:10:41 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2025-12-15 17:56:37 +0000

    cross-build: Workaround system-provided strchrnul on macOS 15.4+
    
    macOS added a native strchrnul in 15.4.  There is not an easy way to
    detect it at compile time, so use a macro to rename our local inline
    version to avoid conflicts while also forcing its use during
    bootstrap.  The local version can be removed once macOS versions older
    than 15.4 are no longer supported as build hosts.
    
    Co-authored by: jrtc27
    Reported by:    kib
    Reviewed by:    jrtc27
    Differential Revision:  https://reviews.freebsd.org/D49893
    
    (cherry picked from commit 4e2616b74cb7eed921aa10fb776cdc2d5fd4e42f)
---
 tools/build/cross-build/include/mac/string.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/build/cross-build/include/mac/string.h b/tools/build/cross-build/include/mac/string.h
index d7db0d3023a4..58464f1f9834 100644
--- a/tools/build/cross-build/include/mac/string.h
+++ b/tools/build/cross-build/include/mac/string.h
@@ -38,9 +38,12 @@
 #include_next <string.h>
 
 /*
- * strchrnul is not provided by macOS and the strchrnul.c implementation
- * can not be compiled on macOS so just provide it inline here
+ * strchrnul is provided by macOS 15.4 and later.  However, there is
+ * no good way to detect the current host version at compile time, so
+ * provide an inline definition under an alternate name.
  */
+#define	strchrnul(p, ch)	__freebsd_strchrnul(p, ch)
+
 static inline char *
 strchrnul(const char *p, int ch)
 {


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6940511c.235cc.4d9dcae4>