Skip to content

Commit

Permalink
fix: 修复由于升级到2024-07-23工具链之后,某些机器上面内核运行一直fault的问题。 (DragonOS-Community…
Browse files Browse the repository at this point in the history
…#870)

* fix: 修复由于升级到2024-07-23工具链之后,某些机器上面内核运行一直fault的问题。
  • Loading branch information
fslongjin authored and Samuka007 committed Aug 3, 2024
1 parent f8cf470 commit e0c87e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions kernel/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
runner = "bootimage runner"

[build]
# '-Zlinker-features=-lld' 禁用rustlld(20240723),因为它与linkme0.3版本冲突
rustflags = ["-Zlinker-features=-lld"]
rustdocflags = ["-Zlinker-features=-lld"]
rustflags = ["-Clink-args=-znostart-stop-gc"]
rustdocflags = ["-Clink-args=-znostart-stop-gc"]

[env]
6 changes: 3 additions & 3 deletions kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ check: ECHO
# @echo "Checking kernel... ARCH=$(ARCH)"
# @exit 1
ifeq ($(ARCH), x86_64)
@cargo +nightly-2024-07-23 check --workspace $(CARGO_ZBUILD) --message-format=json --target ./src/$(TARGET_JSON)
RUSTFLAGS="$(RUSTFLAGS)" cargo +nightly-2024-07-23 check --workspace $(CARGO_ZBUILD) --message-format=json --target ./src/$(TARGET_JSON)
else ifeq ($(ARCH), riscv64)
@cargo +nightly-2024-07-23 check --workspace $(CARGO_ZBUILD) --message-format=json --target $(TARGET_JSON)
RUSTFLAGS="$(RUSTFLAGS)" cargo +nightly-2024-07-23 check --workspace $(CARGO_ZBUILD) --message-format=json --target $(TARGET_JSON)
endif

test:
# 测试内核库
@cargo +nightly-2024-07-23 test --workspace --exclude dragonos_kernel
RUSTFLAGS="$(RUSTFLAGS)" cargo +nightly-2024-07-23 test --workspace --exclude dragonos_kernel

6 changes: 3 additions & 3 deletions kernel/src/process/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ impl ProcInitInfo {
return Ok(());
}

fn push_str(&self, ustack: &mut UserStack, s: &str) -> Result<(), SystemError> {
self.push_slice(ustack, &[b"\0"])?;
self.push_slice(ustack, s.as_bytes())?;
fn push_str(&self, ustack: &mut UserStack, s: &CString) -> Result<(), SystemError> {
let bytes = s.as_bytes_with_nul();
self.push_slice(ustack, bytes)?;
return Ok(());
}
}

0 comments on commit e0c87e2

Please sign in to comment.