Created attachment 16577 [details]
Hi, I'm a developer with MacPorts trying to update our samba4 port to 4.14.2. It doesn't build for me on macOS 10.13.6 with Xcode 9.4.1. If I put "-Werror=implicit-function-declaration" in CFLAGS then the error is:
../../lib/util/charset/charset_macosxfs.c:278:4: error: implicit declaration of function 'DEBUG' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
debug_out("String conversion: "
../../lib/util/charset/charset_macosxfs.c:140:22: note: expanded from macro 'debug_out'
#define debug_out(s) DEBUG(0,(s))
Treating implicit declaration of functions as an error is the default behavior in Xcode 12 and later so I add "-Werror=implicit-function-declaration" to CFLAGS to simulate that. If I don't do that, then it proceeds past that problem with just a warning but fails at the link stage with:
Undefined symbols for architecture x86_64:
"_DEBUG", referenced from:
_macosxfs_encoding_pull in charset_macosxfs.c.1.o
_macosxfs_encoding_push in charset_macosxfs.c.1.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Reverting https://gitlab.com/samba-team/samba/-/commit/1701041d532bb6684c33e89420273631c063a2fa lets the build get further.
Created attachment 16579 [details]
Can you try this patch?
Yes, thanks, I think that patch is sufficient. It gets me to the same place as reverting commit 1701041 (as described in bug #14681).
(In reply to Volker Lendecke from comment #1)
Thank you for creating the patch.
Could you submit the patch to the upstream?
This patch is critical for installing Samba to macOS.
The patch seems submitted to the upstream by Alexander Richardson (thank you!)