From patchwork Fri Jul 13 14:59:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 10523543 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 4AE0C602A0 for ; Fri, 13 Jul 2018 14:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3485C29783 for ; Fri, 13 Jul 2018 14:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 28708299D5; Fri, 13 Jul 2018 14:59:47 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BF30C29783 for ; Fri, 13 Jul 2018 14:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fimVDPh6lVewqpf8htc/D3IaPNUrr1E01IW6y4tHNwM=; b=qWvnEWeSTjUVw4 gsh/xqH77DSa7eqlvYkjGtKgJ822VaQwKJXQwS+Xyv+wyJOvXbZ67ecpCvDE1JoBJ09OhhRm61JtK jf0smWXFlN3zb9DMnTtFr2SY+Aq8APL0tjJOLCMOXO5wijVAfqnkNaY9KaMJh5+YnukmEHF15DNp3 x+GWaaLrpraUpufWlLxZVZvKUA0HFeTATvWhYQvZ1aAdIY3uNY5CqSTnU2JQAhKVBQ2UJGUrcoHz9 96gPiBhaDWrn/AoiHistOszrOBzEKedNR0jsUogkxUgIPdmRTRhCsltDBDwJ2L6KsvEy8060RK0ay aDAjDgims1jFGyRqdyDQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdzXr-0003wD-MM; Fri, 13 Jul 2018 14:59:43 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdzXo-0003up-8P for linux-arm-kernel@lists.infradead.org; Fri, 13 Jul 2018 14:59:41 +0000 Received: by mail-lf0-x241.google.com with SMTP id y200-v6so27436674lfd.7 for ; Fri, 13 Jul 2018 07:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Sue2LFuHuAowKxpKHlAqLjkOKRE5R3lGuIcJR7ImqVs=; b=VZCD3SMlsefpN6Pl2jV93usUX76O+iAFkr+m84zSXXhq6Z2Ul2U4D1o8YqT7vMt/U4 iEIFUejDV2//oGbbAdX5O73sunOP6J/6nCibFJu4aK2JikjxS8nNTX5seiQUf2Vw2030 l0jEkwKl8IC9GqTFXCPbPbqaPEdVzNLV2mgbe5HNWPmBfp/5LvE9WBMR5Gy64YyaO9DH tPKcbQ4LG0AeOKuF/cqg6uKDdMw0r3gghjRucsCPS5sQw53nco1Darge/myz8+/MBr8m FJa15nzhFzGKgsqs/7IrmQI/y9DQ2dimdATF8s+A674NgKdS+GM37Bz7EA7rxGghJLA4 9q2w== 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:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Sue2LFuHuAowKxpKHlAqLjkOKRE5R3lGuIcJR7ImqVs=; b=PM0wNrROz20GdhUq53HlizcX3++kc72+Yf0PBaEbSrGV5X1cuRhM5k7dENSBNYCrch 30ntImpodkw1A2717U1/5Y88NMWTl3XHw+F2AEieVBVKkxNDlm5UkQHcIeslzzMjiWcH nijKj75RMKglZ2TH1GuE4eQdSkFsWJ2SZ8OH+ASFVkXboFi7SAzWq33rhybuop2bhft8 1DxgPhJGiH9DH9Ts3cQLiicTEdLyz8fym1VGrfPXhg2PqlLmdw2xm3EyZOVA649EIT+t i1Laf1fqg188jRtYhE7gdXgCdG0cKjar8n07sB2THSAPTmcKFn4wK9DgSSzM7QWft0pj 0YzA== X-Gm-Message-State: AOUpUlEs2P7hPF1Wr/qkDDWkYJ3Tuur/tWGXFyXv81NV9TbF1/tNDWq2 FnwpK7ic/1k/Dvn1YgPrzFY8TYL2 X-Google-Smtp-Source: AAOMgpc4x4SkBQFSJvuk7/ZbW3ZRTab1IwYH3s7aIjsibjNOAx6+OHE5xN9ealRwkLc+znQ1V/OE0w== X-Received: by 2002:a19:501e:: with SMTP id e30-v6mr5162006lfb.71.1531493965411; Fri, 13 Jul 2018 07:59:25 -0700 (PDT) Received: from localhost (h85-30-9-151.cust.se.alltele.net. [85.30.9.151]) by smtp.gmail.com with ESMTPSA id f18-v6sm2866509lja.85.2018.07.13.07.59.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 07:59:23 -0700 (PDT) Date: Fri, 13 Jul 2018 07:59:10 -0700 From: Olof Johansson To: Will Deacon Subject: Re: [PATCH] Revert "arm64: Use aarch64elf and aarch64elfb emulation mode variants" Message-ID: <20180713145910.2mlzip5ssk72cleo@localhost> References: <20180709200956.31158-1-labbott@redhat.com> <20180710090125.GA28924@arm.com> <20180710093615.GA30095@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180710093615.GA30095@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180713_075940_348327_73E0C786 X-CRM114-Status: GOOD ( 27.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Marek , Catalin Marinas , Paul Kocialkowski , linux-kernel@vger.kernel.org, Laura Abbott , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Jul 10, 2018 at 10:36:16AM +0100, Will Deacon wrote: > On Tue, Jul 10, 2018 at 11:30:39AM +0200, Paul Kocialkowski wrote: > > On Tue, 2018-07-10 at 10:01 +0100, Will Deacon wrote: > > > Thanks, Laura. > > > > > > I'll take this as a fix, and add a comment to the Makefile to justify > > > why we need the linux target. > > > > So this comes down to either breaking fedora/debian toolchains (that > > don't support elf emulation mode) or breaking bare-metal toolchains > > (that don't support linux emulation mode). > > > > Since Linux is a bare-metal project that does not technically require > > the linux target (who said using "Linux" for all things is confusing?), > > I think it should aim for the elf target in the long term. > > > > But well, breaking Linux build in common distros isn't good either, so I > > guess it makes sense to revert this while distros toolchains are being > > fixed. Hopefully, it won't take too long. > > > > What do you think? > > Yes, we need to revert the change since it's a regression otherwise. I think > the best course of action here would be to find a way that we can either > tell the linker that it doesn't need the missing linker scripts because > we're providing our own, or find a way to pass different LD flags depending > on whether or not we have a linux toolchain. > > For now, I've pushed the revert to for-next/fixes. Hi Will, This is regressed in mainline as well. But I think we can just use a (slightly improved) ld-option here? I checked it for x86 regression since it uses the one-argument version. Patch is here, can you pick that up instead and get it in for 4.18-rc? Thanks, -Olof From 0d73b2d1774d5edce20aac919ba356b61d098646 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Fri, 13 Jul 2018 07:56:11 -0700 Subject: [PATCH] arm64: Fix build on some toolchains Not all toolchains have the baremetal elf targets, RedHat/Fedora ones in particular. So, probe for whether it's available and use the previous (linux) targets if it isn't. Fixes: 38fc42486775 ("arm64: Use aarch64elf and aarch64elfb emulation mode variants") Signed-off-by: Olof Johansson Reported-by: Laura Abbott --- arch/arm64/Makefile | 4 ++-- scripts/Kbuild.include | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 7976d2d242fa..c5ce97f69731 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -60,13 +60,13 @@ ifeq ($(CONFIG_CPU_BIG_ENDIAN), y) KBUILD_CPPFLAGS += -mbig-endian CHECKFLAGS += -D__AARCH64EB__ AS += -EB -LDFLAGS += -EB -maarch64elfb +LDFLAGS += -EB $(call ld-option, -maarch64elfb, -maarch64linuxb) UTS_MACHINE := aarch64_be else KBUILD_CPPFLAGS += -mlittle-endian CHECKFLAGS += -D__AARCH64EL__ AS += -EL -LDFLAGS += -EL -maarch64elf +LDFLAGS += -EL $(call ld-option, -maarch64elf, -maarch64linux) UTS_MACHINE := aarch64 endif diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index c8156d61678c..1e13f502b42f 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -163,8 +163,8 @@ cc-ldoption = $(call try-run,\ $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) # ld-option -# Usage: LDFLAGS += $(call ld-option, -X) -ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2)) +# Usage: LDFLAGS += $(call ld-option, -X, -Y) +ld-option = $(call try-run, $(LD) $(LDFLAGS) $(1) -v,$(1),$(2),$(3)) # ar-option # Usage: KBUILD_ARFLAGS := $(call ar-option,D)