From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932450AbdKCSgh (ORCPT ); Fri, 3 Nov 2017 14:36:37 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:45139 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbdKCSgg (ORCPT ); Fri, 3 Nov 2017 14:36:36 -0400 X-Google-Smtp-Source: ABhQp+Qq8Oj7jJoPsNt2kG7DOFpJ/5nE0eJacCCgSyIVdghxqGXCVtnmUEsMJwGL1WyQBPwDrDYaa3s1MhlTlc5C0hQ= MIME-Version: 1.0 In-Reply-To: <20171103182901.eajkzkef3to4p6rf@lakrids.cambridge.arm.com> References: <20171103171203.107569-1-samitolvanen@google.com> <20171103175156.f44o7kuxgzym3pbt@lakrids.cambridge.arm.com> <20171103182901.eajkzkef3to4p6rf@lakrids.cambridge.arm.com> From: Nick Desaulniers Date: Fri, 3 Nov 2017 11:36:33 -0700 Message-ID: Subject: Re: [PATCH 00/15] Add support for clang LTO To: Mark Rutland Cc: Sami Tolvanen , LKML , linux-arm-kernel@lists.infradead.org, Matthias Kaehlcke , Kees Cook , Greg Hackmann , George Burgess , Stephen Hines , Pirama Arumuga Nainar , Manoj Gupta Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 3, 2017 at 11:29 AM, Mark Rutland wrote: > On Fri, Nov 03, 2017 at 11:07:04AM -0700, Nick Desaulniers wrote: >> On Fri, Nov 3, 2017 at 10:51 AM, Mark Rutland wrote: >> > I had to create an aarch64-linux-gnu-clang wrapper, too. I'm not sure if >> > there's build system help to avoid needing that? >> >> Gah! So a BIG difference with Clang vs GCC for cross compiling is >> that Clang by default ships with all backends enabled, and uses a >> `-target ` CFLAG to determine the arch to cross compile for, >> while GCC is configured at compile time to support one back end, IIUC. > > Yup. > > I initally tried passing CC=clang\ --target=aarch64-linux-gnu > > ... but since that conflicts with CROSS_COMPILE, you then have to > override AS, LD, OBJCOPY, etc, separately too. make CC=clang CROSS_COMPILE=aarch64-linux-gnu- I think you may need a trailing hyphen on your target as it gets prefixed onto as and ld: Makefile: 348 # Make variables (CC, etc...) 349 AS = $(CROSS_COMPILE)as 350 LD = $(CROSS_COMPILE)ld