mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: [musl] Newbie problem with musl-gcc
Date: Fri, 8 Oct 2021 08:31:41 +0200	[thread overview]
Message-ID: <20211008063141.GC2268@voyager> (raw)
In-Reply-To: <a222e8ba-c346-7051-e4b7-c073da4689a3@mulle-kybernetik.com>

On Fri, Oct 08, 2021 at 02:14:00AM +0200, Nat! wrote:
> Hello
>
> I got everything setup on ubuntu 21.04 and it's compiling and linking my
> small statically linked test executable, but I can't run it.
>
>    $ ldd ./foo
>         statically linked
>    $ ls -l foo
>    -rwxrwxr-x 1 nat develop 77224 Okt  8 02:05 foo
>    $ sudo strace ./foo
>    execve("./foo", ["./foo"], 0x7ffe245a03c0 /* 26 vars */) = -1 ENOENT
>    (Datei oder Verzeichnis nicht gefunden)
>    strace: exec: Datei oder Verzeichnis nicht gefunden
>    +++ exited with 1 +++
>

I think I have seen this before. ldd sometimes returns the wrong info.
Try "readelf -l" on the program to verify it has no interpreter. I have
reason to believe that it does have musl's interpreter, and you have not
properly installed musl.

>    musl is not installed
>

Ha! Didn't I say it?

>        printf( "VfL Bochum 1848\n");

Was this really just an elaborate attempt to advertise your favourite
football club? Just kidding.

>    musl-gcc -o foo foo.c

This doesn't say -static in there. Try adding that and see was happens.
musl-gcc essentially just adds a different specs file to GCC, and that
file is not changed based on the choice to have the shared library or
not.

Ciao,
Markus

  reply	other threads:[~2021-10-08  6:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  0:14 Nat!
2021-10-08  6:31 ` Markus Wichmann [this message]
2021-10-08 19:00   ` Nat!
2021-10-08 19:16     ` Parke

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=20211008063141.GC2268@voyager \
    --to=nullplan@gmx.net \
    --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).