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.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,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 7788 invoked from network); 11 Oct 2021 17:41:47 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2021 17:41:47 -0000 Received: (qmail 3873 invoked by uid 550); 11 Oct 2021 17:41:45 -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 3843 invoked from network); 11 Oct 2021 17:41:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to; bh=38FPPdSk5mp58v6CEgVTRaJBO0asDqDGOUwwbJ28X5E=; b=FDv8HCujI1hDq4+lkvVOofv/oHPvEkMs0cZaBZgQjNFiAT9wJY4eUUYNYnbI0LdmoM EwcML3XTx2TzGC/SmOpprYx8PJVSmXU9zmOPntpwEr6ooC+vkAQvzF/qR/fKMv01xdrw E735il6Ty/4WDez6Zt+6F/ywNfi0wW5MhB5n8lODNFkfG2RL23dwODYk5/GZEDXlSdsL 6cCHMM1kpQ6B1azWtL02asTBfVv/xcJfTZrj1gFxamrqyBTePQ0+Q1Kn6xiSMZXUJotJ OwPpDYm4mqbynC+ch9rnBbpy9PcL6vkJPpgsmgKE2Y0XUQ3mBjSvK3qCOMfb9INodSSU qV6A== 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:reply-to :from:date:message-id:subject:to; bh=38FPPdSk5mp58v6CEgVTRaJBO0asDqDGOUwwbJ28X5E=; b=c6Wo4D1O1z9HLFyjWLWu4ekGfKWmqAHU8K/w51T9N8rzIoVoWsYwESmE6N9fDexEN/ VwDoE2wrj0b7To08wl4tMOuXP1Rbf9A0n/AnkgEp5FwxYJuJv8+RL6DEzcSuV32B4fMQ pLUL4V4FPhIRdutLO5HYpSToLICL7bxNKZ+P01l0KIMB0aVYrdh920c4kuPnpFgoF6GD ev/xK3w6V3fOZrIVDZWSqRsOeVu8NYFQLOVNU0vSGVKbshxYoMsZOvQPUcw/GPh+YDFw SJxKQImpMa+JSCWyHMw/mJkihexQYnsFrOxhrbp/pZgM5czhr9whY0Mz3EeJ3qBJ75NI mcVQ== X-Gm-Message-State: AOAM532GqPVJOfkd6Q2Q8njgFMZfC2YBtYJXAwP51tXHLuNH7Ur2zpu8 BqRI0HWrdbhSrH/ngKzN9ke01FC43Cbw3/1O6pJiohklMfk= X-Google-Smtp-Source: ABdhPJxgAHEO2dlZpdIS9FFGBS/5oZWEryed+ggcjtLeYg/w143H3ULsrxbfRsqRa3TqTucALJWy6+7ZYT86ou4u3U0= X-Received: by 2002:a17:90a:1a19:: with SMTP id 25mr426010pjk.34.1633974092004; Mon, 11 Oct 2021 10:41:32 -0700 (PDT) MIME-Version: 1.0 References: <20211011004346.13768de6@tpx.quinq.eu.org> In-Reply-To: From: Jeffrey Walton Date: Mon, 11 Oct 2021 13:40:06 -0400 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 7: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. That's a linker flag. It should be added to LDFLAGS, not CFLAGS. > How do I specify which linker to use? LD. Also see https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html. Typically, during a cross-compile of a C/C++ program, you set the following variables: * CC * CXX * CPP (C preprocessor) * CPPFLAGS (this is where you put --isysroot) * CFLAGS * CXXFLAGS * LD * LDFLAGS (this is where you put --sysroot) --isysroot tells the build system where to find the target's header files. --sysroot tells the build system where to find the target's libraries. Set all the variables. Do not leave anything to chance. If you set your variables properly and the build fails, then the makefile or Autotool's configure.ac is broken. That happens a lot. Jeff