From: Luca Ceresoli <luca@lucaceresoli.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/exim: Fix compilation error with musl
Date: Mon, 27 Jul 2015 11:34:06 +0200 [thread overview]
Message-ID: <55B5FB0E.2060600@lucaceresoli.net> (raw)
In-Reply-To: <20150726151005.12a9989d@free-electrons.com>
Dear Thomas,
Thomas Petazzoni wrote:
> Dear Luca Ceresoli,
>
> On Sat, 25 Jul 2015 15:36:55 +0200, Luca Ceresoli wrote:
>> From: Bernd Kuhls <bernd.kuhls@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@t-online.de>
>> [Luca: simplify by using only one sed invocation]
>> Signed-off-by: Luca Ceresoli <luca@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.
Indeed.
Actually, for the sake of _building_, setting NO_IP_OPTIONS instead of
DARWIN_IP_OPTIONS would be fine as well. But it would result in OPTSTYLE
to be set to 3, not 2. Bernd, do you think it would work anyway?
For the curious, the *_IP_OPTIONS defines are only referenced in this
file:
http://git.exim.org/exim.git/blob/HEAD:/src/src/smtp_in.c#l1961
where there's a lengthy commentary about the headaches with the various
C libraries.
--
Luca
prev parent reply other threads:[~2015-07-27 9:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-25 13:36 [Buildroot] [PATCH] package/exim: Fix compilation error with musl Luca Ceresoli
2015-07-25 20:05 ` Yann E. MORIN
2015-07-26 13:10 ` Thomas Petazzoni
2015-07-27 9:34 ` Luca Ceresoli [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55B5FB0E.2060600@lucaceresoli.net \
--to=luca@lucaceresoli.net \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox