Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3744824rwl; Tue, 27 Dec 2022 14:31:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXuyoNxKYXM+5+N8cLWAdvBqT0W30HaBklN2LsLbbXNrBhJUOa3kZA7hIOdiYuFMTOBjP4lw X-Received: by 2002:a17:902:eb0a:b0:192:76d5:8c38 with SMTP id l10-20020a170902eb0a00b0019276d58c38mr9386965plb.22.1672180297486; Tue, 27 Dec 2022 14:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672180297; cv=none; d=google.com; s=arc-20160816; b=omQIEAd7VyVevFTiTKR5RvLveR0bV7ioG5FiIzf/0bgJhJFmPZmizD6YtI8pqd1bCe Dk/uxGi/izKKc/5WDYeD6Ex2MSd8MbnWzeeyGwR1ozv9qOC2WCr7wjf6nPvOUpNUFvbf to1Cz3McetXUSPEUv2RSUeD9LsGkcBpIm8Hi4SbTxHBrCUMLmFfbmwekLtbbh8IWmyI5 X1DDpKNth81/LPWw5GjkarNTb4BY/dDEcC1wqIpNbAVZ7mUv0gxKyl357aR5E+cBopPV wx8yoXv3igtrGs39sv/sYiK50DOibJeh8pq62HITsk/HCeuYV5BnFHJoto8BRObC54sE 7wjw== 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:feedback-id:dkim-signature :dkim-signature; bh=C0mduqepIxRredmqLCGAPlCT9t1Daw7dkB3PcPVQQ3E=; b=XbDp4rfkX3QwUeb2Vyps+a6AITdBwAT9KJRPuc/TlkBn+CWhAVzfmboSxi6siVF1UR JXm5vxFNIpzaGAMlvBjcFjranHS4oaeeeIfoV8re5ThwmisX88orzyqpSD2RWb+udu+/ 9t9/9tRAy2735KUERNrLE1SFzfeSIg4vtvbIsEhU3U9QFKB7kn4wVPqLxy+6m/Xe245f ovhaagzmouGGMSRDEr1LRV6nCGBRhNHONvJ+wgVRT2GaHy8PzMRuqm9dPBWzW57ckFMO LL2sgbnYP+aHqFsQ4X9wH0T5PwohrOLb9Tt7LG71SPAkeAx1YtyjHH/ixxfl8wVaF5mq I6UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=nY0dxDhs; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="WurPVl/t"; 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=sholland.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a639247000000b00478fd9b75c9si14862854pgn.869.2022.12.27.14.31.29; Tue, 27 Dec 2022 14:31:37 -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=@sholland.org header.s=fm3 header.b=nY0dxDhs; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="WurPVl/t"; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbiL0Vsn (ORCPT + 66 others); Tue, 27 Dec 2022 16:48:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiL0Vs2 (ORCPT ); Tue, 27 Dec 2022 16:48:28 -0500 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 951E5B23; Tue, 27 Dec 2022 13:48:27 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0046B320092C; Tue, 27 Dec 2022 16:48:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 27 Dec 2022 16:48:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1672177703; x=1672264103; bh=C0mduqepIxRredmqLCGAPlCT9 t1Daw7dkB3PcPVQQ3E=; b=nY0dxDhsd+tCGN802X+bhYqSPy8PYau9FRg3vhaCY VvlLL9Y9Pl55nCRZPB2bRhJXzyJQu0c4A3ztUNZn/MOuBlvvFO4eHFyiTWk5eAvb /VNW9WPjpGL/AvyYsGUC1pWUXlFRdzxA9YZyqU5/v1mUtaOw/lTpEAJjO50YYdIz ny2vEjKAPgLt61JKet83zl3CoHvN7oxYquuReIjGkZhQTBUR2eMvZDosRsMewlPL R9IX0aN+T0F9Oh+f5FVcHRLfJRHc12k4JD2r2SYYtDVq2Dlnxf//67Jko527z1HJ nQF3rNM/lqHHVoh5VuhFNb8A6l6tCIgrh610v4h7FjxAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1672177703; x=1672264103; bh=C0mduqepIxRredmqLCGAPlCT9t1Daw7dkB3 PcPVQQ3E=; b=WurPVl/tTUBytSRQe8TuOosBIVTX78y/9kLmo0nTKx++EweK9bi bPf3xfzlDOl+Xxk4t0npclfNhzybYc/mN78UOfUsaBH7aeIduZ1km9PYZaA2ox5C 9thueB6zjOrGdX6IV1VfekgbGHwr/UuhMN/kFGR4mcz2xztZGkJiLuKhLd7U1te8 Ef8ZzRadLKUw1YOICJBOC2Cxsup56UJE6OdXERKe2l8jl+58F1brw8tSsbxvBMrY GrteUJO23aYlDhtS/GHXgyG5N4f+0bcUqOKZSj94P9be045o9PLojCn9q6gJk7iP F482qxgggzs5aOdPR0pJ9USIPkTpUFfhqtw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedriedtgdduheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepkeevlefhjeeuleeltedvjedvfeefteegleehueejffehgffffeekhefh hfekkeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Dec 2022 16:48:22 -0500 (EST) From: Samuel Holland To: Masahiro Yamada , linux-kbuild@vger.kernel.org Cc: Samuel Holland , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: Fix running modpost with musl libc Date: Tue, 27 Dec 2022 15:48:21 -0600 Message-Id: <20221227214821.16495-1-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 commit 3d57e1b7b1d4 ("kbuild: refactor the prerequisites of the modpost rule") moved 'vmlinux.o' inside modpost-args, possibly before some of the other options. However, getopt() in musl libc follows POSIX and stops looking for options upon reaching the first non-option argument. As a result, the '-T' option is misinterpreted as a positional argument, and the build fails: make -f ./scripts/Makefile.modpost scripts/mod/modpost -E -o Module.symvers vmlinux.o -T modules.order -T: No such file or directory make[1]: *** [scripts/Makefile.modpost:137: Module.symvers] Error 1 make: *** [Makefile:1960: modpost] Error 2 The fix is to move all options before 'vmlinux.o' in modpost-args. Fixes: 3d57e1b7b1d4 ("kbuild: refactor the prerequisites of the modpost rule") Signed-off-by: Samuel Holland --- scripts/Makefile.modpost | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 5eb5e8280379..0ee296cf520c 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -55,6 +55,17 @@ 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 +modpost-args += -T $(MODORDER) +modpost-deps += $(MODORDER) +endif + ifeq ($(KBUILD_EXTMOD),) # Generate the list of in-tree objects in vmlinux @@ -113,17 +124,6 @@ modpost-args += -e $(addprefix -i , $(KBUILD_EXTRA_SYMBOLS)) endif # ($(KBUILD_EXTMOD),) -ifneq ($(KBUILD_MODPOST_WARN)$(missing-input),) -modpost-args += -w -endif - -ifdef KBUILD_MODULES -modpost-args += -T $(MODORDER) -modpost-deps += $(MODORDER) -endif - -# Read out modules.order to pass in modpost. -# Otherwise, allmodconfig would fail with "Argument list too long". quiet_cmd_modpost = MODPOST $@ cmd_modpost = \ $(if $(missing-input), \ -- 2.37.4