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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,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 24537 invoked from network); 10 Oct 2021 23:21:58 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 10 Oct 2021 23:21:58 -0000 Received: (qmail 9724 invoked by uid 550); 10 Oct 2021 23:21:56 -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 9693 invoked from network); 10 Oct 2021 23:21:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=UN5+0ZPZ7SHhmwIxP2al4AuYqM9FHHry+57FMldtyPM=; b=fj6co3diRrBH1h8TbbxSaeNDiLry8sAr8xoFERy4GFJUlbxK8+89QDR07KJ1+0AOkM epoPm41hUeHXTnnloY25mx2gVLOiIi5DvKh/UkuOpKsNchF/P1uLL8LUOlBCLUCXkudG k+vH5UfmAqdr6ynHVORA0EEVqrqS0mv3WjFz5a7qdJaw9ZyOEdSE33Bi1oWS/7SD852h bmQS02QTK0lJtaBe4Hx3jbIdOjw+4vgnvGs0G/vn5JjhRqff6mGcCkgcNJT8CZqzSC3P FTIeUtWBnMQTglHDFT47gSkf72hsKJOQgGM4a1urjX9Bk71S2WrUyFo8357gBDtmS1mz qbQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=UN5+0ZPZ7SHhmwIxP2al4AuYqM9FHHry+57FMldtyPM=; b=Kj3+ccGJIBdZxKlkn83D+y4xDamLcXz7xxtpCE0xL9aEsdOjfbmrGSKAFqfup5yis1 e99typO5wQ9gbqE4+tVGom47r4y7BzfQzLmqjrjIOzuAlvz2CjjOPTd4plkyZIh8fml+ qxfF2jBWMEcyb4jAEaqKj5nrRJwlXtE3cSwe/QKZvzLktUMQf79XiPGsPPW+hs43Uv5F nt0aDX4+L1yBJmTJAnlQ/gFNDIg4Ca53mCDn68UAbS+avMntiu5BFwZb0D3OMRM37fxF eI2MJzG2zeQ03bJafABZDz9mJ9eU/yuxt1eFbx9nXue61if/zy+QJNG4xiNQozXnVbvI GJ9A== X-Gm-Message-State: AOAM531uRBnslEFTGFmZoyO2nr322+9H80EwFMoUKnweiFnxj1yosyXx Ao2wK3X06hkRV0fnX3Lx8DCPR5PHZ1fL8PtlcyycW+Giick= X-Google-Smtp-Source: ABdhPJzurH9vVf0IwqdwWLHwGmVO5oI/PbK3J3vy1P3LCuP5efID6d/SN1Kwdhk0EKpIZooLh8VtwBFQOfLL2EkPbBQ= X-Received: by 2002:a17:907:75c1:: with SMTP id jl1mr21794779ejc.288.1633908104324; Sun, 10 Oct 2021 16:21:44 -0700 (PDT) MIME-Version: 1.0 References: <20211011004346.13768de6@tpx.quinq.eu.org> In-Reply-To: <20211011004346.13768de6@tpx.quinq.eu.org> From: Matt Andrews Date: Mon, 11 Oct 2021 10:21:33 +1100 Message-ID: To: musl@lists.openwall.com Content-Type: multipart/alternative; boundary="00000000000027681305ce07e060" Subject: Re: [musl] Newbie cross compiling with LLVM --00000000000027681305ce07e060 Content-Type: text/plain; charset="UTF-8" > Have try with setting passing AR=clang-ar? I actually set AR=/usr/lib/llvm-13/bin/llvm-ar Then I set RANLIB=/usr/lib/llvm-13/bin/llvm-ranlib That got me a little further down the road, but now I'm getting this error /usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe clang: error: linker command failed with exit code 1 (use -v to see invocation) I added this to CFLAGS -B/usr/lib/llvm-13/bin But it still uses the system linker. How do I specify which linker to use? On Mon, 11 Oct 2021 at 09:44, Quentin Rameau wrote: > > Hello everyone, > > Hi Matt, > > > I'm trying to cross compile from Ubuntu 20.04 to armv7a-linux-musleabihf > > using LLVM. Configure looks like this > > > > ./configure \ > > --prefix=$VECX/usr \ > > --syslibdir=$VECX/lib \ > > --target=armv7a-linux-eabihf \ > > CC=/usr/lib/llvm-13/bin/clang \ > > CFLAGS="--target=armv7a-linux-eabihf -mcpu=cortex-a8" > > > > Then > > > > make && make install > > > > The compilation fails with the following > > > > make: armv7a-linux-eabihf-ar: Command not found > > make: *** [Makefile:167: lib/libc.a] Error 127 > > > > It's looking for an archiver from a cross compiler toolchain, but should > be > > using llvm-ar. > > > > Which configure options should I use to get LLVM to cross compile > > successfully? > > Have try with setting passing AR=clang-ar? > --00000000000027681305ce07e060 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>=C2=A0Have try with setting passing AR=3Dclang-ar?

I actually set
<= span style=3D"color:rgb(0,0,0)">
=C2=A0 =C2=A0 AR=3D/usr/lib/llvm-13/bin/llvm-ar

Then I set

=C2=A0 =C2=A0 RANLIB=3D/usr/lib= /llvm-13/bin/llvm-ranlib

That got me a little further down the road, but now I'm = getting this error

= =C2=A0=C2=A0=C2=A0 /usr/bin/ld: unrecognised emulation mode: armelf_linux_e= abi
=C2=A0= =C2=A0=C2=A0 Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iam= cu elf_l1om elf_k1om i386pep i386pe
=C2=A0=C2=A0=C2=A0 clang: error: linker command fai= led with exit code 1 (use -v to see invocation)

I added this to CFLAGS

=C2=A0= =C2=A0=C2=A0 -B/usr/lib/llvm-13/bin

But it st= ill uses the system linker.

How do I specify = which linker to use?

On Mon, 11 Oct 2021 at 09:44, Que= ntin Rameau <quin= q@fifth.space> wrote:
> Hello everyone,

Hi Matt,

> I'm trying to cross compile from Ubuntu 20.04 to armv7a-linux-musl= eabihf
> using LLVM. Configure looks like this
>
> ./configure \
> --prefix=3D$VECX/usr \
> --syslibdir=3D$VECX/lib \
> --target=3Darmv7a-linux-eabihf \
> CC=3D/usr/lib/llvm-13/bin/clang \
> CFLAGS=3D"--target=3Darmv7a-linux-eabihf -mcpu=3Dcortex-a8"<= br> >
> Then
>
> make && make install
>
> The compilation fails with the following
>
> make: armv7a-linux-eabihf-ar: Command not found
> make: *** [Makefile:167: lib/libc.a] Error 127
>
> It's looking for an archiver from a cross compiler toolchain, but = should be
> using llvm-ar.
>
> Which configure options should I use to get LLVM to cross compile
> successfully?

Have try with setting passing AR=3Dclang-ar?
--00000000000027681305ce07e060--