Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6269384imu; Mon, 21 Jan 2019 06:08:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Uxgpsy7YYb0mgqzq3f/JygTSZ3xAmiRe8Zb1oXmVObn0KC3fG3BLG6jtMhTRDicjfv9j9 X-Received: by 2002:a17:902:20c8:: with SMTP id v8mr30684121plg.319.1548079715566; Mon, 21 Jan 2019 06:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548079715; cv=none; d=google.com; s=arc-20160816; b=zx8DMUScwPjbw/Uz5Sk3pHZOk9LZXl4GcOIx5MWknhHWHzWyQPvN4u6iI0If/Kwanq rLI21pxyBPu+1aFpwgkCjU/7LxyL2YcyxTpTvX6J4XtPAINLvAEWRdaLT1JMP/GjvslQ l4qBisOqieTeraHpO2Bh345souMfi+GXwuybEBDRti/vSqxO19lsU5mY9d7aXeRmAevL CGH1BfNtctiMfJM26IkGgcDQnDihj84d9glfvshaqjI8SopkDyqlluUTaRhUfNQwwGLY 9QUiCAPsedHn9+c0NQWtHIdfTBLdjooygcbjE7/prl5EBVPJi8yciktFlnUx1j8jUgZL CyiQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pyLZQbTyOZcr25ATvMkxLoOvRulVCJiG5PbIgjXYFrM=; b=xFn+Ee+X3kwxFFfOcUomR18K61Jd2yeov0vDGxQqkdc9YEcAML1RZ0V0ffE+++QH8m ESqJQbuivSmuXLP50+FcBRUdI+ub2e7Ty15Bqk2LKJH7KMiY9So5NeHpr8sSTkGJ2ptJ RhfyMTFUpFGIF7PN39ntBS7tYqPEP5JAOD5zIAxYQbehd30rXdBSyixBroovsEvytpZj 1d3aPGr0t9nmakhA7yEIZG5h2uVy/sDKLJlf869T+U3kNqIOt/HdmmDEaTSs9A/6ipir HHEFovCgTn1zbT9HQi95CrjefIvfWPJOUGTQQvTJ9z2gECMmtahP/O37DybmlOXICyQD 2r2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0rTZ2izq; 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 r81si13613734pfr.164.2019.01.21.06.08.20; Mon, 21 Jan 2019 06:08:35 -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=pass header.i=@kernel.org header.s=default header.b=0rTZ2izq; 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 S1732409AbfAUOAg (ORCPT + 99 others); Mon, 21 Jan 2019 09:00:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:47140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731985AbfAUOAc (ORCPT ); Mon, 21 Jan 2019 09:00:32 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C1F62084C; Mon, 21 Jan 2019 14:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548079231; bh=TN3YDjrqdDm4fw1/QMUkMKZfebz/rOIWBgKgRcUnfh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0rTZ2izqEDmwuDZVQ9OIdVkMQUoErZ7kdjyHNssIK8c5wses2Mp+dydc0LtyRybJw i/ILMM1ez6F8b9cDfeSxY1hON2A3+i1JI7k3D3mZ5U9or1AAhEApi735n5OdXwRhN7 GRMV8pXJHG1DGDp2ZWVNUsCKAYIHwSRcXQWu9qbM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , Geert Uytterhoeven , Nicholas Piggin , Masahiro Yamada Subject: [PATCH 4.19 54/99] kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7 Date: Mon, 21 Jan 2019 14:48:46 +0100 Message-Id: <20190121134916.034105521@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121134913.924726465@linuxfoundation.org> References: <20190121134913.924726465@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton commit 16fd20aa98080c2fa666dc384036ec08c80af710 upstream. When building using GCC 4.7 or older, -ffunction-sections & the -pg flag used by ftrace are incompatible. This causes warnings or build failures (where -Werror applies) such as the following: arch/mips/generic/init.c: error: -ffunction-sections disabled; it makes profiling impossible This used to be taken into account by the ordering of calls to cc-option from within the top-level Makefile, which was introduced by commit 90ad4052e85c ("kbuild: avoid conflict between -ffunction-sections and -pg on gcc-4.7"). Unfortunately this was broken when the CONFIG_LD_DEAD_CODE_DATA_ELIMINATION cc-option check was moved to Kconfig in commit e85d1d65cd8a ("kbuild: test dead code/data elimination support in Kconfig"), because the flags used by this check no longer include -pg. Fix this by not allowing CONFIG_LD_DEAD_CODE_DATA_ELIMINATION to be enabled at the same time as ftrace/CONFIG_FUNCTION_TRACER when building using GCC 4.7 or older. Signed-off-by: Paul Burton Fixes: e85d1d65cd8a ("kbuild: test dead code/data elimination support in Kconfig") Reported-by: Geert Uytterhoeven Cc: Nicholas Piggin Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Masahiro Yamada Signed-off-by: Greg Kroah-Hartman --- init/Kconfig | 1 + 1 file changed, 1 insertion(+) --- a/init/Kconfig +++ b/init/Kconfig @@ -1102,6 +1102,7 @@ config LD_DEAD_CODE_DATA_ELIMINATION bool "Dead code and data elimination (EXPERIMENTAL)" depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION depends on EXPERT + depends on !(FUNCTION_TRACER && CC_IS_GCC && GCC_VERSION < 40800) depends on $(cc-option,-ffunction-sections -fdata-sections) depends on $(ld-option,--gc-sections) help