Skip to content

Commit a95777a

Browse files
committed
docs: kbuild: add documentation for some Rust variables
RUSTFLAGS_KERNEL RUSTFLAGS_MODULE KBUILD_RUSTFLAGS KBUILD_RUSTFLAGS_KERNEL KBUILD_RUSTFLAGS_MODULE Furthermore, move `KRUSTFLAGS` a bit up to be closer to `KCFLAGS` since all the `K*FLAGS` seem to go together (rather than per-language). Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 6e0fac6 commit a95777a

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

Documentation/kbuild/kbuild.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ KCFLAGS
4848
-------
4949
Additional options to the C compiler (for built-in and modules).
5050

51+
KRUSTFLAGS
52+
----------
53+
Additional options to the Rust compiler (for built-in and modules).
54+
5155
CFLAGS_KERNEL
5256
-------------
5357
Additional options for $(CC) when used to compile
@@ -57,9 +61,14 @@ CFLAGS_MODULE
5761
-------------
5862
Additional module specific options to use for $(CC).
5963

60-
KRUSTFLAGS
61-
----------
62-
Additional options to the Rust compiler (for built-in and modules).
64+
RUSTFLAGS_KERNEL
65+
----------------
66+
Additional options for $(RUSTC) when used to compile
67+
code that is compiled as built-in.
68+
69+
RUSTFLAGS_MODULE
70+
----------------
71+
Additional module specific options to use for $(RUSTC).
6372

6473
LDFLAGS_MODULE
6574
--------------

Documentation/kbuild/makefiles.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,14 @@ When kbuild executes, the following steps are followed (roughly):
11791179
The first example utilises the trick that a config option expands
11801180
to 'y' when selected.
11811181

1182+
KBUILD_RUSTFLAGS
1183+
$(RUSTC) compiler flags
1184+
1185+
Default value - see top level Makefile
1186+
Append or modify as required per architecture.
1187+
1188+
Often, the KBUILD_RUSTFLAGS variable depends on the configuration.
1189+
11821190
KBUILD_AFLAGS_KERNEL
11831191
Assembler options specific for built-in
11841192

@@ -1206,6 +1214,19 @@ When kbuild executes, the following steps are followed (roughly):
12061214
are used for $(CC).
12071215
From commandline CFLAGS_MODULE shall be used (see kbuild.rst).
12081216

1217+
KBUILD_RUSTFLAGS_KERNEL
1218+
$(RUSTC) options specific for built-in
1219+
1220+
$(KBUILD_RUSTFLAGS_KERNEL) contains extra Rust compiler flags used to
1221+
compile resident kernel code.
1222+
1223+
KBUILD_RUSTFLAGS_MODULE
1224+
Options for $(RUSTC) when building modules
1225+
1226+
$(KBUILD_RUSTFLAGS_MODULE) is used to add arch-specific options that
1227+
are used for $(RUSTC).
1228+
From commandline RUSTFLAGS_MODULE shall be used (see kbuild.rst).
1229+
12091230
KBUILD_LDFLAGS_MODULE
12101231
Options for $(LD) when linking modules
12111232

0 commit comments

Comments
 (0)