This repository was archived by the owner on Mar 7, 2021. It is now read-only.
File tree 6 files changed +6
-41
lines changed
6 files changed +6
-41
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ cd hello-world
76
76
3 . Build the static object with cargo xbuild, pointing it at our custom target
77
77
78
78
```
79
- cargo xbuild --target $(pwd)/../ x86_64-linux-kernel-module.json
79
+ cargo xbuild --target x86_64-linux-kernel
80
80
```
81
81
82
82
4 . Build the kernel module using the Linux kernel build system (kbuild)
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ fn main() {
109
109
. derive_default ( true )
110
110
. rustfmt_bindings ( true ) ;
111
111
112
- builder = builder. clang_arg ( "--target=x86_64-linux-kernel-module " ) ;
112
+ builder = builder. clang_arg ( "--target=x86_64-linux-kernel" ) ;
113
113
for arg in shlex:: split ( std:: str:: from_utf8 ( & output. stdout ) . unwrap ( ) ) . unwrap ( ) {
114
114
builder = builder. clang_arg ( arg. to_string ( ) ) ;
115
115
}
@@ -141,7 +141,7 @@ fn main() {
141
141
let mut builder = cc:: Build :: new ( ) ;
142
142
println ! ( "cargo:rerun-if-env-changed=CLANG" ) ;
143
143
builder. compiler ( env:: var ( "CLANG" ) . unwrap_or ( "clang" . to_string ( ) ) ) ;
144
- builder. target ( "x86_64-linux-kernel-module " ) ;
144
+ builder. target ( "x86_64-linux-kernel" ) ;
145
145
builder. warnings ( false ) ;
146
146
builder. file ( "src/helpers.c" ) ;
147
147
for arg in shlex:: split ( std:: str:: from_utf8 ( & output. stdout ) . unwrap ( ) ) . unwrap ( ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ obj-m := helloworld.o
2
2
helloworld-objs := hello_world.rust.o
3
3
KDIR ?= /lib/modules/$(shell uname -r) /build
4
4
5
- % .rust.o : target/x86_64-linux-kernel-module /debug/lib% .a
5
+ % .rust.o : target/x86_64-linux-kernel/debug/lib% .a
6
6
$(LD ) -r -o $@ --whole-archive $<
7
7
8
8
all :
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ obj-m := testmodule.o
2
2
testmodule-objs := $(TEST_NAME ) .rust.o
3
3
KDIR ?= /lib/modules/$(shell uname -r) /build
4
4
5
- % .rust.o : target/x86_64-linux-kernel-module /debug/lib% .a
5
+ % .rust.o : target/x86_64-linux-kernel/debug/lib% .a
6
6
$(LD ) -r -o $@ --whole-archive $<
7
7
8
8
all :
Original file line number Diff line number Diff line change @@ -27,10 +27,7 @@ def main():
27
27
print ("+ [{}]" .format (path ))
28
28
run (
29
29
"cargo" , "xbuild" ,
30
- "--target" ,
31
- os .path .join (
32
- BASE_DIR , os .path .pardir , "x86_64-linux-kernel-module.json"
33
- ),
30
+ "--target" , "x86_64-linux-kernel" ,
34
31
cwd = os .path .join (BASE_DIR , path ),
35
32
environ = dict (
36
33
os .environ ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments