[Buildroot] [PATCH] package/exim: Fix compilation error with musl

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sun Jul 26 13:10:05 UTC 2015


Dear Luca Ceresoli,

On Sat, 25 Jul 2015 15:36:55 +0200, Luca Ceresoli wrote:
> From: Bernd Kuhls <bernd.kuhls at t-online.de>
> 
> Fixes
> smtp_in.c: In function ‘smtp_start_session’:
> smtp_in.c:1976:36: error: invalid application of ‘sizeof’ to incomplete type ‘struct options’
>      EXIM_SOCKLEN_T optlen = sizeof(struct ip_options) + MAX_IPOPTLEN;
> 
> smtp_in.c misdetects the needed style for ip_options, only OPTSTYLE == 2 works.
> Since musl does not provide any macro[1] to detect it we need to pretend to be
> darwin in order to fix the compile bug.
> 
> [1] http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
> [Luca: simplify by using only one sed invocation]
> Signed-off-by: Luca Ceresoli <luca at lucaceresoli.net>
> 
> ---
> 
> I'm adopting this oldish patch (https://patchwork.ozlabs.org/patch/460496/)
> from Bernd. The bug it fixes is still there, and the fix is still valid. I
> just simplified it according to my comments to the original patch.

Thanks for picking up an old patch, definitely useful! I'm not too
happy with us pretending to be Darwin when building against Musl, as it
could fire back on us in the future (like if Exim starts using
something really Darwin specific). But oh well, I guess it's good
enough for now.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list