At Fri, 19 Dec 2025 11:55:13 +0100, Adam <adam%netbsd.org@localhost> wrote:
Subject: Cross-build on macOS fails
>
> In file included from /dist/src/lib/libc/time/zic.c:9: In file
> included from
> /dist/tools.aarch64/include/compat/nbtool_config.h:987:
> /dist/src/tools/compat/compat_defs.h:620:7: warning: incompatible
> redeclaration of library function 'mempcpy'
> [-Wincompatible-library-redeclaration] 620 | char *mempcpy(void
> *, const void *, size_t);
> | ^
I just saw PR toolchain/59848 -- which is fixed and closed, and that
might fix it.
However I'm curious why the declaration needs to be there, or rather to
be exposed, if the compiler seems to have a built-in idea of what it
should be.
Perhaps the next error reveals the root of the problem being in whatever
configure check is used to set up nbtool_config.h.
> /dist/src/tools/compat/compat_defs.h:620:7: note: 'mempcpy' is a
> builtin with type 'void *(void *, const void *, unsigned long)' In
> file included from /dist/src/lib/libc/time/zic.c:35:
> /dist/src/lib/libc/time/private.h:858:1: error: static declaration
> of 'mempcpy' follows non-static declaration 858 | mempcpy(void
> *restrict s1, void const *restrict s2, size_t n)
> | ^
> /dist/src/tools/compat/compat_defs.h:620:7: note: previous
> declaration is here 620 | char *mempcpy(void *, const void *,
> size_t);
> | ^
> 1 warning and 1 error generated.
> --- zic.lo ---
>
> *** Failed target: zic.lo In directory: /dist/src/tools/zic Failed
> *** commands:
> ${_MKTARGET_COMPILE} => @# "compile " zic/zic.lo ${HOST_COMPILE.c}
> -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} ${CPUFLAGS.${.IMPSRC:T}}
> ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} => /usr/bin/clang -O2
> -fno-stack-protector -no-cpp-precomp -DHAVE_GETTEXT=0
> -I/dist/tools.aarch64/include/compat -I/dist/src/tools/compat
> -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
> -DREPORT_BUGS_TO=\"gnats%netbsd.org@localhost\" -DPKGVERSION='"(tzcode) "'
> -DTZVERSION='"2025c"' -DZIC_BLOAT_DEFAULT='"slim"' -D_KERNTYPES -c
> -o zic.lo.o -Wno-format-nonliteral /dist/src/lib/libc/time/zic.c
> ${MV} ${.TARGET}.o ${.TARGET} => mv -f zic.lo.o zic.lo
> *** [zic.lo] Error code 1
>
--
Greg A. Woods <gwoods%acm.org@localhost>
Kelowna, BC +1 250 762-7675 RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost> Avoncote Farms <woods%avoncote.ca@localhost>
Attachment:
pgp8nrGpKxUR7.pgp
Description: OpenPGP Digital Signature