~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/kbuild/kbuild.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/kbuild/kbuild.rst (Version linux-6.12-rc7) and /Documentation/kbuild/kbuild.rst (Version linux-5.9.16)


  1 ======                                              1 ======
  2 Kbuild                                              2 Kbuild
  3 ======                                              3 ======
  4                                                     4 
  5                                                     5 
  6 Output files                                        6 Output files
  7 ============                                        7 ============
  8                                                     8 
  9 modules.order                                       9 modules.order
 10 -------------                                      10 -------------
 11 This file records the order in which modules a     11 This file records the order in which modules appear in Makefiles. This
 12 is used by modprobe to deterministically resol     12 is used by modprobe to deterministically resolve aliases that match
 13 multiple modules.                                  13 multiple modules.
 14                                                    14 
 15 modules.builtin                                    15 modules.builtin
 16 ---------------                                    16 ---------------
 17 This file lists all modules that are built int     17 This file lists all modules that are built into the kernel. This is used
 18 by modprobe to not fail when trying to load so     18 by modprobe to not fail when trying to load something builtin.
 19                                                    19 
 20 modules.builtin.modinfo                            20 modules.builtin.modinfo
 21 -----------------------                            21 -----------------------
 22 This file contains modinfo from all modules th     22 This file contains modinfo from all modules that are built into the kernel.
 23 Unlike modinfo of a separate module, all field     23 Unlike modinfo of a separate module, all fields are prefixed with module name.
 24                                                    24 
 25 modules.builtin.ranges                         << 
 26 ----------------------                         << 
 27 This file contains address offset ranges (per  << 
 28 that are built into the kernel. Together with  << 
 29 to associate module names with symbols.        << 
 30                                                    25 
 31 Environment variables                              26 Environment variables
 32 =====================                              27 =====================
 33                                                    28 
 34 KCPPFLAGS                                          29 KCPPFLAGS
 35 ---------                                          30 ---------
 36 Additional options to pass when preprocessing.     31 Additional options to pass when preprocessing. The preprocessing options
 37 will be used in all cases where kbuild does pr     32 will be used in all cases where kbuild does preprocessing including
 38 building C files and assembler files.              33 building C files and assembler files.
 39                                                    34 
 40 KAFLAGS                                            35 KAFLAGS
 41 -------                                            36 -------
 42 Additional options to the assembler (for built     37 Additional options to the assembler (for built-in and modules).
 43                                                    38 
 44 AFLAGS_MODULE                                      39 AFLAGS_MODULE
 45 -------------                                      40 -------------
 46 Additional assembler options for modules.          41 Additional assembler options for modules.
 47                                                    42 
 48 AFLAGS_KERNEL                                      43 AFLAGS_KERNEL
 49 -------------                                      44 -------------
 50 Additional assembler options for built-in.         45 Additional assembler options for built-in.
 51                                                    46 
 52 KCFLAGS                                            47 KCFLAGS
 53 -------                                            48 -------
 54 Additional options to the C compiler (for buil     49 Additional options to the C compiler (for built-in and modules).
 55                                                    50 
 56 KRUSTFLAGS                                     << 
 57 ----------                                     << 
 58 Additional options to the Rust compiler (for b << 
 59                                                << 
 60 CFLAGS_KERNEL                                      51 CFLAGS_KERNEL
 61 -------------                                      52 -------------
 62 Additional options for $(CC) when used to comp     53 Additional options for $(CC) when used to compile
 63 code that is compiled as built-in.                 54 code that is compiled as built-in.
 64                                                    55 
 65 CFLAGS_MODULE                                      56 CFLAGS_MODULE
 66 -------------                                      57 -------------
 67 Additional module specific options to use for      58 Additional module specific options to use for $(CC).
 68                                                    59 
 69 RUSTFLAGS_KERNEL                               << 
 70 ----------------                               << 
 71 Additional options for $(RUSTC) when used to c << 
 72 code that is compiled as built-in.             << 
 73                                                << 
 74 RUSTFLAGS_MODULE                               << 
 75 ----------------                               << 
 76 Additional module specific options to use for  << 
 77                                                << 
 78 LDFLAGS_MODULE                                     60 LDFLAGS_MODULE
 79 --------------                                     61 --------------
 80 Additional options used for $(LD) when linking     62 Additional options used for $(LD) when linking modules.
 81                                                    63 
 82 HOSTCFLAGS                                         64 HOSTCFLAGS
 83 ----------                                         65 ----------
 84 Additional flags to be passed to $(HOSTCC) whe     66 Additional flags to be passed to $(HOSTCC) when building host programs.
 85                                                    67 
 86 HOSTCXXFLAGS                                       68 HOSTCXXFLAGS
 87 ------------                                       69 ------------
 88 Additional flags to be passed to $(HOSTCXX) wh     70 Additional flags to be passed to $(HOSTCXX) when building host programs.
 89                                                    71 
 90 HOSTRUSTFLAGS                                  << 
 91 -------------                                  << 
 92 Additional flags to be passed to $(HOSTRUSTC)  << 
 93                                                << 
 94 HOSTLDFLAGS                                        72 HOSTLDFLAGS
 95 -----------                                        73 -----------
 96 Additional flags to be passed when linking hos     74 Additional flags to be passed when linking host programs.
 97                                                    75 
 98 HOSTLDLIBS                                         76 HOSTLDLIBS
 99 ----------                                         77 ----------
100 Additional libraries to link against when buil     78 Additional libraries to link against when building host programs.
101                                                    79 
102 .. _userkbuildflags:                           << 
103                                                << 
104 USERCFLAGS                                     << 
105 ----------                                     << 
106 Additional options used for $(CC) when compili << 
107                                                << 
108 USERLDFLAGS                                    << 
109 -----------                                    << 
110 Additional options used for $(LD) when linking << 
111 with CC, so $(USERLDFLAGS) should include "-Wl << 
112                                                << 
113 KBUILD_KCONFIG                                     80 KBUILD_KCONFIG
114 --------------                                     81 --------------
115 Set the top-level Kconfig file to the value of     82 Set the top-level Kconfig file to the value of this environment
116 variable.  The default name is "Kconfig".          83 variable.  The default name is "Kconfig".
117                                                    84 
118 KBUILD_VERBOSE                                     85 KBUILD_VERBOSE
119 --------------                                     86 --------------
120 Set the kbuild verbosity. Can be assigned same     87 Set the kbuild verbosity. Can be assigned same values as "V=...".
121                                                    88 
122 See make help for the full list.                   89 See make help for the full list.
123                                                    90 
124 Setting "V=..." takes precedence over KBUILD_V     91 Setting "V=..." takes precedence over KBUILD_VERBOSE.
125                                                    92 
126 KBUILD_EXTMOD                                      93 KBUILD_EXTMOD
127 -------------                                      94 -------------
128 Set the directory to look for the kernel sourc     95 Set the directory to look for the kernel source when building external
129 modules.                                           96 modules.
130                                                    97 
131 Setting "M=..." takes precedence over KBUILD_E     98 Setting "M=..." takes precedence over KBUILD_EXTMOD.
132                                                    99 
133 KBUILD_OUTPUT                                     100 KBUILD_OUTPUT
134 -------------                                     101 -------------
135 Specify the output directory when building the    102 Specify the output directory when building the kernel.
136                                                   103 
137 This variable can also be used to point to the << 
138 building external modules against a pre-built  << 
139 directory. Please note that this does NOT spec << 
140 external modules themselves.                   << 
141                                                << 
142 The output directory can also be specified usi    104 The output directory can also be specified using "O=...".
143                                                   105 
144 Setting "O=..." takes precedence over KBUILD_O    106 Setting "O=..." takes precedence over KBUILD_OUTPUT.
145                                                   107 
146 KBUILD_EXTRA_WARN                                 108 KBUILD_EXTRA_WARN
147 -----------------                                 109 -----------------
148 Specify the extra build checks. The same value    110 Specify the extra build checks. The same value can be assigned by passing
149 W=... from the command line.                      111 W=... from the command line.
150                                                   112 
151 See `make help` for the list of the supported     113 See `make help` for the list of the supported values.
152                                                   114 
153 Setting "W=..." takes precedence over KBUILD_E    115 Setting "W=..." takes precedence over KBUILD_EXTRA_WARN.
154                                                   116 
155 KBUILD_DEBARCH                                    117 KBUILD_DEBARCH
156 --------------                                    118 --------------
157 For the deb-pkg target, allows overriding the     119 For the deb-pkg target, allows overriding the normal heuristics deployed by
158 deb-pkg. Normally deb-pkg attempts to guess th    120 deb-pkg. Normally deb-pkg attempts to guess the right architecture based on
159 the UTS_MACHINE variable, and on some architec    121 the UTS_MACHINE variable, and on some architectures also the kernel config.
160 The value of KBUILD_DEBARCH is assumed (not ch    122 The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
161 architecture.                                     123 architecture.
162                                                   124 
163 KDOCFLAGS                                      << 
164 ---------                                      << 
165 Specify extra (warning/error) flags for kernel << 
166 see scripts/kernel-doc for which flags are sup << 
167 (currently) apply to documentation builds.     << 
168                                                << 
169 ARCH                                              125 ARCH
170 ----                                              126 ----
171 Set ARCH to the architecture to be built.         127 Set ARCH to the architecture to be built.
172                                                   128 
173 In most cases the name of the architecture is     129 In most cases the name of the architecture is the same as the
174 directory name found in the arch/ directory.      130 directory name found in the arch/ directory.
175                                                   131 
176 But some architectures such as x86 and sparc h    132 But some architectures such as x86 and sparc have aliases.
177                                                   133 
178 - x86: i386 for 32 bit, x86_64 for 64 bit         134 - x86: i386 for 32 bit, x86_64 for 64 bit
179 - parisc: parisc64 for 64 bit                  !! 135 - sh: sh for 32 bit, sh64 for 64 bit
180 - sparc: sparc32 for 32 bit, sparc64 for 64 bi    136 - sparc: sparc32 for 32 bit, sparc64 for 64 bit
181                                                   137 
182 CROSS_COMPILE                                     138 CROSS_COMPILE
183 -------------                                     139 -------------
184 Specify an optional fixed part of the binutils    140 Specify an optional fixed part of the binutils filename.
185 CROSS_COMPILE can be a part of the filename or    141 CROSS_COMPILE can be a part of the filename or the full path.
186                                                   142 
187 CROSS_COMPILE is also used for ccache in some     143 CROSS_COMPILE is also used for ccache in some setups.
188                                                   144 
189 CF                                                145 CF
190 --                                                146 --
191 Additional options for sparse.                    147 Additional options for sparse.
192                                                   148 
193 CF is often used on the command-line like this    149 CF is often used on the command-line like this::
194                                                   150 
195     make CF=-Wbitwise C=2                         151     make CF=-Wbitwise C=2
196                                                   152 
197 INSTALL_PATH                                      153 INSTALL_PATH
198 ------------                                      154 ------------
199 INSTALL_PATH specifies where to place the upda    155 INSTALL_PATH specifies where to place the updated kernel and system map
200 images. Default is /boot, but you can set it t    156 images. Default is /boot, but you can set it to other values.
201                                                   157 
202 INSTALLKERNEL                                     158 INSTALLKERNEL
203 -------------                                     159 -------------
204 Install script called when using "make install    160 Install script called when using "make install".
205 The default name is "installkernel".              161 The default name is "installkernel".
206                                                   162 
207 The script will be called with the following a    163 The script will be called with the following arguments:
208                                                   164 
209    - $1 - kernel version                          165    - $1 - kernel version
210    - $2 - kernel image file                       166    - $2 - kernel image file
211    - $3 - kernel map file                         167    - $3 - kernel map file
212    - $4 - default install path (use root direc    168    - $4 - default install path (use root directory if blank)
213                                                   169 
214 The implementation of "make install" is archit    170 The implementation of "make install" is architecture specific
215 and it may differ from the above.                 171 and it may differ from the above.
216                                                   172 
217 INSTALLKERNEL is provided to enable the possib    173 INSTALLKERNEL is provided to enable the possibility to
218 specify a custom installer when cross compilin    174 specify a custom installer when cross compiling a kernel.
219                                                   175 
220 MODLIB                                            176 MODLIB
221 ------                                            177 ------
222 Specify where to install modules.                 178 Specify where to install modules.
223 The default value is::                            179 The default value is::
224                                                   180 
225      $(INSTALL_MOD_PATH)/lib/modules/$(KERNELR    181      $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE)
226                                                   182 
227 The value can be overridden in which case the     183 The value can be overridden in which case the default value is ignored.
228                                                   184 
229 INSTALL_MOD_PATH                                  185 INSTALL_MOD_PATH
230 ----------------                                  186 ----------------
231 INSTALL_MOD_PATH specifies a prefix to MODLIB     187 INSTALL_MOD_PATH specifies a prefix to MODLIB for module directory
232 relocations required by build roots.  This is     188 relocations required by build roots.  This is not defined in the
233 makefile but the argument can be passed to mak    189 makefile but the argument can be passed to make if needed.
234                                                   190 
235 INSTALL_MOD_STRIP                                 191 INSTALL_MOD_STRIP
236 -----------------                                 192 -----------------
237 INSTALL_MOD_STRIP, if defined, will cause modu    193 INSTALL_MOD_STRIP, if defined, will cause modules to be
238 stripped after they are installed.  If INSTALL    194 stripped after they are installed.  If INSTALL_MOD_STRIP is '1', then
239 the default option --strip-debug will be used.    195 the default option --strip-debug will be used.  Otherwise,
240 INSTALL_MOD_STRIP value will be used as the op    196 INSTALL_MOD_STRIP value will be used as the options to the strip command.
241                                                   197 
242 INSTALL_HDR_PATH                                  198 INSTALL_HDR_PATH
243 ----------------                                  199 ----------------
244 INSTALL_HDR_PATH specifies where to install us    200 INSTALL_HDR_PATH specifies where to install user space headers when
245 executing "make headers_*".                       201 executing "make headers_*".
246                                                   202 
247 The default value is::                            203 The default value is::
248                                                   204 
249     $(objtree)/usr                                205     $(objtree)/usr
250                                                   206 
251 $(objtree) is the directory where output files    207 $(objtree) is the directory where output files are saved.
252 The output directory is often set using "O=...    208 The output directory is often set using "O=..." on the commandline.
253                                                   209 
254 The value can be overridden in which case the     210 The value can be overridden in which case the default value is ignored.
255                                                   211 
256 INSTALL_DTBS_PATH                              << 
257 -----------------                              << 
258 INSTALL_DTBS_PATH specifies where to install d << 
259 relocations required by build roots.  This is  << 
260 makefile but the argument can be passed to mak << 
261                                                << 
262 KBUILD_ABS_SRCTREE                                212 KBUILD_ABS_SRCTREE
263 ----------------------------------------------    213 --------------------------------------------------
264 Kbuild uses a relative path to point to the tr    214 Kbuild uses a relative path to point to the tree when possible. For instance,
265 when building in the source tree, the source t    215 when building in the source tree, the source tree path is '.'
266                                                   216 
267 Setting this flag requests Kbuild to use absol    217 Setting this flag requests Kbuild to use absolute path to the source tree.
268 There are some useful cases to do so, like whe    218 There are some useful cases to do so, like when generating tag files with
269 absolute path entries etc.                        219 absolute path entries etc.
270                                                   220 
271 KBUILD_SIGN_PIN                                   221 KBUILD_SIGN_PIN
272 ---------------                                   222 ---------------
273 This variable allows a passphrase or PIN to be    223 This variable allows a passphrase or PIN to be passed to the sign-file
274 utility when signing kernel modules, if the pr    224 utility when signing kernel modules, if the private key requires such.
275                                                   225 
276 KBUILD_MODPOST_WARN                               226 KBUILD_MODPOST_WARN
277 -------------------                               227 -------------------
278 KBUILD_MODPOST_WARN can be set to avoid errors    228 KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined
279 symbols in the final module linking stage. It     229 symbols in the final module linking stage. It changes such errors
280 into warnings.                                    230 into warnings.
281                                                   231 
282 KBUILD_MODPOST_NOFINAL                            232 KBUILD_MODPOST_NOFINAL
283 ----------------------                            233 ----------------------
284 KBUILD_MODPOST_NOFINAL can be set to skip the     234 KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules.
285 This is solely useful to speed up test compile    235 This is solely useful to speed up test compiles.
286                                                   236 
287 KBUILD_EXTRA_SYMBOLS                              237 KBUILD_EXTRA_SYMBOLS
288 --------------------                              238 --------------------
289 For modules that use symbols from other module    239 For modules that use symbols from other modules.
290 See more details in modules.rst.                  240 See more details in modules.rst.
291                                                   241 
292 ALLSOURCE_ARCHS                                   242 ALLSOURCE_ARCHS
293 ---------------                                   243 ---------------
294 For tags/TAGS/cscope targets, you can specify     244 For tags/TAGS/cscope targets, you can specify more than one arch
295 to be included in the databases, separated by     245 to be included in the databases, separated by blank space. E.g.::
296                                                   246 
297     $ make ALLSOURCE_ARCHS="x86 mips arm" tags    247     $ make ALLSOURCE_ARCHS="x86 mips arm" tags
298                                                   248 
299 To get all available archs you can also specif    249 To get all available archs you can also specify all. E.g.::
300                                                   250 
301     $ make ALLSOURCE_ARCHS=all tags               251     $ make ALLSOURCE_ARCHS=all tags
302                                                << 
303 IGNORE_DIRS                                    << 
304 -----------                                    << 
305 For tags/TAGS/cscope targets, you can choose w << 
306 be included in the databases, separated by bla << 
307                                                << 
308     $ make IGNORE_DIRS="drivers/gpu/drm/radeon << 
309                                                   252 
310 KBUILD_BUILD_TIMESTAMP                            253 KBUILD_BUILD_TIMESTAMP
311 ----------------------                            254 ----------------------
312 Setting this to a date string overrides the ti    255 Setting this to a date string overrides the timestamp used in the
313 UTS_VERSION definition (uname -v in the runnin    256 UTS_VERSION definition (uname -v in the running kernel). The value has to
314 be a string that can be passed to date -d. The    257 be a string that can be passed to date -d. The default value
315 is the output of the date command at one point    258 is the output of the date command at one point during build.
316                                                   259 
317 KBUILD_BUILD_USER, KBUILD_BUILD_HOST              260 KBUILD_BUILD_USER, KBUILD_BUILD_HOST
318 ------------------------------------              261 ------------------------------------
319 These two variables allow to override the user    262 These two variables allow to override the user@host string displayed during
320 boot and in /proc/version. The default value i    263 boot and in /proc/version. The default value is the output of the commands
321 whoami and host, respectively.                    264 whoami and host, respectively.
322                                                   265 
323 LLVM                                              266 LLVM
324 ----                                              267 ----
325 If this variable is set to 1, Kbuild will use     268 If this variable is set to 1, Kbuild will use Clang and LLVM utilities instead
326 of GCC and GNU binutils to build the kernel.      269 of GCC and GNU binutils to build the kernel.
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php