Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp632782pxm; Thu, 3 Mar 2022 01:10:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJcfXR108gIk9kKsJTP+gFn6dDpdvSRha6Yabioev9EWmS1lJBsEPZ/4xPJExcu++6+6lx X-Received: by 2002:a17:902:d2cd:b0:14f:c169:dc6f with SMTP id n13-20020a170902d2cd00b0014fc169dc6fmr34621470plc.170.1646298610035; Thu, 03 Mar 2022 01:10:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646298610; cv=none; d=google.com; s=arc-20160816; b=S5cjOvNFszn1D6b/xG5rY8Lft8o2tyS/fYcg+kxXYS5mlbG6suIXyGdpMlR7jhcNLh sAKSFWUNnfvODKcmNYXK02hey7TgaW2LS0gldYJjRFwfyA2MnK3HMkkCe+gHrcRfo253 0N7+oQTLifpw9jvf6HB9BoPg59mXg5Jz4Y7pj6qv8wV+KQLOMP0uwSDkdqNtwU6LxuZq 3giSxeun8kB9cijByKV0PiiB15HRIs6q2YjW8k9/t8YtusQ/dN13wkoUonbxlVBlOJqW NyVAKWa1Lehp+gTQ0boauCjY97fGkSFzc2aScj44093JPSai56z0OMhaXYfC2qcCHiZu FbHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=2bQdkuF0SOPnoGthP45kPV6bs5nvMHTPUBqrBi7KDmE=; b=Zcht2EqMb7ORK0vHTCuY+GSlHi53XSAG/x5XjBFrdv24vkdgrR3I5z4bGlezMbO1FI 48dcQx3syb8OTV3RD00iwlYIPZZyfti3/t/XXHY2to4cmSoeYrgm/58eOHaAS5HVCyMT 7rWP/kxp5JeGdUBwxMEpliCSDdeRTQ0CLvf6CwjcSQwp9sdL4junjVFPLvqIJEaHOksj hafQng0Z5M6D8cfQNFWdH4Otz4tW7XFItB+v+WwugczHE5iwCZ/xDZTGKMargnex4f86 OhBNBj/a43zDsMzvdf9FcDRbktdEB+j0R62duLF+KDF6P0+i7vXqI/sAPNpK7EW7IlON 8CkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CwcLSYEW; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b84-20020a621b57000000b004e12043af1esi1363110pfb.62.2022.03.03.01.09.53; Thu, 03 Mar 2022 01:10:09 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=CwcLSYEW; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231787AbiCCJHm (ORCPT + 99 others); Thu, 3 Mar 2022 04:07:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbiCCJHh (ORCPT ); Thu, 3 Mar 2022 04:07:37 -0500 Received: from mail-pj1-x1049.google.com (mail-pj1-x1049.google.com [IPv6:2607:f8b0:4864:20::1049]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C0A417776E for ; Thu, 3 Mar 2022 01:06:53 -0800 (PST) Received: by mail-pj1-x1049.google.com with SMTP id y1-20020a17090a644100b001bc901aba0dso2205871pjm.8 for ; Thu, 03 Mar 2022 01:06:53 -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=4Pkvtnlt1nqB7aGLlqC0b6yjydJIjZnAZ/w2GdRUaFcUp9dj8H3hXunLhC1uI697Qk kNUv6c81wBecU+cyZ6TN6A+wgLO2OnQl4QK5YWjj99uM9ZjYio5nyJrq+V+gQc0zlVxV voTLMj9MEHGMQAb6cKt9jBuXhGzMFfV6BMJf2hNDGqmFii2BjlYQOxnXljGpGjrVowjz sPLeFBGDHd7CsymdI5Ri/FcrGwVuYBo0YmonaGgf4TGXK+twiRbDohJhbSlhBLUHfHkd lCEKP25Yka7iEHTgK9ZqgrfstJLjrMZECo4rPYJXkLOJPFGi19q6d4e+Y5n28rXVJC1v i9qQ== X-Gm-Message-State: AOAM530R2fKUjoveip28RR/Y2sQqd3QtwZ5rOfFEHsnwrQmGqAq7kHKe vP6oIfbxkHsgfZVcuw4pvhfjnobruGsiIw== 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 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 --- 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) -- 2.35.1.616.g0bdcbb4464-goog