From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26956 invoked from network); 8 Oct 2021 01:03:39 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 8 Oct 2021 01:03:39 -0000 Received: (qmail 20062 invoked by uid 550); 8 Oct 2021 01:03:36 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 24292 invoked from network); 8 Oct 2021 00:14:13 -0000 To: musl@lists.openwall.com From: Nat! Message-ID: Date: Fri, 8 Oct 2021 02:14:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------DB60D3F3175F1003964F4832" Content-Language: en-US Subject: [musl] Newbie problem with musl-gcc This is a multi-part message in MIME format. --------------DB60D3F3175F1003964F4832 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 assume this is a common newbie problem, but in case not: Linux localhost 5.11.0-37-generic #41-Ubuntu SMP Mon Sep 20 16:39:20 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0 musl is not installed How I built musl-1.2.2 (this is basically non-negotiable, if I can't have it build "static only" outside of root, this is no use for me) CC='cc' CFLAGS='-g -O0' CXXFLAGS='-g -O0' ./configure  --disable-shared --prefix='/tmp/dependency' make  VERBOSE=1 -j 64 all make VERBOSE=1 -j 64 install How I built "foo.c": cat < foo.c #include int  main( void) {    printf( "VfL Bochum 1848\n");    return( 0); } EOF PATH="/tmp/dependency/bin:$PATH" musl-gcc -o foo foo.c Thanks for any help in advance     Nat! --------------DB60D3F3175F1003964F4832 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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 assume this is a common newbie problem, but in case not:

Linux localhost 5.11.0-37-generic #41-Ubuntu SMP Mon Sep 20 16:39:20 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0
musl is not installed

How I built musl-1.2.2 (this is basically non-negotiable, if I can't have it build "static only" outside of root, this is no use for me)

CC='cc' CFLAGS='-g -O0' CXXFLAGS='-g -O0' ./configure  --disable-shared --prefix='/tmp/dependency'
make  VERBOSE=1 -j 64 all
make  VERBOSE=1 -j 64 install

How I built "foo.c":

cat <<EOF > foo.c
#include <stdio.h>

int  main( void)
{
   printf( "VfL Bochum 1848\n");
   return( 0);
}
EOF

PATH="/tmp/dependency/bin:$PATH"

musl-gcc -o foo foo.c

Thanks for any help in advance
    Nat!







--------------DB60D3F3175F1003964F4832--