From patchwork Wed Feb 1 23:00:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam James X-Patchwork-Id: 51594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp561986wrn; Wed, 1 Feb 2023 15:13:48 -0800 (PST) X-Google-Smtp-Source: AK7set+Z10KIQAEfjlyd/KhNo+Erj3hU2rhDeZJhxVBjztpJaTNDAWISbGbJHBO7LQBiNLjtnN9U X-Received: by 2002:a17:907:6e87:b0:88e:e6ee:fea6 with SMTP id sh7-20020a1709076e8700b0088ee6eefea6mr1161991ejc.69.1675293228710; Wed, 01 Feb 2023 15:13:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675293228; cv=none; d=google.com; s=arc-20160816; b=G8RsGfgylmO/ZSfsgDCANeT71OEJdRgzwS2to4EaHYqyuZxpYHr7I9P5KtEKEsolFK M9oSXHnqlu5cvwMX2TB32LsgAnaOu8LCjy/8Dicw7lLfhzHoN5iDSunCYwhA0sbgjoWz Oi5V40Y6rYylLiizHNVlmjQUGvtgL3CHAkGkpYvwp6DC2lK9JpT6u5ppMjgR/795LIkp 9FqVJlD/MOE2aR7P6mtp7HXLkljck3UMn13jndriruH6ZlNr4GLvN/Gzyt1i6WX7PIyx Kz9luYpvIe3GQT/CgCIX2S0ahYC3C/+F4DTuiszRaXxU37zJquQhJHDkld1LK+15EFrn TneQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2Uc4xAPfXM20D6GooHuPL5VpXUBvrQTWDK1SMJTkOdk=; b=ykIrTmJIARp2aYSyNF5Me7m9liVyQgCofJGr914nkpzMNUfhU+Ynm9a04p+kksFoli 4sjj91g2A4d0MYiJ6ry5fq5ajWhwrUfqVCJZ4u29FmgeegKSXB87uu0X+srTTZVenu6J PdX/viZSKbEM//ez8PtDA1OhD3EV4T8RyjxiQt00n4SrQgfGnMYZH3Co5UrJGhLGYeb3 sPztJvKikIwHnInxNL5Ok1nuGY+lQPgvU3iJDUpixeJx8tfEb36P7xH41zX+eIt6ZH94 Ax98AC4q+o//T0wmi1Mhr5uYKlGDYQqERydCFMp2+Hcnb8zpLWWn5V2uNjbxsZyQgK9F OBSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 26-20020a170906025a00b008718d601cfesi23929163ejl.474.2023.02.01.15.12.58; Wed, 01 Feb 2023 15:13:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230174AbjBAXA0 (ORCPT + 99 others); Wed, 1 Feb 2023 18:00:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjBAXAZ (ORCPT ); Wed, 1 Feb 2023 18:00:25 -0500 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 973976C114; Wed, 1 Feb 2023 15:00:23 -0800 (PST) From: Sam James To: Kees Cook , linux-hardening@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Sam James Subject: [PATCH] gcc-plugins: drop -std=gnu++11 to fix GCC 13 build Date: Wed, 1 Feb 2023 23:00:09 +0000 Message-Id: <20230201230009.2252783-1-sam@gentoo.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756672272477096256?= X-GMAIL-MSGID: =?utf-8?q?1756672272477096256?= The latest GCC 13 snapshot (13.0.1 20230129) gives the following: ``` cc1: error: cannot load plugin ./scripts/gcc-plugins/randomize_layout_plugin.so :./scripts/gcc-plugins/randomize_layout_plugin.so: undefined symbol: tree_code_type ``` This ends up being because of https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=b0241ce6e37031 upstream in GCC which changes the visibility of some types used by the kernel's plugin infrastructure like tree_code_type. After discussion with the GCC folks, we found that the kernel needs to be building plugins with the same flags used to build GCC - and GCC defaults to gnu++17 right now. The minimum GCC version needed to build the kernel is GCC 5.1 and GCC 5.1 already defaults to gnu++14 anyway, so just drop the flag, as all GCCs that could be used to build GCC already default to an acceptable version which was >= the version we forced via flags until now. Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108634 Signed-off-by: Sam James --- scripts/gcc-plugins/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gcc-plugins/Makefile b/scripts/gcc-plugins/Makefile index b34d11e22636..320afd3cf8e8 100644 --- a/scripts/gcc-plugins/Makefile +++ b/scripts/gcc-plugins/Makefile @@ -29,7 +29,7 @@ GCC_PLUGINS_DIR = $(shell $(CC) -print-file-name=plugin) plugin_cxxflags = -Wp,-MMD,$(depfile) $(KBUILD_HOSTCXXFLAGS) -fPIC \ -include $(srctree)/include/linux/compiler-version.h \ -DPLUGIN_VERSION=$(call stringify,$(KERNELVERSION)) \ - -I $(GCC_PLUGINS_DIR)/include -I $(obj) -std=gnu++11 \ + -I $(GCC_PLUGINS_DIR)/include -I $(obj) \ -fno-rtti -fno-exceptions -fasynchronous-unwind-tables \ -ggdb -Wno-narrowing -Wno-unused-variable \ -Wno-format-diag