Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
chore(kernel): avoid to compile build.rs wrongly (#84)
Browse files Browse the repository at this point in the history
Without specifying a target, `build.rs` will also be compiled with the
same codegen options. See: rust-lang/cargo#6375 (comment)
  • Loading branch information
toku-sa-n authored Jun 30, 2021
1 parent 7cd003d commit 09522e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ KERNEL_SRCS = $(shell find $(KERNEL_DIR) -name *.rs)
KERNEL_SRCS += $(KERNEL_DIR)/Cargo.toml
KERNEL_SRCS += $(KERNEL_DIR)/.cargo/config.toml
KERNEL_SRCS += $(KERNEL_DIR)/kernel.ld
KERNEL = target/debug/kernel
KERNEL = target/$(ARCH)-unknown-linux-gnu/debug/kernel

ISO_FILE = $(BUILD_DIR)/antei.iso

Expand Down
3 changes: 3 additions & 0 deletions kernel/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[build]
target = "x86_64-unknown-linux-gnu"

[target.x86_64-unknown-linux-gnu]
rustflags = [
"-C", "code-model=kernel",
"-C", "link-args=-T kernel/kernel.ld",
Expand Down

0 comments on commit 09522e8

Please sign in to comment.