From nobody Fri Nov 29 19:52:25 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 396DA18757D; Tue, 17 Sep 2024 14:17:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726582660; cv=none; b=fuyzplkj8YNFMZbxix20w+b47oc8u0h3f9FskL8T4/Bu1ePIRY/rOBPzzZinR+PlBExQXilJ/JADQJY4gG5M0o2A7hVV54eUTaoxlS/G3cBICDkF4s3molCUBLE5tF5zt+q9NaCq/DvwqgXd+S5sZV/00tEgUaBflWlBJmgE3x0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726582660; c=relaxed/simple; bh=M5hwbxGmb3kFIwBUjhm/vKr9Jp1vcsNIkcx9cZ1dz/U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P1FTPIcdYxrhSnK/f9YC8sgAWubMADudVJvLFXxkYFCsz5BhDXaYJW6WXeOL6c9AGBTOEe87Agiwq/2KlcnIjwhbLNci7LrpK+lOLouBYmc7+67YZhMdJFLNPJHENyuVhjnkM8Kxx8A0Zz+b8KhOtduB5RWimuaZl595VdLmU40= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MWc/OAQJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MWc/OAQJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F4BEC4CECF; Tue, 17 Sep 2024 14:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1726582659; bh=M5hwbxGmb3kFIwBUjhm/vKr9Jp1vcsNIkcx9cZ1dz/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWc/OAQJOTgPjXBC/zSjUa4v5+Mr++4m5gzJFVPj/+Z1TxHe9TfkRecHrs3e0f7Le ++eq01SBf39lsPA5zraelQ1Q2NGhtMEm9OZYIL9/JWpMFg22Bv1S5KhF34flw3TIEt eY8YMhAa3+YEl555Fh67Oza/yuOGH1jKbwAEP1/JVSFcK8Pk876xxFxJbr5SCfvncG dS9ib/pTO/wkUQ889CJyYMIl5s4NO090BckwTlHLZE/DMQPDKlm4TBXeRC4UZTi13C Q3wn0S1VZhNh2vGQzoZeLpMjNEYqmIxyQRlKrWaSC3AVhiVs/LV5H8lQlT7j4DYrbZ B4OPqFAnY/QYg== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Miguel Ojeda , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nicolas Schier , Masahiro Yamada Subject: [PATCH 04/23] kbuild: doc: remove the description about shipped files Date: Tue, 17 Sep 2024 23:16:32 +0900 Message-ID: <20240917141725.466514-5-masahiroy@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240917141725.466514-1-masahiroy@kernel.org> References: <20240917141725.466514-1-masahiroy@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The use of shipped files is discouraged in the upstream kernel these days. [1] Downstream Makefiles have the freedom to use shipped files or other options to handle binaries, but this is not what should be advertised in the upstream document. [1]: https://lore.kernel.org/all/CAHk-=3DwgSEi_ZrHdqr=3D20xv+d6dr5G895CbOAi= 8ok+7-CQUN=3DfQ@mail.gmail.com/ Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier --- Documentation/kbuild/modules.rst | 35 +++----------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/Documentation/kbuild/modules.rst b/Documentation/kbuild/module= s.rst index 7eceb9a65e9c..1afa6b1b4090 100644 --- a/Documentation/kbuild/modules.rst +++ b/Documentation/kbuild/modules.rst @@ -180,7 +180,6 @@ module 8123.ko, which is built from the following files= :: 8123_if.c 8123_if.h 8123_pci.c - 8123_bin.o_shipped <=3D Binary blob =20 3.1 Shared Makefile ------------------- @@ -198,7 +197,7 @@ module 8123.ko, which is built from the following files= :: ifneq ($(KERNELRELEASE),) # kbuild part of makefile obj-m :=3D 8123.o - 8123-y :=3D 8123_if.o 8123_pci.o 8123_bin.o + 8123-y :=3D 8123_if.o 8123_pci.o =20 else # normal makefile @@ -207,10 +206,6 @@ module 8123.ko, which is built from the following file= s:: default: $(MAKE) -C $(KDIR) M=3D$$PWD =20 - # Module specific targets - genbin: - echo "X" > 8123_bin.o_shipped - endif =20 The check for KERNELRELEASE is used to separate the two parts @@ -232,7 +227,7 @@ module 8123.ko, which is built from the following files= :: =20 --> filename: Kbuild obj-m :=3D 8123.o - 8123-y :=3D 8123_if.o 8123_pci.o 8123_bin.o + 8123-y :=3D 8123_if.o 8123_pci.o =20 --> filename: Makefile KDIR ?=3D /lib/modules/`uname -r`/build @@ -240,35 +235,11 @@ module 8123.ko, which is built from the following fil= es:: default: $(MAKE) -C $(KDIR) M=3D$$PWD =20 - # Module specific targets - genbin: - echo "X" > 8123_bin.o_shipped - The split in example 2 is questionable due to the simplicity of each file; however, some external modules use makefiles consisting of several hundred lines, and here it really pays off to separate the kbuild part from the rest. =20 -3.3 Binary Blobs ----------------- - - Some external modules need to include an object file as a blob. - kbuild has support for this, but requires the blob file to be - named _shipped. When the kbuild rules kick in, a copy - of _shipped is created with _shipped stripped off, - giving us . This shortened filename can be used in - the assignment to the module. - - Throughout this section, 8123_bin.o_shipped has been used to - build the kernel module 8123.ko; it has been included as - 8123_bin.o:: - - 8123-y :=3D 8123_if.o 8123_pci.o 8123_bin.o - - Although there is no distinction between the ordinary source - files and the binary file, kbuild will pick up different rules - when creating the object file for the module. - 3.4 Building Multiple Modules =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D =20 @@ -329,7 +300,7 @@ according to the following rule: obj-m :=3D 8123.o =20 ccflags-y :=3D -I $(src)/include - 8123-y :=3D 8123_if.o 8123_pci.o 8123_bin.o + 8123-y :=3D 8123_if.o 8123_pci.o =20 4.3 Several Subdirectories -------------------------- --=20 2.43.0