Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 25 Nov 2023 21:51:24 +0100
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Cc: Unknown <detective33322@...il.com>
Subject: Re: Can you please guide me on how to compile musl-libc in
 Msys2 ?

Am Sat, Nov 25, 2023 at 06:51:58AM -0800 schrieb Unknown:
> Hi,
>
> I'm trying to compile a source code based on C that i believe it uses
> string.h and some other libraries from musl-libc the platform I'm using to
> compile are Windows with Msys2
>
> The Msys2 currently doesn't have musl-libc in thier packages so i decided
> to compile the musl-libc from the source code but trying to compile it
> gives me a some errors that i couldn't solve until now.
>
> I have check the precompiled musl toolchain with mingw integrated but these
> ones are only available for Linux system.
>

Yeah, once more: musl is a Linux libc. It requires Linux 2.6.0 or newer
to run. It doesn't work on Windows (except in WSL, of course). Even if
you could get it to compile, it won't work, if for no other reason than
because it assumes Linux syscalls. E.g. on x86_64, it will try to write
to stdout by running the syscall instruction with RAX set to 1, RDI set
to 1, RSI set to the data pointer and RDX set to the data length. NT
probably also uses the syscall instruction, but the calling convention
is going to be totally different.

Implementing a POSIX libc on Windows is no mean feat; the Cygwin guys
have been at it for decades and work is still ongoing. I'd suggest you
try to compile the program you want to compile with the stock libc msys2
comes with, or else have a look at Cygwin if you can live with newlib.
If you must run musl, using WSL is going to be your best bet.

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.