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,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 5583 invoked from network); 11 Oct 2021 17:21:03 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2021 17:21:03 -0000 Received: (qmail 25678 invoked by uid 550); 11 Oct 2021 17:21:01 -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 25648 invoked from network); 11 Oct 2021 17:21:00 -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=4ssF/cShtEhT4J5oO/HN6bCexntBauro1WaDPnX7rGs=; b=T7e22IlkRc7cNtxnMeGVUsSWKoy37OorIgkZuVAneUcen01goa6ZwiPycUXFqYiNCy UtnHQP2eQ7JJfW6lfRZzemcqefIkxybuz2crjNAjDSy4Frnwvhhiu9hDdcl4yBY0q8gP tJJbk3wIfxJAuDXr8h//yyHL5WZBDEbW4lEHMImBXGJtLZlddQrJ6ZcmYfI0fxSOEAnx 72QbDDUIIK+NJEcUufCsbU5chvcg9N1nOaSsMvLWyyKU1iN8YSXx8z/l4bJLwe6YqDJV qNQ3GUq2pF9ZLzELdPnznm4rZ0MdtvjGTibRFmAb8ZI8saOPHSBamv+2NUDSBuL0xVU/ GooA== 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=4ssF/cShtEhT4J5oO/HN6bCexntBauro1WaDPnX7rGs=; b=Q7kKBGJEzqo0KPCQvu88fZiodMN+yBkYCwN5A5x8+wkfI64Qxt6R6iIB4ovH1A7K/B hRcSS+Q5SKxAtceR1WLlWUPE8dXA2RhVI156MVlXF+EepDOMGi6t/AzAggh7L6kQbzQy Lab881mTVlQdmz1mBrYLy/yeUO4ocakVabnnaotv1Aag0IhpzuQAGHfw+FwYGdwLsXmX hZhpQpjwn3KmNkYKAoHd44BbuDw6aWUYb5bshblv5fO1k4iB58HQIhY0TI473b0vTj7g FvGzpvTvUGasTjtsfWA1fScLpBqn7flK7SJywPWmcFLrDpH5Mtnc/TbM33DXtNtvmxTz Ny4Q== X-Gm-Message-State: AOAM530Zazv0e9VCCDUczwVofLCPOsBoDeGEhh4QElvJw0p7OrTFhdGu lsx9RGzYak4LxGdPWqLrspkWx1xO6mr6lWNQwesL8jvAexE= X-Google-Smtp-Source: ABdhPJzfrWKvLkufDoXqBymOOIfxWd/7/+5K4VeQu7R8raDnswrZOvXDgSCbgWxjgM3DCy9c57FwLexqcRl8mlAjO30= X-Received: by 2002:a05:6214:21ac:: with SMTP id t12mr25119773qvc.18.1633972848594; Mon, 11 Oct 2021 10:20:48 -0700 (PDT) MIME-Version: 1.0 References: <20211011004346.13768de6@tpx.quinq.eu.org> In-Reply-To: From: Khem Raj Date: Mon, 11 Oct 2021 10:20:22 -0700 Message-ID: To: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Newbie cross compiling with LLVM On Sun, Oct 10, 2021 at 4:22 PM Matt Andrews wrote: > > > 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? I guess you need a cross linker here if your -target option matches exactly with cross prefix it will find it. > > 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?