From patchwork Wed Jan 4 14:04:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 38941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5159779wrt; Wed, 4 Jan 2023 06:05:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXt9fuK7gprILORZ2FHDdTNiX9UBSsvdRbyFmONHxZUoJ9IbxTy4bU3YuE2c8E0jxnQ3z05d X-Received: by 2002:a05:6402:375:b0:46d:ea1e:fed0 with SMTP id s21-20020a056402037500b0046dea1efed0mr51297400edw.40.1672841151369; Wed, 04 Jan 2023 06:05:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672841151; cv=none; d=google.com; s=arc-20160816; b=lNF+x/1A07rEJSLvGrsUNtPdpQA6iUQXoiBqsgnXg+OpgM7ues1s6BvgCfwidg+4vD NFcA2uc32U1gxX/OgytepfkgMioNVkwpsDZqTuGHnyKjUFzQ82zSo+HpdAhAQhIebXmD 8MzCNL0ksgzauRXZm9y2ShCivUKziEmaNEfjlN8L3wJwCHCCqxBDPHfkmISEstUuT/Na IvEdNMUnF1P9U2jWfXKpK5KvOXVbcHtUzSfRESq2mGD8ZFTa3WhSO5od6MzbT0KjEiJz ZVOk0sXYDPmmnli6kj25kjttfsKmvaBOitGA1d+PHzvlKUycJIUJcYsqvocfoUCYJ1xI PeDA== 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=R/lsUVvIfdlzH8WV4EOh4vAQHuLDMVPueGkIO9qRt20=; b=qY0LugFBOEQ+MfrSdGkz2djVoY8praLqtN97N9/IFFPb1VxjHyeKWRShjdGQkVi0/x LvS9crhp8Wmq5Z6P/GNxuSfC5lQy6xsPKwgjYORBtIMX7+c2mceRBW/jNlWfjB6jwLoY 8artn8Juf1ZlXTYDbmTwFaz+ZHCkbJBG3UNrF1N6NY9YVTPRhIKZVW7wIKBooZ0HhZ7D 5M2ybB4QLsvuPSC9cvJiE4+Me5NrVxAUvl0xz9lMRWo2SoiSwO8ov+xHVrTVh8GqI58x ouQXFSC+bSfcWCCRRV7tOrs6IMFg+s511jOu6/CSu8stYGaiCKdwhttOpx79PZs7bX9o 9Prw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Q5xS/8tR"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bq10-20020a056402214a00b0047da6021798si26113778edb.93.2023.01.04.06.05.27; Wed, 04 Jan 2023 06:05:51 -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=@kernel.org header.s=k20201202 header.b="Q5xS/8tR"; 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 S239116AbjADOFQ (ORCPT + 99 others); Wed, 4 Jan 2023 09:05:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239408AbjADOFI (ORCPT ); Wed, 4 Jan 2023 09:05:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 337681ADB4; Wed, 4 Jan 2023 06:05:07 -0800 (PST) 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 dfw.source.kernel.org (Postfix) with ESMTPS id C805B61749; Wed, 4 Jan 2023 14:05:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 696FFC433F2; Wed, 4 Jan 2023 14:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672841106; bh=t7ngQQQN3uCpv6taEAtH34papy8bHWs3zIWKFrM+v8c=; h=From:To:Cc:Subject:Date:From; b=Q5xS/8tRXpLmFeZQai64AociTVLzH8VHJqEIDVlRozJFHRD+CP0Ghjspv7dHa11er JpFRw/b1fvxOi/75vyzza66qTKBKUPpwjlvOYRDwb5bvkhaAe0QALZimbKo5h+7aS4 /2cjJjC4ufcspsJLZZjcKQzNEvxlC/ESmMuwb7fKdxBHzOiEmgiSEUhRGAweIUkmpv B73OI4kkZAZkgrKet0pi6hnVaqMmYbSf8FyhBHHo9liowTcLNxoO7RfxuwFMBKQxuL WEacz895NOTShPdzc2+E1CQdTSDQHPYszwTMSO95D46Wos3ph6X1Ftaoyatr+89CUu RCcgftZPKbZUw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Christopher Schramm , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Samuel Holland Subject: [PATCH] kbuild: readd -w option when vmlinux.o or Module.symver is missing Date: Wed, 4 Jan 2023 23:04:59 +0900 Message-Id: <20230104140459.1147626-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 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 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?1754101082903133517?= X-GMAIL-MSGID: =?utf-8?q?1754101082903133517?= Commit 63ffe00d8c93 ("kbuild: Fix running modpost with musl libc") accidentally turned the unresolved symbol warnings into errors when vmlinux.o (for in-tree builds) or Module.symver (for external module builds) is missing. In those cases, unresolved symbols are expected, but the -w option is not set because 'missing-input' is referenced before set. Move $(missing-input back to the original place. This should be fine for musl libc because vmlinux.o and -w are not added at the same time. With this change, -w may be passed twice, but it is not a big deal. Link: https://lore.kernel.org/all/b56a03b8-2a2a-f833-a5d2-cdc50a7ca2bb@cschramm.eu/ Fixes: 63ffe00d8c93 ("kbuild: Fix running modpost with musl libc") Reported-by: Christopher Schramm Signed-off-by: Masahiro Yamada Tested-by: Samuel Holland --- scripts/Makefile.modpost | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 0ee296cf520c..43343e13c542 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -44,6 +44,7 @@ modpost-args = \ $(if $(CONFIG_MODVERSIONS),-m) \ $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ + $(if $(KBUILD_MODPOST_WARN),-w) \ $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ -o $@ @@ -55,10 +56,6 @@ ifneq ($(findstring i,$(filter-out --%,$(MAKEFLAGS))),) modpost-args += -n endif -ifneq ($(KBUILD_MODPOST_WARN)$(missing-input),) -modpost-args += -w -endif - # Read out modules.order to pass in modpost. # Otherwise, allmodconfig would fail with "Argument list too long". ifdef KBUILD_MODULES @@ -124,6 +121,10 @@ modpost-args += -e $(addprefix -i , $(KBUILD_EXTRA_SYMBOLS)) endif # ($(KBUILD_EXTMOD),) +ifneq ($(missing-input),) +modpost-args += -w +endif + quiet_cmd_modpost = MODPOST $@ cmd_modpost = \ $(if $(missing-input), \