Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1395407pxb; Thu, 4 Mar 2021 10:11:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxoqavALElscDy9fpGkpPB40+nXfh8FmAvj+N0lGA/nyMk+r4UzbyADb+2vipp6tKJxW+X8 X-Received: by 2002:a17:906:8614:: with SMTP id o20mr5514616ejx.386.1614881475598; Thu, 04 Mar 2021 10:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614881475; cv=none; d=google.com; s=arc-20160816; b=KQveppd8SNK8ieG6OteNTHZ4mPoJV/8Xdw2vn9Dpd3Fu3nVCvnZxtcJ+Deh5WKpRPb 2YxILmAfcB5dWk5w89xtUCx8tGTvUvIR781pH0WRaCU5t6SG/xMC1xLU+MD+88JP4xrf a5cdtPDFaA3Jg9GhJ9a6jTO9U6AqESvN3J0NXAuQQcB/MDng2ZNSUWLTMySe9qoLJCBw oL/pAtdI57Ar7JFdvO8sM5Lmr7m9436jrKCM+xWWg/vOKONKH8bn7nWE37+JUnaof+QJ QXmy/lROfdv34JeodvqRdh+C/tRnL/W7Rv3auNV6PWcxCfvl6kEVi9tdMI7ApUFqV5uN NhVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to; bh=hoAzMkO6sXItLyIJ1/axDVUD2rLy/ODXbePbo5mu2Tw=; b=TwvIQcEoxBD9CwskdTrcY9fA/Fk4UtJE/CtwOtKJqAFQwKVTPVanQDvzOWP1sHX34m ENMmJx2Kgj4znRaEdXR/5iIVqcq+0/BskTZHA9uWg7S53YRxACVEC0+KDXrQ2sX6eBMY CkRkJIePdsiqQOnV+InHLFjDOlo4Bzs2x0yb/96kq1NcicA1shq6sfeNaCsgscwS6mXz ThSbfkV2RygpoQM0KrbxiYNWbiHkoTjyp89zpM4w/lAbOyyg9EhpugelPmbSAr0QymvO Of7AUR6MFDy5jBBGR4WfeilT7T+PyptfXqMCddq2vrlPM55ENnfomj0FYwoJbisWqhbf NWdg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lj27si9407638ejb.513.2021.03.04.10.10.52; Thu, 04 Mar 2021 10:11:15 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236841AbhCDQWo (ORCPT + 99 others); Thu, 4 Mar 2021 11:22:44 -0500 Received: from foss.arm.com ([217.140.110.172]:40770 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236824AbhCDQWT (ORCPT ); Thu, 4 Mar 2021 11:22:19 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E07A91FB; Thu, 4 Mar 2021 08:21:33 -0800 (PST) Received: from [10.57.17.29] (unknown [10.57.17.29]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 641803F766; Thu, 4 Mar 2021 08:21:32 -0800 (PST) To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Cc: Michal Marek , Masahiro Yamada , Vladimir Murzin , arnd@arndb.de From: Vladimir Murzin Subject: Possible regression due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost" Message-ID: <42e0adf2-dbf5-9c1b-a18d-05bf5f1960a1@arm.com> Date: Thu, 4 Mar 2021 16:21:40 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Recently, I had to dig awkward build issue for external module (originally with ARCH=arm) like MODPOST module/path/Module.symvers ERROR: modpost: "__put_user_1" [module/path/name.ko] undefined! ERROR: modpost: "__aeabi_unwind_cpp_pr0" [/module/path/name.ko] undefined! and it looks like it is happening due to 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost" Here is result of my investigation (with ARCH=arm64) $ git describe v5.7-rc5-72-g269a535 # Start with clean build $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 defconfig $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 -j5 > /dev/null $ cp vmlinux.symvers vmlinux.symvers.defconfig $ cp Module.symvers Module.symvers.defconfig # Alter configuration $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 allnoconfig $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 -j5 > /dev/null $ cp vmlinux.symvers vmlinux.symvers.allnoconfig $ cp Module.symvers Module.symvers.allnoconfig $ diff vmlinux.symvers.defconfig vmlinux.symvers.allnoconfig > /dev/null $ echo $? 1 $ diff Module.symvers.defconfig Module.symvers.allnoconfig > /dev/null $ echo $? 0 So, Module.sysver not reflecting changes in configuration, yet IIUC it it supposed to include vmlinux.symvers If you are lucky enough with stale Module.symver there is a chance to fail build of external module in very awkward way Obviously $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 allnoconfig $ ls *.symvers vmlinux.symvers With that external module build would splat WARNING: Symbol version dump "Module.symvers" is missing. Modules may not have dependencies or modversions. Also, there are several reports on user forums describing symptoms which could be due to the issue, with workarounds like "enable random in-tree module" or/and "create empty Module.symvers" One commit before 269a535ca931 "modpost: generate vmlinux.symvers and reuse it for the second modpost" $ git describe v5.7-rc5-71-gf1005b3 # Start with clean build $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper # Build defconfig $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 defconfig $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 -j5 > /dev/null $ cp Module.symvers Module.symvers.defconfig # Alter configuration $ CROSS_COMPILE=make ARCH=arm64 allnoconfig $ cp Module.symvers Module.symvers.allnoconfig $ diff Module.symvers.defconfig Module.symvers.allnoconfig > /dev/null $ echo $? 1 As you can see Module.symvers gets updated $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 mrproper $ CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm64 allnoconfig $ CROSS_COMPILE=make ARCH=arm64 -j5 > /dev/null $ ls *.symvers Module.symvers As you can see Modeule.symver gets created Does that make sense? What I'm missing? P.S. I've also checked v5.12-rc1 and see the same symptoms Cheers Vladimir