Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp3085906ybj; Mon, 23 Sep 2019 14:34:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJARqIfypy9VQ9pTKh7YZfiv1rWkM4foPEQz57u8mXI5KtMTxGw6WLzJGbkVJNgPEnAfQd X-Received: by 2002:a50:c306:: with SMTP id a6mr2416147edb.108.1569274473562; Mon, 23 Sep 2019 14:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569274473; cv=none; d=google.com; s=arc-20160816; b=ENJXEw2SEVj9OVIuD6t5dWsk2YIuvMt6eyV8/HlkBDPh7ehN7n0XQ86sS5lYoHc1kQ RZbAHnUG5haYL3nUQG+Zd0JbmqkyojbLqI0Gt2KNSHCEd1x0Xd7EMVNz345UrM0uv1VU Nu1SZYPQLXdt7ZEopwX7zZOp6IfGU8t5gnLrXwxV9ON/MGNEUhXANgM6qmA+oXhLvxUR 6JUdrPPxDl+pt06caiYDgSNSViQ/xPdYgun/XaDDQQk1bxhmrpG1RbxN8vznLVp+wl3b oBu9A2eo/i3uaVOfJkf6Laz9NKkTmulfVAlyl5T+07Nq3cGFhVXIEiPqkIh3g9tnamYY Wwkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DEeWK2y9FY60XtxU3bRHyIpz/tUiz8XMVfMdvSrbw60=; b=mJBgvoyDZAZWePTbVtoHdbT5ZDHqtGx9WbexMdIPt0rKASdK3vid6cvQcy091lC0zh Wyl+pS189vXnRKg/ux+kvkaZI2oA4sbcoWvok5a/5QCwRGakS6KfiXLopdA59vih08cs DhNlJR1zIvHz0LaUPUbpGwFYsVxq8iUEiEPzHRfzWU96ox96GvwGMC0ncCK1vhmfuzgb Y+C07gILSAdQos6i4y4ZnbPK6HvaAtxUR2jdxvtJ1JR0c7p+OA36pvD32pzZ3dajWhiq H5MxbLvZ7HW00moG/fQw959QF95HN01r220aYK5jXa8drwRXSfD7pWDN5JT1F1nWYndg Jc5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FjTFsT8t; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qo6si5592938ejb.386.2019.09.23.14.34.10; Mon, 23 Sep 2019 14:34:33 -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; dkim=pass header.i=@kernel.org header.s=default header.b=FjTFsT8t; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390392AbfIVSqz (ORCPT + 99 others); Sun, 22 Sep 2019 14:46:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:43146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390284AbfIVSqv (ORCPT ); Sun, 22 Sep 2019 14:46:51 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69F0D21D56; Sun, 22 Sep 2019 18:46:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569178010; bh=eMPlCWxTQpyconOk0Sr//jZgoyEkKBpyv80QPkFVPI4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FjTFsT8tIpK/vNBKjgdeL78leIjHhrP6GEUDWV4oqp7VLukZL/48fJYLJjJOys1hK E6NpZ1LAt0zIs5k2BuTnhKiHbBOG6KlpiRhpPMa0hC4sBpIYL1nVoguww502HLlEMm F6cg0VLEGcKtGqpGlrO5VoaKYcpAzTJAvHX6yMSA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michael Ellerman , Peter Collingbourne , Will Deacon , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 5.3 097/203] powerpc/Makefile: Always pass --synthetic to nm if supported Date: Sun, 22 Sep 2019 14:42:03 -0400 Message-Id: <20190922184350.30563-97-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190922184350.30563-1-sashal@kernel.org> References: <20190922184350.30563-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman [ Upstream commit 117acf5c29dd89e4c86761c365b9724dba0d9763 ] Back in 2004 we added logic to arch/ppc64/Makefile to pass the --synthetic option to nm, if it was supported by nm. Then in 2005 when arch/ppc64 and arch/ppc were merged, the logic to add --synthetic was moved inside an #ifdef CONFIG_PPC64 block within arch/powerpc/Makefile, and has remained there since. That was fine, though crufty, until recently when a change to init/Kconfig added a config time check that uses $(NM). On powerpc that leads to an infinite loop because Kconfig uses $(NM) to calculate some values, then the powerpc Makefile changes $(NM), which Kconfig notices and restarts. The original commit that added --synthetic simply said: On new toolchains we need to use nm --synthetic or we miss code symbols. And the nm man page says that the --synthetic option causes nm to: Include synthetic symbols in the output. These are special symbols created by the linker for various purposes. So it seems safe to always pass --synthetic if nm supports it, ie. on 32-bit and 64-bit, it just means 32-bit kernels might have more symbols reported (and in practice I see no extra symbols). Making it unconditional avoids the #ifdef CONFIG_PPC64, which in turn avoids the infinite loop. Debugged-by: Peter Collingbourne Signed-off-by: Michael Ellerman Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/powerpc/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index c345b79414a96..403f7e193833a 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -39,13 +39,11 @@ endif uname := $(shell uname -m) KBUILD_DEFCONFIG := $(if $(filter ppc%,$(uname)),$(uname),ppc64)_defconfig -ifdef CONFIG_PPC64 new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi) ifeq ($(new_nm),y) NM := $(NM) --synthetic endif -endif # BITS is used as extension for files which are available in a 32 bit # and a 64 bit version to simplify shared Makefiles. -- 2.20.1