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 20964 invoked from network); 12 Oct 2021 06:09:46 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 12 Oct 2021 06:09:46 -0000 Received: (qmail 32630 invoked by uid 550); 12 Oct 2021 06:09:44 -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 32594 invoked from network); 12 Oct 2021 06:09:43 -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=Fu5MH4lO7q8++FIJo3DHUWwrOWmV5qVBLBqJyDoOIpI=; b=XNS5JKMVSEShzAzTLqj7fxYVFZ/JuXPV//q9j0aVPZZ1UbKQV/5BxeO2rI2DRKtgo+ evRC48UCaCVZNCDR/crm358dUdgkxEoPQq3fvedZ5xQJzO/gnoj2b2Bm7+zlpc48sKdt VjaUSDCYZHzLpHIbWuZlr00M39ntrdhFEzJGx2r92xCfUf+uD0lXBR7ViiInEiDcZNFl xKPoNNMFN2a7BxjTRRM0tJ3L3UcFi7+TXmWBkOXLgBbPJSiUOvTMV7YtHRoLWBc56zdG FNDmknFQ/RsZDxWIWzW/2vo3TrcO82dZ+UXAvCMmORwwmxH4G1nwClnZqESctr1u4VuI g7GA== 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=Fu5MH4lO7q8++FIJo3DHUWwrOWmV5qVBLBqJyDoOIpI=; b=8OHQzA7JlM3sJCrl2HZDLC838xw1C+4aw1EVmLYumkNrKhhp7cXPh8FLK9eQDEMjNs v6dPlkP9/XfLyIXjgjoZXmWlMmgrmFcTwYkexPzxmlJXq9E5YtSAb5bWctDbgPzJRDGX hHUUZk8GkIlgrIDz/7dqiUqSZ9MU180gGdCzFcUOEZU/eqDP/0gLYcjqeB1rg5YlSTsi oba+yqZVviawoyiRa9j4QhrQa8tuosdRE1xTJkJoNJ/AUg3F/5/uc+lRNdgzbk+KiGMI j6lLvNH8E3dv2+qJsZGrfu+/q3/Uk6M8Ud6D50W2YIMvwAJLW+j3fgaJiK06aht8eKIR hVfA== X-Gm-Message-State: AOAM533wCAFoYgCE71jNFYmUtMBs3vcXuj6g7uvrlvmlwmpQYisRYkIa XMnqJuTdQLLA/64tyWS/H3p1P/MH8yVhFRDYKkf4MBS+ X-Google-Smtp-Source: ABdhPJxqypBmkQtTujca6ncVclvFEKmQPFd0oQHE+A3JE/HbKKTCm57gbmRGyQnn0md6u6SHA4QzT6Murl+a3qtZWrw= X-Received: by 2002:a05:6e02:1608:: with SMTP id t8mr22578053ilu.184.1634018971685; Mon, 11 Oct 2021 23:09:31 -0700 (PDT) MIME-Version: 1.0 References: <20211011004346.13768de6@tpx.quinq.eu.org> In-Reply-To: From: Nagakamira Date: Tue, 12 Oct 2021 09:09:18 +0300 Message-ID: To: musl@lists.openwall.com Content-Type: multipart/alternative; boundary="0000000000005d181705ce21b039" Subject: Re: [musl] Newbie cross compiling with LLVM --0000000000005d181705ce21b039 Content-Type: text/plain; charset="UTF-8" You can pass --unwindlib=libunwind and rtlib, they are both link options On Tue, Oct 12, 2021, 8:55 AM Matt Andrews wrote: > > --rtlib=compiler-rt > > Is that a compiler option or a linker option? I used it in both places, > but still get the same error. > > On Tue, Oct 12, 2021 at 4:00 PM Nagakamira wrote: > >> --rtlib=compiler-rt >> >> On Tue, Oct 12, 2021, 7:58 AM Matt Andrews wrote: >> >>> > -fuse-ld=lld >>> >>> I actually used >>> >>> -fuse-ld=ld.lld >>> >>> That did the trick, but has unlocked another error >>> >>> ld.lld: error: unable to find library -lgcc >>> ld.lld: error: unable to find library -lgcc_eh >>> >>> I thought musl compiles with it's own headers? >>> >>> On Tue, Oct 12, 2021 at 3:54 PM Nagakamira wrote: >>> >>>> -fuse-ld=lld >>>> >>>> On Tue, Oct 12, 2021, 3:26 AM Jeffrey Walton >>>> wrote: >>>> >>>>> On Mon, Oct 11, 2021 at 7:55 PM Matt Andrews >>>>> wrote: >>>>> > >>>>> > >> How do I specify which linker to use? >>>>> > > >>>>> > >LD. Also see >>>>> https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html >>>>> . >>>>> > >>>>> > Looking at the ./configure for musl (which is not based on autoconf >>>>> according to the docs), there is no mention of LD. Setting LD for >>>>> ./configure and/or the call to make still results in the error. >>>>> > >>>>> > Who calls the linker? The compiler or make? Shouldn't clang know >>>>> where it's linker is? How to tell clang which linker to use? >>>>> >>>>> You can have the compiler driver call the linker for you by specifying >>>>> -o with an output file name. In that case, $CC or $CXX will drive the >>>>> link. And in this case, your LDFLAGS should prefix options with -Wl to >>>>> tell the compiler driver the option is for the linker. >>>>> >>>>> Jeff >>>>> >>>> --0000000000005d181705ce21b039 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You can pass --unwindlib=3Dlibunwind and rtlib, they are = both link options

On Tue, Oct 12, 2021, 8:55 AM Matt Andrews <mattandrews@gmail.com> wrote:
> --rtlib=3Dcompil= er-rt

Is that a compiler option or a linker option= ? I used it in both places, but still get the same error.
On Tue, = Oct 12, 2021 at 4:00 PM Nagakamira <nagakamira@gmail.com> wrote= :
--rtlib=3Dcompiler-rt

On Tue, Oct 12, 2021, 7:58 AM Matt Andrews <= mattandrews@gmail.com> wrote:
> -fuse-ld=3Dlld
I actually used

=C2=A0=C2=A0=C2=A0 -f= use-ld=3Dld.lld

That did the trick, but has unlock= ed another error

=C2=A0=C2=A0=C2=A0 ld.lld: error:= unable to find library -lgcc
=C2=A0=C2=A0=C2=A0 ld.lld: error: u= nable to find library -lgcc_eh

I thought musl comp= iles with it's own headers?

On Tue, Oct 12, 2021 at 3:54 PM Na= gakamira <nagakamira@gmail.com> wrote:
-fuse-ld=3D= lld

On Tue, Oct 12, 2021, 3:26 AM Jeffrey Walton <noloader@gma= il.com> wrote:
On Mon, Oct 11, 2021 at 7:55 PM Matt Andrews <mattandrews@gmail.com> wrote:
>
> >> How do I specify which linker to use?
> >
> >LD. Also see https://www.gnu.org/software/make/manual/html_= node/Implicit-Variables.html.
>
> Looking at the ./configure for musl (which is not based on autoconf ac= cording to the docs), there is no mention of LD. Setting LD for ./configure= and/or the call to make still results in the error.
>
> Who calls the linker? The compiler or make? Shouldn't clang know w= here it's linker is? How to tell clang which linker to use?

You can have the compiler driver call the linker for you by specifying
-o with an output file name. In that case, $CC or $CXX will drive the
link. And in this case, your LDFLAGS should prefix options with -Wl to
tell the compiler driver the option is for the linker.

Jeff
--0000000000005d181705ce21b039--