[OpenSmalltalk/opensmalltalk-vm] Support for musl (instead of GNU libc) when building the VM for embedded system (#304)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] Support for musl (instead of GNU libc) when building the VM for embedded system (#304)

Stephan Eggermont-4
 

Hello,

I have a small issue when building (cross-compile) the Smalltalk VM on an ARM(v6) embedded linux system (Nano Pi neno and Raspberry Pi Zero) that uses Musl as default libc implementation.

The problem is that the code and the configure script does not have official support for Musl, so I created a patch file that adds support to Musl, you can find the patch here.

With this patch, i am able to cross-compile on the ARM toolchain for my system; with 4 plugins:

FilePlugin \
SqueakSSL \
SqueakFFIPrims \
SocketPlugin

You can find the build script here

For now, i can live with this dirty trick, but i would be verry happy if the mainline VM has official support to Musl.

That's why i create this issue.

Thanks


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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":"DESCRIPTION","message":"Support for musl (instead of GNU libc) when building the VM for embedded system (#304)"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304"}}}</script> <script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304", "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": "Support for musl (instead of GNU libc) 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": [ { "name": "Repository: ", "value": "OpenSmalltalk/opensmalltalk-vm" }, { "name": "Issue #: ", "value": 304 } ] } ], "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" } ], "@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>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl (instead of GNU libc) when building the VM for embedded system (#304)

timrowledge
 
Hello to anotherARM VM maker; nice to know I'm not the only one ...

Why use cross-compiling? You know the Pi can perfectly happily compile & build for itself, right? That's the only build I ever use. Do the build on a Pi3b+ and it takes not very long at all.

> On 2018-11-09, at 1:32 AM, Xuan Sang LE <[hidden email]> wrote:
>
> Hello,
>
> I have a small issue when building (cross-compile) the Smalltalk VM on an ARM(v6) embedded linux system (Nano Pi neno and Raspberry Pi Zero) that uses Musl as default libc implementation.
>
> The problem is that the code and the configure script does not have official support for Musl, so I created a patch file that adds support to Musl, you can find the patch here.
>
> With this patch, i am able to cross-compile on the ARM toolchain for my system; with 4 plugins:
>
> FilePlugin \
> SqueakSSL \
> SqueakFFIPrims \
> SocketPlugin
>
> You can find the build script here
>
> For now, i can live with this dirty trick, but i would be verry happy if the mainline VM has official support to Musl.
>
> That's why i create this issue.
>
> Thanks
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful Latin Phrases:- Utinam logica falsa tuam philosophiam totam suffodiant! = May faulty logic undermine your entire philosophy!


Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)

Stephan Eggermont-4
In reply to this post by Stephan Eggermont-4
 

I used cross-compile because I built my own barebones linux system with musl + busybox, (and with my own toolchain), so building the VM directly on the device (which runs my very lightweight embedded linux system) is not an option for me in this case


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

<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 used cross-compile because I built my own barebones linux system with musl + busybox, (and with my own toolchain), so building the VM directly on the device (which runs my very lightweight embedded linux system) is not an option for me in this case "}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437444317"}}}</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-437444317", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437444317", "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-437444317" } ], "@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>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)

timrowledge
 


> On 2018-11-09, at 10:05 AM, Xuan Sang LE <[hidden email]> wrote:
>
> I used cross-compile because I built my own barebones linux system with musl + busybox, (and with my own toolchain), so building the VM directly on the device (which runs my very lightweight embedded linux system) is not an option for me in this case

Fair enough; perfectly good reason.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Fractured Idiom:- MONAGE A TROIS - I am three years old


Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)

Stephan Eggermont-4
In reply to this post by Stephan Eggermont-4
 

Hi, making the change to config.sub is fine. What I don't get is the explicit definition for struct _IO_FILE in sqVirtualMachine.c. Shouldn't we do something like

#if TheDefimneThatSaysWereUsingMUSL

include <whereever/lives/stdio.h>

#endif

The key here is to not break the existing build, and including a possibly incompatible definition of struct _IO_FILE in sqVirtualMachine.c is almost guaranteed to break the build somewhere :-)


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

<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":"@eliotmiranda in #304: Hi, making the change to config.sub is fine. What I don't get is the explicit definition for struct _IO_FILE in sqVirtualMachine.c. Shouldn't we do something like\r\n\r\n#if TheDefimneThatSaysWereUsingMUSL\r\n# include \u003cwhereever/lives/stdio.h\u003e\r\n#endif \r\n\r\nThe key here is to not break the existing build, and including a possibly incompatible definition of struct _IO_FILE in sqVirtualMachine.c is almost guaranteed to break the build somewhere :-)"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437469980"}}}</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-437469980", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437469980", "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": "**Eliot Miranda**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@eliotmiranda", "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-437469980" } ], "@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>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)

Stephan Eggermont-4
In reply to this post by Stephan Eggermont-4
 

Hello,
It is indeed a dirty hack, the stdio.h is already in the include path, but i realized that in Musl, only the definition of FILE is available in stdio.h, the struct _IO_FILE, however, is not publicly defined (i.e. it is not available in the public headers). That cause an error about incomplete type definition when gcc tries to compile the line:

static FILE stdoutStack[STDOUT_STACK_SZ];

So i put the explicit definition to the sqVirtualMachine.c, it works for me, but, is indeed not a good solution. What we can do is to put that definition somewhere else, and only include it in sqVirtualMachine.c if we are using Musl as lib implementation.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

<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: Hello,\r\nIt is indeed a dirty hack, the ```stdio.h``` is already in the include path, but i realized that in Musl, only the definition of FILE is available in stdio.h, the struct **_IO_FILE**, however, is not publicly defined (i.e. it is not available in the public headers). That cause an error about incomplete type definition when gcc tries to compile the line:\r\n```c\r\nstatic FILE stdoutStack[STDOUT_STACK_SZ];\r\n```\r\nSo i put the explicit definition to the ```sqVirtualMachine.c```, it works for me, but, is indeed not a good solution. What we can do is to put that definition somewhere else, and only include it in ```sqVirtualMachine.c``` if we are using Musl as lib implementation.\r\n"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437506428"}}}</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-437506428", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437506428", "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-437506428" } ], "@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>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)

Stephan Eggermont-4
In reply to this post by Stephan Eggermont-4
 

Then I think the best thing to do is simply to #ifdef out the stdoutStack, pushOutputFile, and popOutputFile code on Musl. What is the define that indicates that Must is being used?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

<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":"@eliotmiranda in #304: Then I think the best thing to do is simply to #ifdef out the stdoutStack, pushOutputFile, and popOutputFile code on Musl. What is the define that indicates that Must is being used?"}],"action":{"name":"View Issue","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437558515"}}}</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-437558515", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/304#issuecomment-437558515", "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": "**Eliot Miranda**", "activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png", "activitySubtitle": "@eliotmiranda", "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-437558515" } ], "@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>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] Support for musl when building the VM for embedded system (#304)

Stephan Eggermont-4
In reply to this post by Stephan Eggermont-4
 

I just do a check, there are two minor problems with Musl:

  1. Musl does not provide any predefined macro in order to test for its presence, like GLIBC
  2. 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.

For the fist problem, we can just use some thing like this:

#ifdef __MUSL__
// do some stuffs
#endif

Then, when one want to compile again Musl, just add the -D__MUSL__ to the CFLAGS when executing the configure script.

For 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.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

<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>