From patchwork Fri Feb 2 18:41:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 10197979 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 937DF6037D for ; Fri, 2 Feb 2018 18:42:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83B7F28F3E for ; Fri, 2 Feb 2018 18:42:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 783B228F44; Fri, 2 Feb 2018 18:42:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64F2128F3E for ; Fri, 2 Feb 2018 18:42:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755064AbeBBSlk (ORCPT ); Fri, 2 Feb 2018 13:41:40 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:37022 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754894AbeBBSlW (ORCPT ); Fri, 2 Feb 2018 13:41:22 -0500 Received: by mail-qk0-f196.google.com with SMTP id y80so25124697qkb.4 for ; Fri, 02 Feb 2018 10:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=9b0h4ClEsL4kXX+zyOTlWygkY1Zv+hwj3+aTyhGssH4=; b=fKozTtR2Nl3jU7p3df5JGSlUfsJKP/hgEXndPABqhfKpHyoHa9svzd/B4pwpX4OQiA o+GOtk8cvJW/e66zB/bhSJiyLaUzFkuQYjHDMgn6bMF8IZGlqfOgl3Qaac2ffB2Ap0jf yy8T2H5XtXAlBvt9Tp4bOVXnowLZWV8/f6Nkw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=9b0h4ClEsL4kXX+zyOTlWygkY1Zv+hwj3+aTyhGssH4=; b=AYWBEHAcfWczKuMrYNdo69mm7Rb4OxJsBZrCuYca2l3qMfDawzV/MA7gKJ7v12AHPY pXzQAAduj1E55cGJseYvaCCVhKSZCfOUpvh15/2nTNJqyM1ukJd2z6tJtxMeuqrmc5Au QD+tKT0PkiDKaEvmiAnPjbPeBjPmhrOTo8jEp745fqxMFF5lHNivM/G8AnNh/TRQ7JAR eqdcaABw7c3ZIU8FAwhZstxuDlgmRNUXwRQ+0F2ACiUQN9oOZEm0i80YulF8Yz4stMeY kVlHBOkz91irULIBbYyquMVJnchDcBlf7lzLpI4wKLxY34wcMw0x5TI7xfmH9DYjhYs2 49vA== X-Gm-Message-State: APf1xPDZBFWO7ScSV+Pn6XASE2cTGHQ+ede/FZZg1bYWVc5fyQGN+FNh GrADMrADa9SDBkWPrxYpdio6+w== X-Google-Smtp-Source: AH8x224qIDKd2hF/0GreF9SiGGDyezEcW23vCX0es/Fum/dlJ8+jarON+014n5xkA+kuxl7g0sUuvQ== X-Received: by 10.55.2.80 with SMTP id 77mr12028745qkc.198.1517596881865; Fri, 02 Feb 2018 10:41:21 -0800 (PST) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id j7sm1740010qtn.59.2018.02.02.10.41.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Feb 2018 10:41:21 -0800 (PST) Date: Fri, 2 Feb 2018 13:41:20 -0500 (EST) From: Nicolas Pitre To: Arnd Bergmann cc: Andi Kleen , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH 7/7] Kbuild: lto: pass -m32/-m64 to to LDFINAL In-Reply-To: <20180202162104.2300532-7-arnd@arndb.de> Message-ID: References: <20180202161550.2106846-1-arnd@arndb.de> <20180202162104.2300532-7-arnd@arndb.de> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 2 Feb 2018, Arnd Bergmann wrote: > Building randconfig kernels with a biarch compiler fails with LTO > when the final link uses a different target architecture compared > to the earlier compilation stages. > > Setting -m32 or -m64 in ${LDFINAL} solves this problem, though my > feeling is that there is a better way to do this. There might also > be other from KBUILD_CFLAGS that we may need in LDFINAL. On ARM I had the same problem as it requires explicit arch flags. I therefore used this patch: ----- >8 Subject: [PATCH] LTO: scripts/gcc-ld: LTO on ARM needs arch specific gcc flags Otherwise the final link where code generation happens produces code for the wrong ISA when the default CPU configured into gcc is not the one we need. Also display the actual command when invoked with "make V=1". Signed-off-by: Nicolas Pitre --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/gcc-ld b/scripts/gcc-ld index d95dd0be38..fa53be2a34 100755 --- a/scripts/gcc-ld +++ b/scripts/gcc-ld @@ -27,4 +27,10 @@ while [ "$1" != "" ] ; do shift done -exec $CC $ARGS +case "${KBUILD_VERBOSE}" in +*1*) + set -x + ;; +esac + +exec $CC $KBUILD_CFLAGS $ARGS