www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Comping a Musl-linked druntime & phobos?

reply TheGag96 <thegag96 gmail.com> writes:
Hi, all. Has anyone had any success compiling a Musl-linked 
druntime and phobos? I haven't had any luck so far. I'm running 
Linux Mint x64.

Somewhat related - using `-target=x86_64-linux-musl` with dmd 
master doesn't even set the version `CRuntime_Musl`. I asked 
about this in the Discord, and I was told by Horo:

 dmd 2.096 worked well for me. Same for gdc, haven't tried ldc. 
 There is/was a bug that was introduced recently in druntime 
 that broke musl but the older versions should work fine
2.096 doesn't have the `-target` option, and 2.097.0-2.098.0 don't even build properly for me. Using LDC to build works of course, but only with `-betterC` (i.e. no druntime/phobos).
Aug 24 2022
parent reply Mathias LANG <pro.mathias.lang gmail.com> writes:
On Thursday, 25 August 2022 at 01:45:50 UTC, TheGag96 wrote:
 Hi, all. Has anyone had any success compiling a Musl-linked 
 druntime and phobos? I haven't had any luck so far. I'm running 
 Linux Mint x64.

 Somewhat related - using `-target=x86_64-linux-musl` with dmd 
 master doesn't even set the version `CRuntime_Musl`. I asked 
 about this in the Discord, and I was told by Horo:

 dmd 2.096 worked well for me. Same for gdc, haven't tried ldc. 
 There is/was a bug that was introduced recently in druntime 
 that broke musl but the older versions should work fine
2.096 doesn't have the `-target` option, and 2.097.0-2.098.0 don't even build properly for me. Using LDC to build works of course, but only with `-betterC` (i.e. no druntime/phobos).
Hi! Thinks should mostly work. There is some issues with stack traces, but I don't remember the details. Check what Alpine Linux is doing: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/community/dmd Note that the `target` should not be required: https://github.com/dlang/dmd/blob/09d04945bdbc0cba36f7bb1e19d5bd009d4b0ff2/compiler/src/dmd/target.d#L1177-L1180
Aug 24 2022
parent TheGag96 <thegag96 gmail.com> writes:
On Thursday, 25 August 2022 at 01:52:15 UTC, Mathias LANG wrote:
 (snip)
Hmmm... Maybe I don't understand. What exactly *is* Alpine Linux doing? That .patch file didn't contain anything substantial. It looks like it has some version of LDC on hand to use, probably already set up properly to use Musl. You're saying that you shouldn't need to pass in `-target` because if the compiler was compiled with `CRuntime_Musl`, it will just use that automatically. But that requires exactly what I don't have: a compiler that uses Musl. Am I missing something?
Aug 25 2022