Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 0001536

Browse files
committed
Switch from xbuild to std-aware cargo.
Fixes #176
1 parent f9501b6 commit 0001536

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

.travis.yml

-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ branches:
1414

1515
install:
1616
- sudo apt-get install -y "linux-headers-$(uname -r)" realpath
17-
- type -p cargo-install-update || cargo install --force cargo-update
18-
- |
19-
if type -p cargo-xbuild; then
20-
cargo install-update -i cargo-xbuild
21-
else
22-
cargo install --force cargo-xbuild
23-
fi
2417
- rustup component add rust-src rustfmt clippy
2518

2619
script:

README.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,10 @@ environment variable appropriately, e.g., `CLANG=clang-9`.
5757

5858
## Building hello-world
5959

60-
1. Install clang, kernel headers,
61-
[cargo-xbuild](https://github.com/rust-osdev/cargo-xbuild), and the
62-
`rust-src` and `rustfmt` components from `rustup`:
60+
1. Install clang, kernel headers, and the `rust-src` and `rustfmt` components from `rustup`:
6361

6462
```
6563
apt-get install llvm clang linux-headers-"$(uname -r)" # or the equivalent for your OS
66-
cargo install cargo-xbuild
6764
rustup component add --toolchain=nightly rust-src rustfmt
6865
```
6966

@@ -73,10 +70,10 @@ rustup component add --toolchain=nightly rust-src rustfmt
7370
cd hello-world
7471
```
7572

76-
3. Build the static object with cargo xbuild, pointing it at our custom target
73+
3. Build the static object with cargo build, pointing it at our custom target
7774

7875
```
79-
cargo xbuild --target x86_64-linux-kernel
76+
cargo build -Z build-std=core,alloc --target x86_64-linux-kernel
8077
```
8178

8279
4. Build the kernel module using the Linux kernel build system (kbuild)

tests/run_tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def main():
2626

2727
print("+ [{}]".format(path))
2828
run(
29-
"cargo", "xbuild",
29+
"cargo", "build", "-Zbuild-std=core,alloc",
3030
"--target", "x86_64-linux-kernel",
3131
cwd=os.path.join(BASE_DIR, path),
3232
environ=dict(

0 commit comments

Comments
 (0)