Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Mar 2026 17:36:34 +0000
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 47402c9422ec - main - cross-build: Provide mempcpy when building on macOS
Message-ID:  <69c17a22.38606.23d3192f@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=47402c9422ec6c9ba76d96414f5a08bd35a9e1fd

commit 47402c9422ec6c9ba76d96414f5a08bd35a9e1fd
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2026-03-23 16:56:09 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2026-03-23 16:56:09 +0000

    cross-build: Provide mempcpy when building on macOS
    
    We could patch the tzcode config to not use it, but it's simple to
    provide an implementation of it and avoid spreading cross-build
    bootstrapping special cases.
    
    Fixes:          ff2c98b30b57 ("tzcode: Update to 2026a")
    MFC after:      1 week
---
 tools/build/Makefile                         | 3 +++
 tools/build/cross-build/include/mac/string.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/tools/build/Makefile b/tools/build/Makefile
index 161b8f635c6d..604885dea4c8 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -253,6 +253,9 @@ SYSINCS+=	${SRCTOP}/sys/sys/linker_set.h
 .if ${.MAKE.OS} == "Darwin"
 # Standalone implementation of secure_getenv(), not available on MacOS.
 SRCS+=	secure_getenv.c
+# macOS currently lacks mempcpy
+.PATH: ${LIBC_SRCTOP}/string
+SRCS+=	mempcpy.c
 .endif # ${MAKE.OS} == "Darwin"
 
 # Provide the same arc4random implementation on Linux/macOS
diff --git a/tools/build/cross-build/include/mac/string.h b/tools/build/cross-build/include/mac/string.h
index 58464f1f9834..8a36bb1f392d 100644
--- a/tools/build/cross-build/include/mac/string.h
+++ b/tools/build/cross-build/include/mac/string.h
@@ -37,6 +37,8 @@
 
 #include_next <string.h>
 
+void	*(mempcpy)(void * __restrict, const void * __restrict, size_t);
+
 /*
  * 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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69c17a22.38606.23d3192f>