Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3286638pxj; Mon, 7 Jun 2021 07:06:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKYO+6X6+vBmChFEbuKEqeOu28llkmVMAA6vR056yl+HVDpAWkpKIC186Au/m35HeJpqEb X-Received: by 2002:a17:906:f849:: with SMTP id ks9mr17457501ejb.402.1623074802569; Mon, 07 Jun 2021 07:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623074802; cv=none; d=google.com; s=arc-20160816; b=W72R8FGHw48zyjx/aZJKzikrMX+CNn1QE9LUqmaGJfBSULzQY5jBgIXVO61Ilg5Ty8 hHx0OW/cCArhPNy+uggxONvduHYI3czIAi6hzB2NJNzrWg4EHkNeBDDeuERintVHRkop CvUoASrTRrpLC+AWQfhFW0rrEEvtcic84lGBQTaAB30Ck/aaYLeSeg3eRXi/s3xa/vHi J4zO3P31Uf2n0plMRh9ox7xC84RVbFfUaCEgIzP0U0HPUCuX3dI6hI9Pvw00K9G+F52/ 1A5xjdm/qIMp6vOJufnDTeF03aW0yLnPC0YKs8CYPnECvyugY20BJifsYWrJLXHqLt+e Td6Q== 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=5dgM97Oy1xcKKiW3KcreEkXB8zsHdy1PEmvsFA1fSRI=; b=tc/x5Hwtd9jFsUuRJEZuWSWDUJKpf4Eb/xgdU923xkYxJULGAIDsZlP41n27IjFQbY QM35y7MFiuKy+PALNyUOocWi5NfN0Cw/i9DAuTgVLrCT/NOru2MPRLFkNomsPpkacfx0 GYC3gzE5nPkGYg2rCA+7b1+2C3dxx0pZfXRYWUeifVAiQbUB+G60cdVfRZJ81l8MXajM moGHnKhwKm2CrlPkZgpu6WuX4Nvk7sdhZBD2wGdnM1F2B2wNAdIkvPB/Vlp2fPDBK2Tl hxtGWaDNqHNi8toXnS/tqw+QSPwgDRzPg1oznBk56QBET+xKYcyYpbiius9fx1y2/9bm ZyPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C2fP2pxJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si12412381ejj.325.2021.06.07.07.06.19; Mon, 07 Jun 2021 07:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C2fP2pxJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230241AbhFGOEq (ORCPT + 99 others); Mon, 7 Jun 2021 10:04:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:33288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbhFGOEo (ORCPT ); Mon, 7 Jun 2021 10:04:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD8086109F; Mon, 7 Jun 2021 14:02:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623074573; bh=aserT3q6jOf57au2hItknEiG7cSh5lnmlXSxZfbqDjc=; h=From:To:Cc:Subject:Date:From; b=C2fP2pxJipZzf+Hjy327afYMWqdKrPO18x3S02BtVA5hQAVPW092HUTLWsjDHdQd3 nkuncZEUjslbjLqcqTTRyUnUS/fPfsai+5idp3yGpgPsPOiMeR3ncWDBkndx/cnUX+ 7pIz1pGi/PooYxF5l8deHb6c3G+RhEhu5ZxkhTVTl3/rpCdNHya8/k3cpBaPKN8IWQ tmPCHvLjrExAhMf0z39OvRA7EcLH4UiWzeMIe6y+0aYoH3W9XG0DRL/I/xEUbCmaJb 4lvY0xQSxUmX4m1AKtH/CdquPLlNMa2Rn5Y3vBtAlGMWLaDGtq3X6eV29BuP+pKsYl F1XtlMNs1Crjw== From: Mark Brown To: Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown Subject: [PATCH v2] kbuild: modpost: Explicitly warn about unprototyped symbols Date: Mon, 7 Jun 2021 15:02:06 +0100 Message-Id: <20210607140206.38131-1-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1596; h=from:subject; bh=aserT3q6jOf57au2hItknEiG7cSh5lnmlXSxZfbqDjc=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBgvibRPmVHI7SQlUyeFcr/tc/rTe0sU5rnWB/wQteb fzpUTJmJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYL4m0QAKCRAk1otyXVSH0EPCB/ 406pSaJOnUQOqTA2jvEEEVW+O/FLuDgSMjb5iJufEdZxn3ZR7Nm/fDe1ayDURiKZn9mLAOLLCJ/bz5 aimkZZK+U9X2tFu95kcbxKbRlGkU1TkHBja0d+QpTOPiOgssnUOMTQXEV9iC5MT+3g2GCttA1RPrIZ WJJsuqLgutvww1jee10dITzBeHqW764q85gajVB3pOK+HnUVa9+DQtjMjnSEw81mPtzr9LRhh9b/oG DiVZB+yJuxqUNEe8dqa4R7EDb+tbVNDd4PxQ9zoOBUYogTMac8X/sXtOCkQSCMyjV85DqxURR/jwY6 lobDxw+1WZVV6PvvG7yq1kpadatDSN X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One common cause of modpost version generation failures is a failure to prototype exported assembly functions - the tooling requires this for exported functions even if they are not and should not be called from C code in order to do the version mangling for symbols. Unfortunately the error message is currently rather abstruse, simply saying that "version generation failed" and even diving into the code doesn't directly show what's going on since there's several steps between the problem and it being observed. Provide an explicit hint as to the likely cause of a version generation failure to help anyone who runs into this in future more readily diagnose and fix the problem. Signed-off-by: Mark Brown --- v2: - Reword and reformat error message. - Fix duplicated is. scripts/mod/modpost.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 3e623ccc020b..270a7df898e2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -660,8 +660,11 @@ static void handle_modversion(const struct module *mod, unsigned int crc; if (sym->st_shndx == SHN_UNDEF) { - warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n", - symname, mod->name, mod->is_vmlinux ? "" : ".ko"); + warn("EXPORT symbol \"%s\" [%s%s] version ...\n" + "Is \"%s\" prototyped in ?\n", + symname, mod->name, mod->is_vmlinux ? "" : ".ko", + symname); + return; } -- 2.20.1