From patchwork Tue Apr 13 12:22:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Kemper X-Patchwork-Id: 1465765 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=MDsmtLxZ; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=h5zePWW1; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FKPyl1THzz9sWW for ; Tue, 13 Apr 2021 22:28:15 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jR6Nsq1rQzMNvNIhIAGEtmKirXzhviSerEmqUe3Ih+U=; b=MDsmtLxZ1lG4Yq Q25v//vEHPfwf6IyBkUb54NJ+QaDqVaQoGNnBjEM4529dHEHIRMIsdwmfCcQh7eInP0Is+Pb/0giv XlzFR8LZzC5JjXjsv/qGBUpX8XCwpDf7kINIEkHrISBwixEGVAE4sfKoHLDpZrw/wdR/slBvfufLR qYAeMLAjRDLrolCarPpUGOKM2csDumKrwwoCtgIrafSVsHP5azvh60jW6fPV8jBoAGewVipw4g5wj W5hzpvlZ//zLF81AXLNjxT7Wqr17Gz0b291q/9RjmS9wSwmZTH7+zEc9hCyi6rzeZtr4lWGhjx4wT RLzvC4cQtC7TBHc6Yf+Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWI4U-009DMl-8M; Tue, 13 Apr 2021 12:23:13 +0000 Received: from mout.gmx.net ([212.227.17.22]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWI3k-009DEk-Ru for openwrt-devel@lists.openwrt.org; Tue, 13 Apr 2021 12:22:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1618316542; bh=DoBXFXUPrhXLpFvfp8Qqu0HJTWF6sD940tZwAZnA8YE=; h=X-UI-Sender-Class:Date:From:To:Subject; b=h5zePWW1T9oMaiUhuQP41xG4Bj4mjU6P5V/0wUMoDxHLkSPTQBAkxT6xDuGRYZj7C TOhHc6hvzHR5FYpRy2ZHmuEIoxkw0T8pIyJ7csetzuuAMFIL03vGSDkqa1sKywvuqV K/s0NHVmK88lMry0cuX88brGvoZPyH+5PqDsO6Yo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from darth.lan ([62.14.66.26]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N0oBx-1li3i43DFN-00wiuF for ; Tue, 13 Apr 2021 14:22:21 +0200 Date: Tue, 13 Apr 2021 14:22:20 +0200 From: Sebastian Kemper To: openwrt-devel@lists.openwrt.org Subject: [PATCH] build: fix regression for kernels < 5.10 Message-ID: <20210413122218.GA5777@darth.lan> Mail-Followup-To: openwrt-devel@lists.openwrt.org MIME-Version: 1.0 Content-Disposition: inline X-Provags-ID: V03:K1:NM2zpT0K50gl8SN3JlZrVKyRZhp7JafqJCK80TSsdQIqIGQ2jmQ kz5DaKr6CGHYuUXecy4zUEeas98uTMn4uKptqrzf4613E4Zj2+ujbvgGvOcPGhKbNAt4jwC RvkQ5EorQhPZTnW2iZy/tGi5/u9U/dlEV48rWeXtkOujjUF8e3uyOQEU6MgLNarnVz+sFlg egGkMt/UmdNrwHQKlVFZA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:JO6RiahML7c=:3ep3ozc0XJsdH6w7DGz10L SpbPNkWOX6WhOqj0JZAWWcWCTGEgm6Ei3Z98aeG4AVhp+wBOrafgWWEZBHQj4rAFl8A82WUEf wDyaPOaAvY1iGPRyvCtPOJmBIIVjY9POmB8vCpJ8+EwKe5o7W39oimJpBy3IWDlxWosIUr5DC kKYOMWGYZqRXm43+w6iUpc9YyHnn4cJmoyPoQNvohREy3mDBy/K68Kwr6mo9FhHB0ImB28oYH ZNBS5p1gV7L0UMAJ7D+sO1y2YQPuL5MUdNES1gdr2GqdOHRZMhUTgk1UiMwXpqJpe3G0K+0CU uUXrS7gTmXZmysLaiNAYs6C/C3lZoQfjuG/AGcjjuzIO0vVp9GFY4+Uheyz2FvYjS/QwnsKX6 X3bzMKM/pw+M8+UUPJ/yg59FuABaPv2EtK4Vuj/B236oLEKaN/1eRB57prGoC3Aibuyh1SfFR ZJ8A+rpLP809Rq0ut1DsNmcnj1NIr2/lmvvVuKvnO6Z7LyhgFkUCLsoodjJeALKYvbW8x+Q0f nSQmE3HYmjOzKrnX53g53vYoN7PKhL0XoqvY2OowuHM6HY2gJrQx4tMY7+7fpsjQtSDBdpR1L pzygmRkJd8+GR0jZeRVHhGpVvA0dOPo1qaXBH01AQZnqZwXoPMWKqXkoQKKEDCOpYdkb7chl5 rNv3sEu/+jM3L7Q9jFXnfiuVF/kMLC4TrG60Is/yI5G2fcbsbvul6Y1/zXuP2zCyn/JehhJbJ qREFHA3Q7JV0aLKS7yyTOYfv+kSK7IVaAKqPaA0APZrDLzhawDPrMpUObU01Zucsj0UKHxvg/ 8RORhED9nNZoPVurzptULo2YxUyUYT9EtoKNORrcMyqoO6mr6HUeLyp29nrvCuHF24/VOQgED wh09R4mtzP2pa4vcoq/BktSKrQFEaSWsK6dVfrxGe/cL1lamHiTcrQw8A4pMSzZVL//cM9V+G e9+B71tBhoVQkHuN95z8DMzrtVl9bUb8gdTjBduIDzLPHg5xfqiWvVKW9GmrzMAi4v1kzhA6G quToi7zszw5olVIsUXtWn4Hi6sirwFDaMO0ibfi0aTkO0oaqN7/nOGulVVhJzUVwj28p3aFfN M0KaaGqdTzMB6eKpfqxQRDhOwiJ/tZcd8mRVnpPZRtPzZBfmi4Q3n39YrdWxz8scPDh5DE8Za B/zUu4KRzJ1TV2YJQRYF+wVy19PrOz+sYMq+UzdzKpZtwdH4BdpMcDyNJnquS21fFzwIU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210413_132225_109741_84066155 X-CRM114-Status: GOOD ( 11.29 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "desiato.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This fixes a regression introduced with commit 5ed1e5140a80558ab47fd70410ae3242bed5becf ("build: build kernel image before building modules/packages"). Before this commit the make target would always include "modules", resulting in a MODPOST and a complete Module.symvers file. Since this commit a MODPOST of the kernel modules is not guaranteed for ke [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.17.22 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [sebastian_ml[at]gmx.net] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This fixes a regression introduced with commit 5ed1e5140a80558ab47fd70410ae3242bed5becf ("build: build kernel image before building modules/packages"). Before this commit the make target would always include "modules", resulting in a MODPOST and a complete Module.symvers file. Since this commit a MODPOST of the kernel modules is not guaranteed for kernels < 5.10. This results in some broken SDKs in which external packages that depend on exported symbols from kernel modules fail to compile. Adding "modules" back to the calls to the CompileImage defines fixes the regression. For kernels > 5.10 this is not needed, but it doesn't cause any harm either. Tested with kernels 5.4.x and 5.10.x. Signed-off-by: Sebastian Kemper --- include/kernel-defaults.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 4b0b136a03..1b3b4497a2 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -147,12 +147,17 @@ define Kernel/CopyImage } endef +# Always add "modules" so a proper Module.symvers file is written that +# also contains symbols from the kernel modules. Without these symbols +# external packages that depend on exported symbols from kernel modules +# will fail to build. define Kernel/CompileImage/Default rm -f $(TARGET_DIR)/init - +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) + +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) modules $(call Kernel/CopyImage) endef +# Here as well, always add "modules", see comment above. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) define Kernel/CompileImage/Initramfs $(call Kernel/Configure/Initramfs) @@ -173,7 +178,7 @@ endif # ? $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZ4),) $(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD),$(STAGING_DIR_HOST)/bin/zstd -T0 -f -o $(KERNEL_BUILD_DIR)/initrd.cpio.zstd $(KERNEL_BUILD_DIR)/initrd.cpio) endif - +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) + +$(KERNEL_MAKE) $(KERNEL_MAKEOPTS_IMAGE) $(if $(KERNELNAME),$(KERNELNAME),all) modules $(call Kernel/CopyImage,-initramfs) endef else