From patchwork Thu Mar 3 09:06:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gow X-Patchwork-Id: 1600271 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=P/TuXu6v; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=CwcLSYEW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K8Q974HRzz9sG6 for ; Thu, 3 Mar 2022 20:07:07 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=HIqKRyoHR1AP17HvirwM6s62Y7lnI4UU5eo/qDP9EJ4=; b=P/T uXu6vnmby8OeYTSXAu7oM8kN5fQbTnPxw5AzRYci9cofJ9sHjcPUUrbnneT78F5xL41s/MtF+mNXm NS3rTHPHiy+gQz1XUgLCxcbapZyBaUYKmBEY2DqSn6XislDdas7DG+qWIHTLIiMHOhEob/xtbc+0a ZZ+ECiss9svlMJUh5JEMCKEY8e/XKDsxnYwoY/axfCqEIWNooxAKhhWvh1K6G2s49U93bCu5EbRqn Q0GTAiXvCHoq2byElmPnOLUrb5SgyaCH/CQFPgTCIucdjP7zkl2u0IEdY8PXv/32pusGzuYNR4wPn MZWlH0adtV41li2IanE2abMa2/WzY0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPhQH-005pth-1G; Thu, 03 Mar 2022 09:06:57 +0000 Received: from mail-pg1-x549.google.com ([2607:f8b0:4864:20::549]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPhQE-005pt7-0F for linux-um@lists.infradead.org; Thu, 03 Mar 2022 09:06:55 +0000 Received: by mail-pg1-x549.google.com with SMTP id bj8-20020a056a02018800b0035ec8c16f0bso2486516pgb.11 for ; Thu, 03 Mar 2022 01:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=2bQdkuF0SOPnoGthP45kPV6bs5nvMHTPUBqrBi7KDmE=; b=CwcLSYEWIYkwRIiSSoxKp+6DeCkwVywNCvkORnPKqsNTneqEIEtKoa1z3mwpqSO5W4 C4EHKgRYdUXjCIOSBiph61mK8NoMu3VVGZdQoh1vzbAAj6PmbcMhAyb+4ErMMn/svnDL FP8rthWhTrzh2Va1j3Zfzp+FYQz4qCJD1gVJd7MbjNd/ghRt2JDE69B0eP4rYOZJWtNk iy8+/9w5gmFETfLE9rVgJeZuSKmAoHiJKgxbZtHPkGMaD2ChCzD6jJS3mXJoVYXdg2Zb Nn0/DhX7zv8c3bY7H6zzF0hk+Q/LD8THdUGTyGynCcth2eoJxJBm37j1FQ/tcNYb/tBi a+Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=2bQdkuF0SOPnoGthP45kPV6bs5nvMHTPUBqrBi7KDmE=; b=RUjiTgadd1kC+s9NP1td6b4jSGNTazj8Dt7Ah6l4r/JkjDBf3g4mARnxl9i3RNyYBc 26REmrqnAEi+152H3Xv8iYvLtBEnXxRNNFMO4UZNXRjc4uTZKw28fFSi5WZm71wkUXi7 tReD560Y0PA/p+XoyL9TzC+G/Vta5okSkP9fVIHbRe+Gh+scmJXCnMlxIQc/HphKLovg agS2zuOXFNgxkdb1V0TZfxtbl8imtFX5A1W0wbeI5cu0mr8s80ElcBRwAIe0oRGyVZtd rfoe8+tpFCuHO1772rpL2bV0GO6PErsTlukVxi7gn73CMWJqlqpddjg/BanRXBYE4FrR 6ICw== X-Gm-Message-State: AOAM532pHtqueny1gpfoNLxXAgdzke1VycOE3HNORqHXP26lt/YhB5cW BjWlQs47U+CfgHsZAIizmn5qprynrmKvug== X-Google-Smtp-Source: ABdhPJxF438b/WEu22WxHZgv3A03n8SRdHWfJx5cX+REUymSJzQW01Ac5BTggzKnp1cW4D9MmVLPr1IGpLealw== X-Received: from slicestar.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:20a1]) (user=davidgow job=sendgmr) by 2002:a17:90b:4b52:b0:1bc:b208:dc5c with SMTP id mi18-20020a17090b4b5200b001bcb208dc5cmr1023750pjb.1.1646298411425; Thu, 03 Mar 2022 01:06:51 -0800 (PST) Date: Thu, 3 Mar 2022 17:06:42 +0800 Message-Id: <20220303090643.241747-1-davidgow@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.616.g0bdcbb4464-goog Subject: [PATCH] um: clang: Strip out -mno-global-merge from USER_CFLAGS From: David Gow To: Kees Cook Cc: David Gow , Jeff Dike , Richard Weinberger , Anton Ivanov , Masahiro Yamada , Nick Desaulniers , Nathan Chancellor , linux-um@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, llvm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220303_010654_072492_C385CDE6 X-CRM114-Status: GOOD ( 11.11 ) X-Spam-Score: -7.7 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The things built with USER_CFLAGS don't seem to recognise it as a compiler option, and print a warning: clang: warning: argument unused during compilation: '-mno-global-merge' [-Wunused-command-line-a [...] Content analysis details: (-7.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:549 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The things built with USER_CFLAGS don't seem to recognise it as a compiler option, and print a warning: clang: warning: argument unused during compilation: '-mno-global-merge' [-Wunused-command-line-argument] Fixes: 744814d2fa ("um: Allow builds with Clang") Signed-off-by: David Gow Reviewed-by: Nathan Chancellor --- This warning shows up after merging: https://lore.kernel.org/lkml/20220227184517.504931-6-keescook@chromium.org/ I'm not 100% sure why this is necessary, but it does seem to work. All the attempts to get rid of -mno-global-merge entirely have been met with skepticism, but I'm guessing that it's not a problem for just the UML "user" files, as they shouldn't(?) interact too much with modules. arch/um/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/um/Makefile b/arch/um/Makefile index f2fe63bfd819..320b09cd513c 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -75,6 +75,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \ -D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \ -idirafter $(objtree)/include -D__KERNEL__ -D__UM_HOST__ +ifdef CONFIG_CC_IS_CLANG +USER_CFLAGS := $(patsubst -mno-global-merge,,$(USER_CFLAGS)) +endif + #This will adjust *FLAGS accordingly to the platform. include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)