Re: [PATCH iptables 1/1] configure: Determine if musl is used for build

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joshua,

On Wed, Aug 28, 2024 at 01:47:31PM +0100, Joshua Lant wrote:
> Error compiling with musl-libc:
> The commit hash 810f8568f44f5863c2350a39f4f5c8d60f762958
> introduces the netinet/ether.h header into xtables.h, which causes an error due
> to the redefinition of the ethhdr struct, defined in linux/if_ether.h and
> netinet/ether.h. This is fixed by the inclusion of -D__UAPI_DEF_ETHHDR=0 in
> CFLAGS for musl. Automatically check for this macro, since it is defined
> in musl but not in glibc.

Thanks for the patch! I tested and it may be simplified a bit:

[...]
> +	#if defined(__UAPI_DEF_ETHHDR) && __UAPI_DEF_ETHHDR == 0
> +		return 0;
> +	#else
> +		#error error trying musl...
> +	#endif
[...]

Since the non-failure case is the default, this is sufficient:

|       #if ! defined(__UAPI_DEF_ETHHDR) || __UAPI_DEF_ETHHDR != 0
|               #error error trying musl...
|       #endif

Fine with you? If so, I'll push the modified patch out.

Thanks, Phil




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux