Closed kaji-ryoji closed 1 year ago
@kaji-ryoji
This seems to be an issue with Apple's cc
— if you look at the configure
output, you'll probably find that explicit_bzero
and freezero
are listed as found on the system, when they should not be:
$ ./configure ...
checking for bzero... yes
checking for cap_rights_limit... no
checking for clock... yes
checking for closefrom... no
checking for close_range... no
checking for dirfd... yes
checking for endgrent... yes
checking for err... yes
checking for errx... yes
checking for explicit_bzero... yes <===
checking for explicit_memset... no
checking for fchmod... yes
checking for fchmodat... yes
checking for fchown... yes
checking for fchownat... yes
checking for flock... yes
checking for fnmatch... yes
checking for freeaddrinfo... yes
checking for freezero... yes <===
At least, that's what I was seeing, building on macOS 10.15.
I eventually gave up trying to compile with the system (or XCode) cc
, and instead ran a brew install gcc@11
. Then I did a make distclean
and re-ran configure:
$ CC="gcc-11" CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" ./configure \
--with-pam --with-libedit --with-ldns --with-ssl-dir=/usr/local/opt/openssl@1.1
libedit
and ldns
come courtesy of brew install ldns
and brew install libedit
, of course.
I did use a much more stripped-down configure
command than yours, letting it auto-discover things it was able to, like the library flags, sandbox style, etc. I opted not to try mixing libressl and openssl, since ldns is linked with openssl@1.1
so it's going to be pulled in anyway, as you can see in your configure
status as well. (Also, I was hitting issues with missing crypto symbols, some of the AES ciphers didn't seem to be properly supported. Using only openssl@1.1 solved those.)
The CPPFLAGS
wouldn't even be necessary, except that /usr/local/bin/ldns-config --cflags
is broken and doesn't include (no pun) the -I/usr/local/opt/openssl@1.1/include
include path necessary to actually compile its headers. So if --with-ldns
is used without setting CPPFLAGS
, the ldns probe will break.)
Configured like that, GCC was able to compile the source with no issues, which included compiling in openbsd-compat/explicit_bzero.c
, openbsd-compat/freezero.c
, and other sources that provided implementations for the (now-properly-detected-as-)missing functions.
Hi,
Thanks for providing this patch to the community. When building on my Intel Macbook locally, I have the following failure.
It seems that the file order and includes in
openbsd-compat
dir is not correct. I tried to make some adjustments toopenbsd-compat/Makefile.in
but to no avail. Perhaps you could help me with this?Best regards, Kaji