Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3401207pxj; Mon, 14 Jun 2021 23:28:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiv6vtgVtXoyT5vja/cAYOMkEmiTPf/D/M7zQeqZ/Gvj2bQ+3Pl5qyXaIZhxDSZJUihX44 X-Received: by 2002:a17:906:5657:: with SMTP id v23mr7160774ejr.90.1623738537510; Mon, 14 Jun 2021 23:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623738537; cv=none; d=google.com; s=arc-20160816; b=h1aSUDVft6qvrj3XcUHj/VzkYI5MhYhyw/GflD2Zcb2Xe2PO3HTB+YgEXEzKixfh9V jAH1HXm2UJEcoyDJqVNj5AEn71Z+jHzqtoiuJbL7RBwIKroZ+rU8YO9sO/Za2GGUoF7Q ZpVfUWTLrQEl5sRton34vm9R53ng+NDjuvfSvw8ypgDlU8FZcdvbF3V7FyQ2DtG4DYRk Gd3JO5vWuHuIfyrMp2Aoe77+lkiyxv9bNo2dVf/PmrYlZJc67+Jk9S0+GoIKah53nyZd nN8b7Es3PEWF52SgXp4G6eqnRE+PztZdVtnxkUlj0aokxou5GEdmv+Lmto6RorlkxcIv WxFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=h86XvEo//hkv2s7D873Ta+hGzcQhPBzGwR/Qd6upzrk=; b=loIlDS/CtB/yrdtceT0w89upkp0Nu6h2i0wkNAerI5u6OctO3wEIdpzY4lnNrxF/f6 +Y5Eaq+wCwVlN7xFF1rBZhP+TnQoAFryD2REw8qpgJ5AMr4h7JnQvAHmNQgKBiFMcYdG GqFriwy37ACWNCQO0XJ1zmRRjrHYT124AEjJ4ltwQsZiSC8KDyTIoPBXdbAIdtMASUjk 1tttX2Ca1ZcAoccs8+d34BirQ4OXR6MLSOB6vFEcfBS6CXVjtHDwWkCwPJzG7C8EjogN jP1Xzgmc1zz5FSvlMBhoh7W23llm0vmfyIZteVP9av03SVXeGKa4uDs63tG4bFQtFIrB NM6Q== 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c14si14492615eds.568.2021.06.14.23.28.35; Mon, 14 Jun 2021 23:28:57 -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; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbhFOG3J (ORCPT + 99 others); Tue, 15 Jun 2021 02:29:09 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:53390 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229968AbhFOG3I (ORCPT ); Tue, 15 Jun 2021 02:29:08 -0400 X-UUID: eec2f9026ec84ccfb2496baa8727fbfe-20210615 X-UUID: eec2f9026ec84ccfb2496baa8727fbfe-20210615 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1795548193; Tue, 15 Jun 2021 14:27:00 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Jun 2021 14:26:58 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 15 Jun 2021 14:26:58 +0800 From: Lecopzer Chen To: CC: , , , , , , , , , Subject: Re: [PATCH] kbuild: lto: fix module versionings mismatch in incremental build Date: Tue, 15 Jun 2021 14:26:58 +0800 Message-ID: <20210615062658.21633-1-lecopzer.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <202106141554.A2D26986A@keescook> References: <202106141554.A2D26986A@keescook> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mon, Jun 14, 2021 at 01:51:09PM +0800, Lecopzer Chen wrote: > > When building modules(CONFIG_...=m), I found some of module versions > > are incorrect and set to 0. > > This can be found in build log for first clean build which shows > > > > WARNING: EXPORT symbol "XXXX" [drivers/XXX/XXX.ko] version generation failed, symbol will not be versioned. > > I'm doing this, and I don't see the problem: > > $ make LLVM=1 LLVM_IAS=1 distclean > $ make LLVM=1 LLVM_IAS=1 menuconfig > *enable LTO* > *enable a module* > $ make LLVM=1 LLVM_IAS=1 -j... > > What series of commands (and .config) shows this for you? Hi Kees, Thanks for you checking. After double checking in clean android kernel build, this causes by make version. (I have build failed in Linux LTO, seems it's not well support in contract to android?) I knew Google has LTO first in Android and upstream later, and most code are same as upstream, so the env here I use Android common kernel for easily testing. Test env is android common kernel: android12-5.4 [1] with its latest code and it builds from build.sh[2] $ BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh + make O=.... LLVM=1 LLVM_IAS=1 DEPMOD=depmod -j12 Image modules Image.lz4 With make set to v3.81, this can be reproduced with CONFIG_TEE=m. With version >= 4.2 this is not reproducible. Our build env default set make to v3.81, although Android uses hermetic build and v4.3 now, but Linux doesn't have such things. Maybe we can add build time checking or comment before CFI module versioning build rules to avoid anyone struggling with this again:). [1] https://android.googlesource.com/kernel/common/+/refs/heads/android12-5.4 [2] https://android.googlesource.com/kernel/build/+/refs/heads/master thanks, Lecopzer