aboutsummarylogtreecommitdiffstats
path: root/0001-Fix-Rust-out-of-tree-module-build.patch
blob: e2d7dba83a6751406e62b573829800c0b7f09bb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 1d5987eddccb8f37ffd0b1067d7ce6281ffeb255 Mon Sep 17 00:00:00 2001
From: Raphael Nestler <raphael.nestler@gmail.com>
Date: Tue, 27 Jun 2023 14:23:39 +0200
Subject: [PATCH] Fix Rust out of tree module build

We need to specify the --out-dir explicitly, because otherwise temporary
files will be written to the current directory, which fails when trying
to build out-of-tree modules, since the build is executed in the
directory where the build metadata is: /usr/lib/modules/`uname -r`/build
---
 scripts/Makefile.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 76323201232a..44b49f26d720 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -287,7 +287,7 @@ rust_common_cmd = \
 	--extern alloc --extern kernel \
 	--crate-type rlib -L $(objtree)/rust/ \
 	--crate-name $(basename $(notdir $@)) \
-	--emit=dep-info=$(depfile)
+	--out-dir $(dir $@) --emit=dep-info=$(depfile)
 
 # `--emit=obj`, `--emit=asm` and `--emit=llvm-ir` imply a single codegen unit
 # will be used. We explicitly request `-Ccodegen-units=1` in any case, and
-- 
2.41.0