Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2007697pxb; Thu, 16 Sep 2021 23:13:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1HuzsjBhfU0UG4X0Z9v8wmaC0jDATPsYIQh1JD25aAgwtlvCp+xmTCjZu7iNo3a0pv1k3 X-Received: by 2002:a6b:2b97:: with SMTP id r145mr7189527ior.193.1631859182326; Thu, 16 Sep 2021 23:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631859182; cv=none; d=google.com; s=arc-20160816; b=G9CIJlSIRGj42mE2Hf1b1gdll3SrmKAriTSo6zftp8hWeN+b6tGNjnI+EsLwn2LEfm vIa15QCp6X0K/LHZquySc0dS6W5BYbmI8qchbs7roOl6lyrrYDDNuM92y2L6akuGAA8T hmLueTQ8Nk+uaKOLsJ0r+ucY60WdIYDqkuY34Qfy4EFCRfEFFhqSNk1aylRisfeFvCj5 aHbT0IfB2CPVmbrPAK9kwjwNRhhYGWIiJAyzB5gzM20gGxa8v267yD0WEjoKMm8k0kQf xP7iTRw3d7q5EQqbl1SmyR98wJ7+9sQyE08rUYdvkysyCxRhwZWYo1GSxEyT0yxNXo6G m3UA== 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:dkim-signature; bh=4haH37nTCSR+cDJRqiueZkRKSdfD02avHH86gdulGWE=; b=w2OzTz/OdVolsQyzk1TFCyT0a51kJv1dY3CXHaIagiiYQMoU2ugK6nij00Qs5BCtKT +bpuWF2OwHb8ed0IQ53yq4rhtZXINi6tF8sw67bgJklMSWV9Nf5z9pot0gXnPSbjb6CG c3Uf+b94rHFiYfevSbmUrxxMtmeH7sXCwa+Y52oVgx9XAp0yK9be4YnetnieKhEvzBys VLbJUT8EEFtyVruVeYicneZVecVSmwitTgImQFzu37rjbxkTbXb5yx/jpSXuXLBu7XAs P/EllakQRh+EspDXR/ThbsD3zq2Z9xZ6KgwcAqoY3/H/DJjZPT/gpZB25TP0JT1hnMPv O7fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rULuUj0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h22si996486jaq.60.2021.09.16.23.12.51; Thu, 16 Sep 2021 23:13:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rULuUj0C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1348694AbhIPSnT (ORCPT + 99 others); Thu, 16 Sep 2021 14:43:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:44496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348572AbhIPSnP (ORCPT ); Thu, 16 Sep 2021 14:43:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E1616103B; Thu, 16 Sep 2021 18:41:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631817714; bh=ulH418QMyTT2TWux7NsxncGiqxQYNH9YKErMukAqgrY=; h=From:To:Cc:Subject:Date:From; b=rULuUj0Cw0g5HwsjNQYePQw0z/0inRYajo6N7aFmixqexRwKn+otJiOrczm6+ieD2 UohJYs+rk0xmvnI5MWsucNBLrlAndRfBrpW/sWj1QL7ihamHFsdM31Wfv/K7veGuWw C17A/aU0S0nKhIxXjYJqszDb+Tye9nqCossveREXI7CSrVGxqd9YLdinzLe9XzN1A1 X0oPjLu6ZnC8aQd+xnVTPQ+OP0WsR8qYB4V1It6AskNUunlx3HqEH0i1bGHYiKz69D eOcSvtjhlHtoWMgjhylPyOjanLQJ47JjixMHHzIFFdWijzV5C7JoLigscNcyKj8b0G RS3NUPSTzvU8Q== From: Nathan Chancellor To: Masahiro Yamada Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor Subject: [PATCH v2 0/2] Harden clang against unknown flag options Date: Thu, 16 Sep 2021 11:40:15 -0700 Message-Id: <20210916184017.1881473-1-nathan@kernel.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, This series cleans up an issue that was noticed by the kernel test robot where flags that clang does not implement support for are unconditionally added to the command line, which causes all subsequent calls to cc-{disable-warning,option} to fail, meaning developers are flooded with unnecessary and pointless warnings. The first patch handles the problematic flags with cc-option for clang and the second patch ensures we catch new additions of unknown flags so that they can be handled properly. I intend for this to be merged via the kbuild tree but it can go via -tip if there is any objection to that. Cheers, Nathan v1 -> v2: https://lore.kernel.org/r/20210824022640.2170859-1-nathan@kernel.org/ * Patch 1: Change prefix to "x86/build" (Borislav). * Patch 1: Add link to v1 thread for more context (Borislav). * Patch 1: Add Borislav's ack. * Patch 2: Expand comment in source to make it clear that clang only warns on certain unimplemented optimization flags. * Series: Add Nick's review. Nathan Chancellor (2): x86/build: Do not add -falign flags unconditionally for clang kbuild: Add -Werror=ignored-optimization-argument to CLANG_FLAGS arch/x86/Makefile_32.cpu | 12 +++++++++--- scripts/Makefile.clang | 5 +++++ 2 files changed, 14 insertions(+), 3 deletions(-) base-commit: a9086b878b7fd65894eb8cb1fa395dd469970566 -- 2.33.0