From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756263AbdKCStS (ORCPT ); Fri, 3 Nov 2017 14:49:18 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48774 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753635AbdKCStR (ORCPT ); Fri, 3 Nov 2017 14:49:17 -0400 Date: Fri, 3 Nov 2017 18:49:12 +0000 From: Mark Rutland To: Nick Desaulniers 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 Subject: Re: [PATCH 00/15] Add support for clang LTO Message-ID: <20171103184912.n4hoehrqqmf3ui44@lakrids.cambridge.arm.com> References: <20171103171203.107569-1-samitolvanen@google.com> <20171103175156.f44o7kuxgzym3pbt@lakrids.cambridge.arm.com> <20171103182901.eajkzkef3to4p6rf@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 03, 2017 at 11:36:33AM -0700, Nick Desaulniers wrote: > 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 I thought CC=clang CROSS_COMPILE=foo- would result in foo-clang, but evidently this is not the case. I must've meseed up something else; sorry for the noise. Thanks for correcting me; now I can go delete my wrapper. :) Thanks, Mark. From mboxrd@z Thu Jan 1 00:00:00 1970 From: mark.rutland@arm.com (Mark Rutland) Date: Fri, 3 Nov 2017 18:49:12 +0000 Subject: [PATCH 00/15] Add support for clang LTO In-Reply-To: References: <20171103171203.107569-1-samitolvanen@google.com> <20171103175156.f44o7kuxgzym3pbt@lakrids.cambridge.arm.com> <20171103182901.eajkzkef3to4p6rf@lakrids.cambridge.arm.com> Message-ID: <20171103184912.n4hoehrqqmf3ui44@lakrids.cambridge.arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Nov 03, 2017 at 11:36:33AM -0700, Nick Desaulniers wrote: > 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 I thought CC=clang CROSS_COMPILE=foo- would result in foo-clang, but evidently this is not the case. I must've meseed up something else; sorry for the noise. Thanks for correcting me; now I can go delete my wrapper. :) Thanks, Mark.