Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6283262imu; Mon, 21 Jan 2019 06:21:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN5opXGR/1FLFrpsQxtvXam68e4g+84vPbzbEJtusScVuAIhh3Dl0EOnmvVpeCgijZtL+yyx X-Received: by 2002:a63:9256:: with SMTP id s22mr27536831pgn.224.1548080471326; Mon, 21 Jan 2019 06:21:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548080471; cv=none; d=google.com; s=arc-20160816; b=TagtanxDJuiwsEf8JN9HCUZlmPF1kQg6dqrE45qpFwnU7MT8jNcbeD98xpQ2LtDyg8 2F1E7ktZ8VK4/j8HcxRmTsL3CJuF83dt8mrXi29nu21gq21pdJ9XcOQIDCeQ86VYkoQh O92+slDHnJV+pfw1JXD/ZRDTpsXBwa32n0etYqtOuq/V+doQjyLaBXbJjRRI/NFUxWO3 bmk2kFofTS2wE2eUHXjWVTI7zMqteQrahzQeS2iBRa5sswpw3bHIOA2nRV540vYyLTdi J+2S8N9IVPtmGk17x2BGWOjktpyBkfHQLxd90zvfV42Pft8pkHfhq6h6sBb0iCM28qna rpLg== 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=OAT12K4bub0VCL47evk6i9KlPO+9hZdKBeB0dn7tvvs=; b=jjeXTqsow7IaupWGHha/LgyhUjZHn9IPzFordIJIQEALvPYxl1FvP5cYYnoeSl1H6U 06feZNTnP1TtJetnUrGrT0PYQYyVCYV2tSOYMmI/uO1zHJYehe5vGC8zVh5Cl1IbpNWb ljwbaI4IEvedvO4yjtOpDNlvt0FoJhZB0X4At5RcVNFDm8MTz4dtF0OIVvBZfWYuHPvw IPV9QLilgH3H3Ivk5lCxbG34z/vzd82tU2oWlEc4yyimJ16oTcKIiXUlqODJXXxksQ7H mo8vMKTQnuUgKNbOEL9SlMYep3QqqCNGQm0zeaC+R2lqrr1v69mnQMTEStfuwQqPEwI9 yyvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="CKkV/8hz"; 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 b2si12547176pgh.475.2019.01.21.06.20.56; Mon, 21 Jan 2019 06:21:11 -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="CKkV/8hz"; 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 S1730646AbfAUOTi (ORCPT + 99 others); Mon, 21 Jan 2019 09:19:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:58638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729956AbfAUNsg (ORCPT ); Mon, 21 Jan 2019 08:48:36 -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 917BB2063F; Mon, 21 Jan 2019 13:48:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548078516; bh=+ayuBEzACxEzrZknOifPltnbjiA2pRZF0kaPmJPnGjM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CKkV/8hzNVVfTtN+QHaOQg4Nsf9aWPluSFmYzU/Ja576j95Baso9vdr8UQn5k/rJD t7xi4h/ch/9DZ3KBoJDRBXwL0x3iNeInqON9TylWvEGRjn5x13Cohvn4eyoWiUEFGz 6sza9au+ARV+p1QUSuLRRs5UMXvNV0dUYjZ9vXzg= 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.20 060/111] kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7 Date: Mon, 21 Jan 2019 14:42:54 +0100 Message-Id: <20190121122502.631722437@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121122455.819406896@linuxfoundation.org> References: <20190121122455.819406896@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.20-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 @@ -1130,6 +1130,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