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=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 26909 invoked from network); 10 Nov 2021 22:43:33 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 10 Nov 2021 22:43:33 -0000 Received: (qmail 17506 invoked by uid 550); 10 Nov 2021 22:43:31 -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 17471 invoked from network); 10 Nov 2021 22:43:30 -0000 Date: Wed, 10 Nov 2021 17:43:16 -0500 From: Rich Felker To: Matt Andrews Cc: musl@lists.openwall.com Message-ID: <20211110224316.GL7074@brightrain.aerifal.cx> References: <20211110161152.GJ7074@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Cross compiling with LLVM/clang On Thu, Nov 11, 2021 at 06:46:30AM +1100, Matt Andrews wrote: > On Thu, Nov 11, 2021 at 3:11 AM Rich Felker wrote: > > > As far as I can tell you're not invoking configure to cross compile. > > You told it the target (note: this should really be called host but it > > doesn't matter) is arm but you're invoking the compiler as "clang" so > > it will just be whatever clang's default target is (probably x86_64). > > > > If you want to cross compile, you need something like > > CC="/usr/lib/llvm-13/bin/clang --target=armv7-a" and you also need to > > have a suitable compiler-rt for arm available. > > > > We should probably do something to detect this kind of breakage > > earlier than at long double type mismatch. > > > > Rich > > > > Thanks Rich, this worked. I actually put "--target=armv7a-linux-eabihf" > into CFLAGS. I had done that at some earlier stage, but it caused another > problem so I removed it. It should be in CC, not CFLAGS, as it's actually the *identity of the compiler* you're setting, not mere options. It probably works in practice in either, but to be safe, use CC. Rich