dante: fix build with clang 16

Fix two configure checks that fail on clang 16 due to unexpected errors:

* Undefined type `uint8_t` by including `stdint.h`; and
* Unused `sa_len_ptr` by incrementing the target of the pointer.

+41 -2
+34
pkgs/servers/dante/clang-osint-m4.patch
···
··· 1 + diff -ur a/osdep.m4 b/osdep.m4 2 + --- a/osdep.m4 2017-01-18 09:11:20.000000000 -0500 3 + +++ b/osdep.m4 2023-10-21 12:43:59.464797030 -0400 4 + @@ -381,6 +381,7 @@ 5 + unset have_sa_len 6 + AC_MSG_CHECKING([for sa_len in sockaddr]) 7 + AC_TRY_COMPILE([ 8 + +#include <stdint.h> 9 + #include <sys/types.h> 10 + #include <sys/socket.h> 11 + ], [struct sockaddr sa; 12 + @@ -397,12 +398,13 @@ 13 + unset sa_len_type_found 14 + for type in uint8_t "unsigned char"; do 15 + AC_TRY_COMPILE([ 16 + +#include <stdint.h> 17 + #include <sys/types.h> 18 + #include <sys/socket.h>], [ 19 + struct sockaddr sa; 20 + $type *sa_len_ptr; 21 + sa_len_ptr = &sa.sa_len; 22 + -sa_len_ptr++; /* use to avoid warning/error */], 23 + +(*sa_len_ptr)++; /* use to avoid warning/error */], 24 + [AC_DEFINE_UNQUOTED(sa_len_type, [$type], [sa_len type]) 25 + sa_len_type_found=t 26 + break]) 27 + @@ -636,6 +638,7 @@ 28 + in_port_t, in_addr_t], 29 + , , 30 + [ 31 + +#include <stdint.h> 32 + #include <sys/types.h> 33 + #include <netinet/in.h> 34 + ])
+7 -2
pkgs/servers/dante/default.nix
··· 22 23 dontAddDisableDepTrack = stdenv.isDarwin; 24 25 - patches = lib.optionals remove_getaddrinfo_checks [ 26 (fetchpatch { 27 name = "0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; 28 url = "https://raw.githubusercontent.com/buildroot/buildroot/master/package/dante/0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; 29 sha256 = "sha256-e+qF8lB5tkiA7RlJ+tX5O6KxQrQp33RSPdP1TxU961Y="; 30 - }) ]; 31 32 postPatch = '' 33 substituteInPlace include/redefgen.sh --replace 'PATH=/bin:/usr/bin:/sbin:/usr/sbin' ""
··· 22 23 dontAddDisableDepTrack = stdenv.isDarwin; 24 25 + patches = [ 26 + # Fixes several issues with `osint.m4` that causes incorrect check failures when using newer 27 + # versions of clang: missing `stdint.h` for `uint8_t` and unused `sa_len_ptr`. 28 + ./clang-osint-m4.patch 29 + ] ++ lib.optionals remove_getaddrinfo_checks [ 30 (fetchpatch { 31 name = "0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; 32 url = "https://raw.githubusercontent.com/buildroot/buildroot/master/package/dante/0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; 33 sha256 = "sha256-e+qF8lB5tkiA7RlJ+tX5O6KxQrQp33RSPdP1TxU961Y="; 34 + }) 35 + ]; 36 37 postPatch = '' 38 substituteInPlace include/redefgen.sh --replace 'PATH=/bin:/usr/bin:/sbin:/usr/sbin' ""