Received: by 10.223.185.116 with SMTP id b49csp863384wrg; Wed, 21 Feb 2018 08:07:44 -0800 (PST) X-Google-Smtp-Source: AH8x225HwCW4Ef7MuB7/HtrlYLC8BSxZDQfhviD1gc/aeRb8GRSPuIdBs11SLUQtHEwfctBz6wxj X-Received: by 10.101.89.6 with SMTP id f6mr3154606pgu.22.1519229264112; Wed, 21 Feb 2018 08:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519229264; cv=none; d=google.com; s=arc-20160816; b=znf4CYzYhX5mW1TQ/9jkpA+cQf02MqGvvC1n1WgHZxNvrSUAorzBpwEWwXF2Zf8SYX NlBjlIhdtac5eOzBy3j+v5B3i/aFuFMCipUZCkCJtc5tjQncmHueiMrzWgUnbAKMZJNF DcCoFQhVnYx/3loWE1LVegFl1RMmcBVafBx1W7x1pTxcM94zY/KL2rWBiBuVU0iR9Z8j lQIWd+lnVz5zXTwPHBGQN5tWPVjVNp+u9RpY27l+k0DmhFpKo4kvB28YgvK3b9906jyn Fa6fjxPUsCkWcZtVjwkOPs9miwvmdNSxa+Jp0skWtMXwFr3w3CPdavjoP+ZOhIcZHxr+ bWmg== 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=wTb3DqI/J7AlZIKjhKYBEsdx2/2FWBb5glqYq+SHhVM=; b=0oDaHHKnImlgmOgN6UDC4422vOUJzBNUUKaOFH2CcMZeVsI71ioQYA0VT8oVnAJIH2 YmgsiA0zcEyX5xuM5aM3fFswpPsNm9dgY4oEulU0dHzJ89uHD3sGDUyXowvSt0m6ZG00 am9cg80Mc4KG1qvB5GATCEAVZpIbtkSC+yFmVHI78blz16PX41Cji+MYtTrNZ3VaXjah nWLTaFQrM9f2BObArL9BbFkPXtFTFpQdDoCEtTWR/KH185Zr0MZD8TKYdVLiRD4oDaEq +y8oKPueELkCfjceO3v0aKxniXIJbGeY1zGW+4BRzh5xSFvFAyEqvXF1lN/x2bwuNhhu xHOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=QfzfwRct; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si47695plb.72.2018.02.21.08.07.29; Wed, 21 Feb 2018 08:07:44 -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=fail header.i=@gmail.com header.s=20161025 header.b=QfzfwRct; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932624AbeBUJsP (ORCPT + 99 others); Wed, 21 Feb 2018 04:48:15 -0500 Received: from mail-qt0-f181.google.com ([209.85.216.181]:33921 "EHLO mail-qt0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932381AbeBUJsL (ORCPT ); Wed, 21 Feb 2018 04:48:11 -0500 Received: by mail-qt0-f181.google.com with SMTP id d14so1161191qtg.1 for ; Wed, 21 Feb 2018 01:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wTb3DqI/J7AlZIKjhKYBEsdx2/2FWBb5glqYq+SHhVM=; b=QfzfwRctdoxL6vAzF/5iW85h6ctgHA0vJcthl8mukAq3GP7lQwrz/ksUyqasp4DCFq LZFUjXci71/LY8tv53GL2OaeEbp/o5IQ0Q2iNAHSIfTradgNkISAjAKcnQhqrOpqgQA2 vNjS+z2nsWTfw+KMeuXRYigC1SHS0xbe/umB/pHbaVBWNb4XnpP+AUWSZonfIXT6fMb2 KbzFO2ihZZgJpY6Ole/2IvOJWZGc2BxXA5uuHyfXM7tjGNKivwdi2qTR2Tf18GFj1bCE eFVpZwHh/J5BQBqe8wd3fbIBQccI/3ETaokLtldi5vF0s4Rg3Qn59APTXvKm4aJR3JWQ +wvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wTb3DqI/J7AlZIKjhKYBEsdx2/2FWBb5glqYq+SHhVM=; b=jNsDtKL1ZCuQP+ckCsuLQcv2GYZ8VUHaLOXexOGbMNjWiJaI853NfGGs6Jwp1KkHTS RT1Biqokm+WZN+1h/H43YB8BBeCQdoGroZy0X8dN6R5C5FxZz9u0TVFcRqB2zHURnXpI xQHm0k0gLPUykchzxd1vSobJg03dIJK4B5HouyLd4AWjwO4XXGJa57bmbE1kdCVahuAf deqakyL2KvPO+AJx5kAggmoUcqa0x0KkY0Fu+gwnPZSfg2/63cJ2oub7iQYR4HIcffay eAv2DSn1ptAsvSoLORSvFjKrOsLEyoBVAaNHZVMtdbQs60Gn92BTVmW4/mNIjclPo/Kr g6Qw== X-Gm-Message-State: APf1xPACO1vudNUSgnWLk+RrpLLfuuku8u2w+3/+Cai6enl5yhsRT0V+ FRkR03vyGTF+H6XrXFWQ7JOKElvTgD9RJrjZCHBp/BeX X-Received: by 10.200.36.233 with SMTP id t38mr4272755qtt.141.1519206490914; Wed, 21 Feb 2018 01:48:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.198.17 with HTTP; Wed, 21 Feb 2018 01:48:10 -0800 (PST) In-Reply-To: References: <20180220215954.4092811-1-arnd@arndb.de> <20180220215954.4092811-4-arnd@arndb.de> From: Arnd Bergmann Date: Wed, 21 Feb 2018 10:48:10 +0100 X-Google-Sender-Auth: hBYxWOaIkATTynjh5Prll7Kw3pM Message-ID: Subject: Re: [PATCH 3/7] [HACK] pass endianess flag to LTO linker To: Ard Biesheuvel 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 Wed, Feb 21, 2018 at 9:37 AM, Ard Biesheuvel wrote: > 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. It looks like we're just missing KBUILD_CPPFLAGS. However, I wonder for the more general case what happens to files that require non-standard CFLAGS. In some cases we turn off some optimization step for a file, we might remove '-pg', or build for a particular target architecture. Do we have to turn off -flto for any file that requires this for correct behavior? Arnd