awtfdb
awtfdb copied to clipboard
Build failure: Possible conflicting `strlcpy` definitions on macOS
awtfdb fails to zig build on macOS.
Errors raised point to system headers and several macros (strlcpy, __darwin_obsz, _USE_FORTIFY_LEVEL) as well as conflicting types:
~/.cache/zig/p/<id>/src/strlcpy.c:31:1: error: expected parameter declarator
strlcpy(char *dst, const char *src, size_t siz)
^
~/.cache/zig/p/<id>/src/strlcpy.c:31:1: error: expected ')'
strlcpy(char *dst, const char *src, size_t siz)
^
~/.cache/zig/p/<id>/src/strlcpy.c:31:1: error: type specifier missing,
defaults to 'int'; ISO C99 and later do not support implicit int
strlcpy(char *dst, const char *src, size_t siz)
^
~/.cache/zig/p/<id>/src/strlcpy.c:31:1: error: conflicting types for '__builtin___strlcpy_chk'
strlcpy(char *dst, const char *src, size_t siz)
^
Build Summary: 3/8 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
├─ install wrapper-awtfdb transitive failure
│ └─ zig build-exe wrapper-awtfdb Debug native transitive failure
│ └─ zig build-lib libmagic Debug native 4 errors
└─ link the utils transitive failure
└─ zig build-exe wrapper-awtfdb Debug native (+6 more reused dependencies)
System details
- OS:
macOS - System version:
14.6 - Xcode Command Line Tools version:
2408 - Zig version:
12.1 - Arch:
arm64 - Awtfdb version:
0.3.0
note to self, fails to crosscompile as well with the same looking errors, from running zig build -Dtarget=x86_64-macos-none -Doptimize=ReleaseSafe -Dcpu=x86_64_v2 in my linux host
this is a regression from #1, CI should be added to prevent it in the future, as well as bumping to zig 0.13
/home/luna/.cache/zig/p/12202b523979650f48ed9d6a7ed263a28772f12b6c552cf72011fc6b979fb15e9090/src/strlcpy.c:31:1: error: expected parameter declarator
strlcpy(char *dst, const char *src, size_t siz)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_string.h:112:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
# define _USE_FORTIFY_LEVEL 2
^
/home/luna/.cache/zig/p/12202b523979650f48ed9d6a7ed263a28772f12b6c552cf72011fc6b979fb15e9090/src/strlcpy.c:31:1: error: expected ')'
strlcpy(char *dst, const char *src, size_t siz)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_string.h:112:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL'
# define _USE_FORTIFY_LEVEL 2
^
/home/luna/.cache/zig/p/12202b523979650f48ed9d6a7ed263a28772f12b6c552cf72011fc6b979fb15e9090/src/strlcpy.c:31:1: note: to match this '('
strlcpy(char *dst, const char *src, size_t siz)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_string.h:112:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
/home/luna/.cache/zig/p/12202b523979650f48ed9d6a7ed263a28772f12b6c552cf72011fc6b979fb15e9090/src/strlcpy.c:31:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int
strlcpy(char *dst, const char *src, size_t siz)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_string.h:112:47: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz'
#define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
^
/home/luna/.cache/zig/p/12202b523979650f48ed9d6a7ed263a28772f12b6c552cf72011fc6b979fb15e9090/src/strlcpy.c:31:1: error: conflicting types for '__builtin___strlcpy_chk'
strlcpy(char *dst, const char *src, size_t siz)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_string.h:112:3: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
^
/home/luna/.cache/zig/p/12202b523979650f48ed9d6a7ed263a28772f12b6c552cf72011fc6b979fb15e9090/src/strlcpy.c:31:1: note: '__builtin___strlcpy_chk' is a builtin with type 'unsigned long (char *, const char *, unsigned long, unsigned long)'
strlcpy(char *dst, const char *src, size_t siz)
^
/home/luna/.zvm/0.12.0/lib/libc/include/any-macos-any/secure/_string.h:112:3: note: expanded from macro 'strlcpy'
__builtin___strlcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
thanks github. please validate a macos build works by installing gettext: brew install gettext / port install gettext-runtime
Fixed, thx!