[PATCH] src/drivers/drivers.mak: add -D_GNU_SOURCE for libnl-tiny

Jouni Malinen j at w1.fi
Sat Apr 4 07:06:53 PDT 2026


On Fri, Mar 13, 2026 at 05:34:04PM +0300, Ivan Ivanov wrote:
> When building wpa_supplicant with some toolchains like musl libc
> (e.g., from musl.cc project) and using libnl-tiny, compilation
> fails because 'struct ucred' in netlink/msg.h is incomplete.
> In musl, this structure is defined in sys/socket.h only inside an
> "#ifdef _GNU_SOURCE" block, so the definition is hidden unless
> _GNU_SOURCE is defined. Add -D_GNU_SOURCE to DRV_CFLAGS within the
> CONFIG_LIBNL_TINY block to make the structure visible. This flag
> is safe for other configurations and resolves errors such as:
> 
>   error: field 'nm_creds' has incomplete type
>   error: invalid application of 'sizeof' to incomplete type 'struct ucred'

Thanks, applied.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list