From 160b98632279f9cd4aa328fdec15b66b9b3c4d72 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 9 May 2017 19:01:05 +0200 Subject: [PATCH] The Makefile uses `xargo` instead of `cargo` now --- blog/content/post/03-set-up-rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/content/post/03-set-up-rust.md b/blog/content/post/03-set-up-rust.md index 6aa95120..f184fc79 100644 --- a/blog/content/post/03-set-up-rust.md +++ b/blog/content/post/03-set-up-rust.md @@ -348,7 +348,7 @@ The new errors are linker errors about various missing functions such as `__floa In our case, there is a much simpler solution, since our kernel doesn't really need any of those functions yet. So we can just tell the linker to remove unused program sections and hopefully all references to these functions will disappear. Removing unused sections is generally a good idea as it reduces kernel size. The magic linker flag for this is `--gc-sections`, which stands for “garbage collect sections”. Let's add it to the `$(kernel)` target in our `Makefile`: ```make -$(kernel): cargo $(rust_os) $(assembly_object_files) $(linker_script) +$(kernel): xargo $(rust_os) $(assembly_object_files) $(linker_script) @ld -n --gc-sections -T $(linker_script) -o $(kernel) \ $(assembly_object_files) $(rust_os) ```