Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3646182imm; Mon, 18 Jun 2018 01:29:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJGTvlA0btzhUnL+pKhcF9PHyD+kELPBJ4DR4uPX500/TPEeVtPpqlhvYbTUYRAZoq9y8TI X-Received: by 2002:a17:902:bd42:: with SMTP id b2-v6mr12952362plx.23.1529310558821; Mon, 18 Jun 2018 01:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529310558; cv=none; d=google.com; s=arc-20160816; b=SzaeMwXyvUjVd9Y4PvzqspwSHt3WM1ZF9ZjA2e2rXNRivNoeojfJLzZrxuLvAiilXI 5izvf0CwV5wNoZNkImkqE0KYmYca2LoKAymvc0LeY7TQqqp0fdyWZTyaNP1TPtFkqUf+ AALAqqWN9SbikQPMaFppEesC9CtG+UWiKamnABWOU3cgfc1B+IxQ5bwmOz0Zl6T5aYH/ CRLNFR837aWzXCDZiP7akhJ3cJRzCD/SDUuEO/hliVHL1KuwTyFzycXsZL7XjWjux3c1 y/YNnxRZRe33JBL7XxvJElZ2fqavcGh3sPNGnSy8c7vGOSEXmexZ9nsPFuIinW0nhBmZ Lk6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Mjb6pWCy0XKW0/nVXXOWgf0fsJTifWrYizlun+KnvLU=; b=MmyTl37y7CWgU+My/cB22MIBtbpzir4eI+u9wMr8cmIlIIgvIQ/mtMjDfiOIPEqx5i /D7kbTdoK4ypLSN/m7C406LxDGco7j7l0kK8BE2H0ZyTToXcKCBE9ofVMIDDDpnj9XUZ QsNbI9U4hKc2OiZ4wZSGwTmXGlSBtJmcH9cnVM9DBGAuLCQfXV73ayRBDC/wAezdtpf8 Q7ykqWkyzFy3iMR3oY6Q4oqPF0Ry/KMMRV0iBJHoP/vsQQr/qP/pPIoxLqeqFHutvurS YIj2VexAPDWqI5Q3/S+irAf41Ds9jzyCNhYJN2C6/NfUu/38CnRt/p0NhJkfmhvWRdpf hByA== ARC-Authentication-Results: i=1; mx.google.com; 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 a13-v6si12085540pgn.391.2018.06.18.01.29.05; Mon, 18 Jun 2018 01:29:18 -0700 (PDT) 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; 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 S966657AbeFRI23 (ORCPT + 99 others); Mon, 18 Jun 2018 04:28:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59528 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966646AbeFRI20 (ORCPT ); Mon, 18 Jun 2018 04:28:26 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 45F85CE0; Mon, 18 Jun 2018 08:28:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Landley , Stephen Rothwell , Russell King , Sasha Levin Subject: [PATCH 4.16 278/279] ARM: replace unnecessary perl with sed and the shell $(( )) operator Date: Mon, 18 Jun 2018 10:14:23 +0200 Message-Id: <20180618080620.170374076@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Russell King [ Upstream commit 6cea14f55474ec71f1098228e0ae5dd2a8f22c0a ] You can build a kernel in a cross compiling environment that doesn't have perl in the $PATH. Commit 429f7a062e3b broke that for 32 bit ARM. Fix it. As reported by Stephen Rothwell, it appears that the symbols can be either part of the BSS section or absolute symbols depending on the binutils version. When they're an absolute symbol, the $(( )) operator errors out and the build fails. Fix this as well. Fixes: 429f7a062e3b ("ARM: decompressor: fix BSS size calculation") Reported-by: Rob Landley Reported-by: Stephen Rothwell Acked-by: Rob Landley Signed-off-by: Russell King Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arm/boot/compressed/Makefile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -117,11 +117,9 @@ ccflags-y := -fpic -mno-single-pic-base asflags-y := -DZIMAGE # Supply kernel BSS size to the decompressor via a linker symbol. -KBSS_SZ = $(shell $(CROSS_COMPILE)nm $(obj)/../../../../vmlinux | \ - perl -e 'while (<>) { \ - $$bss_start=hex($$1) if /^([[:xdigit:]]+) B __bss_start$$/; \ - $$bss_end=hex($$1) if /^([[:xdigit:]]+) B __bss_stop$$/; \ - }; printf "%d\n", $$bss_end - $$bss_start;') +KBSS_SZ = $(shell echo $$(($$($(CROSS_COMPILE)nm $(obj)/../../../../vmlinux | \ + sed -n -e 's/^\([^ ]*\) [AB] __bss_start$$/-0x\1/p' \ + -e 's/^\([^ ]*\) [AB] __bss_stop$$/+0x\1/p') )) ) LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) # Supply ZRELADDR to the decompressor via a linker symbol. ifneq ($(CONFIG_AUTO_ZRELADDR),y)