<p>I just do a check, there are two minor problems with Musl:</p>
<ol>
<li>Musl does not provide any predefined macro in order to test for its presence, like GLIBC</li>
<li>The struct _IO_FILE  is defined in <code>src/internal/stdio_impl.h</code>, but it is not a public API and is subject to change in the future.</li>
</ol>
<p>For the fist problem, we can just use some thing like this:</p>
<div class="highlight highlight-source-c"><pre>#<span class="pl-k">ifdef</span> __MUSL__
<span class="pl-c"><span class="pl-c">//</span> do some stuffs</span>
#<span class="pl-k">endif</span></pre></div>
<p>Then, when one want to compile again Musl, just add the <code>-D__MUSL__</code> to the <code>CFLAGS</code> when executing the configure script.</p>
<p>For the second problem, the added explicit definition (as i did) is not guaranteed to work in the future version of Musl since the <code>struct _IO_FILE</code> may be changed. It would be nice if we can find a workaround that does not involve the (re)definition of that struct.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437575739">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW6QmaiONrZH34DV2VOswAfxIaNXRks5utrF8gaJpZM4YWPl_">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW_QLz-JAZ4wOA4UKTnZ0Aq1pKno7ks5utrF8gaJpZM4YWPl_.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@lxsang in #304: I just do a check, there are two minor problems with Musl:\r\n\r\n1. Musl does not provide any predefined macro in order to test for its presence, like GLIBC\r\n2. The struct _IO_FILE  is defined in ```src/internal/stdio_impl.h```, but it is not a public API and is subject to change in the future.\r\n\r\nFor the fist problem, we can just use some thing like this:\r\n```c\r\n#ifdef __MUSL__\r\n// do some stuffs\r\n#endif\r\n```\r\nThen, when one want to compile again Musl, just add the ```-D__MUSL__``` to the ```CFLAGS``` when executing the configure script.\r\n\r\nFor the second problem, the added explicit definition (as i did) is not guaranteed to work in the future version of Musl since the ```struct _IO_FILE``` may be changed. It would be nice if we can find a workaround that does not involve the (re)definition of that struct.\r\n\r\n"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437575739"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437575739",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437575739",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)",
"sections": [
{
"text": "",
"activityTitle": "**Xuan Sang LE**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@lxsang",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 304,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"OpenSmalltalk/opensmalltalk-vm\",\n\"issueId\": 304\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437575739"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 408484223\n}"
}
],
"themeColor": "26292E"
}
]</script>