The Makefile uses xargo instead of cargo now

This commit is contained in:
Philipp Oppermann
2017-05-09 19:01:05 +02:00
committed by GitHub
parent 6ef85ecd69
commit 160b986322

View File

@@ -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)
```