[OE-core] Should systemd be marked as incompatible with musl?

Khem Raj raj.khem at gmail.com
Fri May 24 02:16:53 UTC 2019



On 5/23/19 6:45 PM, ChenQi wrote:
> On 05/23/2019 08:22 PM, Burton, Ross wrote:
>> On Thu, 23 May 2019 at 11:34, Adrian Bunk <bunk at stusta.de> wrote:
>>> systemd is fundamentally Linux-only and not portable to other kernels.
>>>
>>> systemd upstream is using glibc extensions not present in other
>>> C libraries.
>>>
>>> systemd upstream is accepting technically correct patches that help
>>> building with musl, but there is no interest upstream in keeping systemd
>>> working with non-glibc C libraries.
>>>
>>> The way things currently go, systemd/musl will require an ever-growing
>>> amount of not upstreamable patches - and this is not sustainable.
>> I think I have to agree with you: several of the extensions are for
>> security purposes, so we're potentially actively introducing issues.
>>
>> Ross
> 
> 
> I suggest we only apply these musl patches when the libc is musl.
> 
> SRC_URI += "${@d.getVar('SRC_URI_MUSL') if d.getVar('TCLIBC') == 'musl' 
> else ''}"
> 
> In this way, these patches do not affect glibc users. People who 
> actually use musl will test these patches and maybe improve them if they 
> really care about it.

thats acceptable approach. So far we have helped upstreams of apps to 
cleanup or add support for musl and it has worked reasonably well, 
systemd is a bit of odd man out since they explicitly seems to not care 
for non glibc/linux systems, still they do accept cleanups which are 
resulting from such ports so its not completely wasted excercise, but I 
think dropping systemd support completely from musl is not an option I 
would like to go with, there are cases where this makes sense. 
Especially when you have to cater to different set of devices from small 
to big, userspace remaining same is big advantage atleast in the world I 
am in.

> 
> For example, the following patches are written by me.
> 
> 0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch and
> 0001-do-not-disable-buffer-in-writing-files.patch
> 
> These two patches are to solve runtime problems in musl based system. I 
> knew there's something different in buffering mechanism between glibc 
> and musl that causes this problem, but I really did not want to spend 
> time digging into it. And as systemd was using unbuffered way for 
> writing files for a long time, I just disabled them.
> 
> As Adrian and Ross pointed out, these patches are introducing potential 
> security problems. I agree that we should do something about it. At a 
> minimum, the glibc based system should not be affected.
> 
> I'll send out patch and please help review it.
> 
> Best Regards,
> Chen Qi
> 


More information about the Openembedded-core mailing list