Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3662568pxb; Sun, 27 Mar 2022 02:31:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLJ5ayp4dwMoFauI90gudkbJHo1tw0/Zzxe4PSl6MEj5I0QewIKdGiVqr2Bp4TwO0+29AK X-Received: by 2002:a17:90a:be12:b0:1c7:aea:b384 with SMTP id a18-20020a17090abe1200b001c70aeab384mr22480375pjs.178.1648373486769; Sun, 27 Mar 2022 02:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648373486; cv=none; d=google.com; s=arc-20160816; b=rdVBu6fS9caxKgub5PvvF2ZxVLtKUL7vh18UrmA5aSX5obUIqXRfKfhz+S+w8nDTpc dlcFJ7xXpUZVSGHsrGNtCbIpHyuXjamU1AITVaTqn0UHLRVgOkLw3Rh6aWNy7Clv7vgT jzONG7r3oBG1aZ11/4CPzz+UzAmY9oxv/TEVTEabxH0+3uEpKi3CrGjwESiLx1Gu3bKl teVpiCtV4gOsCj8nXYhDw1pYNXt4BWr6rxwtvtJM5++YVIWtlJFNEJOT1hKGmO4Ifg+I wYf7NGI/kKkTRMVRsSCGGIYOl4lpmQMsi6VxdCZ8VM5UzOFjFdtyKXqAiVBsxB/jM29i f2GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Oq61TJAeopFgskVcaFWQC6f8M3/34lTNTSPOABT13+I=; b=hRa9Lv8KlLtKAM6BT09VOLCNtMFNyLuZU1NktAA+O1yqdgwzjfjhKi3on8OESHqSvL 89kvGO1xlACvkkpMnXEQAcIxWpM2BAqoLvUkCOiVnuEXTX0jOLtdRj9W6zpHtaZP0n9I Cp/VYv2+RPPZGauB9UBRro16y3Eklc6byFj0r0W1YLYpHpS3lOCVfe8q/l+wTzZHVrZP 1X8up5eoBCj/dVdGw1cKJETzsOigCClE2nd3Vvd5b9iar/y3Fm8O7TJ074FpEyWEAWyR buz7BmsPbsxDdAfad0Zjo9c8m5+fJ8szBnC1O1tUQCKNrzjCdHHq9RWNrB6PVE6IsOTH myxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=khWXOIAg; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a170902f54300b00153b2d16613si9342578plf.539.2022.03.27.02.31.12; Sun, 27 Mar 2022 02:31:26 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=khWXOIAg; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234864AbiCZUB5 (ORCPT + 99 others); Sat, 26 Mar 2022 16:01:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232824AbiCZUBz (ORCPT ); Sat, 26 Mar 2022 16:01:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45BE8554BC for ; Sat, 26 Mar 2022 13:00:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EEC21B80B4F for ; Sat, 26 Mar 2022 20:00:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D3F8C2BBE4; Sat, 26 Mar 2022 20:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648324815; bh=w1S2sozUrJXSdf8UVBNRrFIn4nOpImB/x51FVZxOxzA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=khWXOIAgFnEB4hWvMbR1ordDbuC7r1wB9fi+Yb7p/HOvA3ApShogONQYrhpON8kng HJgtBPJkIM//jNRkuRyxU38L9sEhwxDuU0wRpQeyZAc0ZqCCqCOGDwQMfXsEmYo8L4 FiofT8SsV6bitKCeOLGL3boVSpyq2HLTAPwwFhfn43/AHUqDcMB9T9culXIvuuJ7oY 7lxqaFspjBROwgbTXTK/LHbNwHN9G2Ci8qWYkGsdwQzMzQVkJURVUZhCTlrf4YAHql LGO/DfGeD/CpJqIG9AKZOVxyaezzJwJIDBNDRdGzbAEW18EAb1Fg7/1lto41kf3Od8 wdhdtPDJa85cw== Date: Sat, 26 Mar 2022 13:00:08 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: Richard Weinberger , Anton Ivanov , Johannes Berg , Nick Desaulniers , David Gow , linux-um@lists.infradead.org, Linux Kernel Mailing List , llvm@lists.linux.dev Subject: Re: [PATCH] um: Fix filtering '-mno-global-merge' Message-ID: References: <20220322173547.677760-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Sat, Mar 26, 2022 at 12:29:55PM +0900, Masahiro Yamada wrote: > On Wed, Mar 23, 2022 at 2:39 AM Nathan Chancellor wrote: > > > > When booting a clang compiled UML kernel, the kernel panics when trying > > to run init: > > > > wait_stub_done : failed to wait for SIGTRAP, pid = 651294, n = 651294, errno = 0, status = 0xb7f > > Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b > > > > After the commit in Fixes, many flags from KBUILD_CFLAGS do not appear > > in USER_CFLAGS, likely due to USER_CFLAGS initially being a recursive > > variable ("VAR =") then being switched to a simple ("VAR :=") variable. > > For example, diffing arch/x86/um/.ptrace_user.o.cmd shows flags such as > > '-Os' and '-fno-delete-null-pointer-checks' getting dropped, which both > > impact code generation. > > > > Rework the filtering to use filter-out instead of patsubst, which allows > > all the patterns that USER_CFLAGS cares about to be excluded in one > > command and ensures all flags from KBUILD_CFLAGS are transferred over to > > USER_CFLAGS properly, which resolves the boot issue noted above. > > > > Fixes: 6580c5c18fb3 ("um: clang: Strip out -mno-global-merge from USER_CFLAGS") > > Signed-off-by: Nathan Chancellor > > > > Can we remove -mno-global-merge entirely? > > > 61163efae02040f66a95 was a very old commit, > without enough explanation. > > Shall we remove -mno-global-merge, and do compile-tests. > If we are hit by problems for arm/arm64, we can re-add it. Yes, I think that was the conversation that we had on the commit that this fixes: https://lore.kernel.org/r/YiD7R2wRxoWxtVq7@dev-arch.thelio-3990X/ I can test that on my Raspberry Pi 3 and 4 on Monday, although I would like for this patch to be picked up in the meantime so that it is possible to test UML on -next with clang. We can remove -mno-global-merge in a follow up change, if you do not have any objections? Cheers, Nathano