mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Cc: Unknown <detective33322@gmail.com>
Subject: Re: [musl] Can you please guide me on how to compile musl-libc in Msys2 ?
Date: Sat, 25 Nov 2023 21:51:24 +0100	[thread overview]
Message-ID: <ZWJeTNtz9sGh_xmS@voyager> (raw)
In-Reply-To: <CA+vY2NzvBsp5whw06fuaVpxPtdt5bp9mCq-fHy3Pqj_jw0O+Ag@mail.gmail.com>

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

      reply	other threads:[~2023-11-25 20:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-24 16:29 Unknown
2023-11-25 11:17 ` Szabolcs Nagy
2023-11-25 14:51   ` Unknown
2023-11-25 20:51     ` Markus Wichmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZWJeTNtz9sGh_xmS@voyager \
    --to=nullplan@gmx.net \
    --cc=detective33322@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).