Received: by 10.223.185.116 with SMTP id b49csp438282wrg; Wed, 21 Feb 2018 00:38:20 -0800 (PST) X-Google-Smtp-Source: AH8x224rw4zc/IfvXwvMOqHUrY5Ib5wO0fhKgYhWj4orPDUC8JTDr6aBc6o3rLCyzQTupwow6fHw X-Received: by 10.99.97.9 with SMTP id v9mr2068374pgb.373.1519202300002; Wed, 21 Feb 2018 00:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519202299; cv=none; d=google.com; s=arc-20160816; b=NpOermml3fSTTTiAVrNj3Lg4pO0PGQ19/mzBrka9Vc1wWV++YaFNJiMvmeUrgaOrSj DM/GjVet6XLmDLzuGYxGg5XfKOCwlx6j7ltTYdPTp+5p1XJFpTR9HFzYpSVyYwb+EPNp 242+t+V6pqndJ9lrRSsqN+pVrrsbo5FYYNJNPvaqr7f4NgeTLt+/nztArLQKAltnn7ZT CFBEIwiUIADB4zVaqlVh+go6+TVnZLEj1gTvkHsgDEixf0hRDek+2ySOjZgeYQNfXUU8 dym3+xUhkfhuu8HMv8s3VQ7LG22wXYhHQM7TLhoIpCYYEs4O2H7LAxHvwcVCkkIJb6DV SM2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=4v3EZsVFNEckvEXLVl5jE5QrCcXNmLTHpNcF8ZgRxqc=; b=MG1kkV0T8TPmEBFdnJanHK8jsDZExOBXtV94KtiYKSQwWyKLWl11nMShYywh9uxgut /G1NgEm8jtk8pdjUqstjuhOecKpGgVMpAm3YZkKD2L5mtLwlMk0D+JLqIk3v6raDg81i C1EbFzz6TXLt9A61SR5tx3AvBWLxYu5meoGYAEvA5ONgNj2tTcpMIvilw5R2oqI4Naq8 w2zAdbTl1aqII6IcP0pJ/wUoaln9l5ojBne2AaesIw/vmr994qsvDP0FlJqA24GRuzSA U2rQHqteLtufq9r0GKiZiE7ADDd0UMgwrpf261V5vht89wP4JXFmxMVVxazMvkdIIAnf 8LEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J7LAa/6d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k12si3519380pgs.166.2018.02.21.00.38.05; Wed, 21 Feb 2018 00:38:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J7LAa/6d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752526AbeBUIhH (ORCPT + 99 others); Wed, 21 Feb 2018 03:37:07 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:37402 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437AbeBUIhG (ORCPT ); Wed, 21 Feb 2018 03:37:06 -0500 Received: by mail-it0-f65.google.com with SMTP id d10so1389422itj.2 for ; Wed, 21 Feb 2018 00:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4v3EZsVFNEckvEXLVl5jE5QrCcXNmLTHpNcF8ZgRxqc=; b=J7LAa/6dBeyyOg9F5OpJbE0GvOAY5g6tuFvYdKRg9oiSA+f+1o4qy/zk4Fa4eQ6rm4 IERc2E8cK2PQB3ZxtkjNmj5NTsiERb7GO5r+6PZC/pSzRnRXcVolMvwCoQYaos93m3yc Tvxk4YhyNo5E5IdiHo1eQyT4z/H8Xij14zUIw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4v3EZsVFNEckvEXLVl5jE5QrCcXNmLTHpNcF8ZgRxqc=; b=kAb90mC0fVj91snp7HZ6MvKTNXnczwcnirZWjjkJnsU5XS5S4xKmstXE3/NiQiOVWD rhGoP9Grf/gWsDo4ummCWPEUYUbOBVcgfK3BQ4dgp3iDkmbvN5yiN4VlRba8LzBpvEw+ rBreTgMh2RF0BqZ6SiYiDl9smXXwnG/XfCeSC9lmjLdaBBJhw0WqtfLSeE3sftNX2kg2 IUKTABZfhMVPKTjyAzd9oLJFyeoUeTG5IT/c6QguUJ1y5zd6YPLAJVyFcMdpY8wHysXj VVsWwNuHFTWBaRemq4x0rIDhxd3WBs8xBLI0KUQs+OaqSK9qwUPtxW307V45dKczvOMg oIOg== X-Gm-Message-State: APf1xPByjzpW/vqsKrCDqEMCmZ/ZUu4a5tfjsSTANThpoBFX3zFpQgGb tMkSRO/og5BFPiEmmwuzDOHs0s8S/dTcLG3Dh0k/rQ== X-Received: by 10.36.252.65 with SMTP id b62mr2247018ith.50.1519202225336; Wed, 21 Feb 2018 00:37:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.138.209 with HTTP; Wed, 21 Feb 2018 00:37:04 -0800 (PST) In-Reply-To: <20180220215954.4092811-4-arnd@arndb.de> References: <20180220215954.4092811-1-arnd@arndb.de> <20180220215954.4092811-4-arnd@arndb.de> From: Ard Biesheuvel Date: Wed, 21 Feb 2018 08:37:04 +0000 Message-ID: Subject: Re: [PATCH 3/7] [HACK] pass endianess flag to LTO linker To: Arnd Bergmann Cc: Nicolas Pitre , Andi Kleen , Linux Kernel Mailing List , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20 February 2018 at 21:59, Arnd Bergmann wrote: > We need some way to pass -mbig-endian to the linker during the > LTO link stage, otherwise we get a waning like > > arm-linux-gnueabi/bin/ld: arch/arm/lib/clearbit.o: compiled for a big endian system and target is little endian > > for each file we link in. > > There is probably a better method of passing that flag, I'm just > adding it to a different hack that I added earlier for x86 LTO > here. > In general, LTO requires that *all* C flags are passed to the linker. Given that linking now involves code generation, any C flag that affects code generation must be visible to the linker as well, which includes all the tweaks and overrides that we add per-file or per-directory. It is not clear to me how much of this is carried in the intermediate representation as metadata, but we should probably err on the side of caution here, and update the Kbuild routines to pass the complete value of KBUILD_CFLAGS (or whatever it is called) to ld as well. > Signed-off-by: Arnd Bergmann > --- > arch/arm/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/Makefile b/arch/arm/Makefile > index 33b7eb4502aa..f39c2e2d55c0 100644 > --- a/arch/arm/Makefile > +++ b/arch/arm/Makefile > @@ -49,11 +49,13 @@ endif > > ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) > KBUILD_CPPFLAGS += -mbig-endian > +KBUILD_BIARCHFLAGS += -mbig-endian > CHECKFLAGS += -D__ARMEB__ > AS += -EB > LD += -EB > else > KBUILD_CPPFLAGS += -mlittle-endian > +KBUILD_BIARCHFLAGS += -mlittle-endian > CHECKFLAGS += -D__ARMEL__ > AS += -EL > LD += -EL > -- > 2.9.0 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel