-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#closes 127] Compile in release mode with debug symbol #134
Conversation
kernel-rs/Cargo.toml
Outdated
@@ -13,6 +13,7 @@ test = [] | |||
|
|||
[profile.dev] | |||
panic = "abort" | |||
lto = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makefile에 따르면 C 코드는 -O
로 컴파일하고 -g
옵션을 준 것으로 보이는데, Rust에서도 release profile을 사용하여 -O
로 컴파일하고 debug symbol을 넣어주는게 어떨가 합니다: https://stackoverflow.com/a/38804737
혹시 이렇게 하면 부팅이 안되나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeehoonkang RUST-MODE = release
로 하고 Cargo.toml에 debug = true
하라는 말씀이시죠? make qemu 시 아래와 같은 에러가 발생합니다.
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
riscv64-linux-gnu-gcc -Wall -Werror -O -fno-omit-frame-pointer -ggdb -MD -mcmodel=medany -ffreestanding -fno-common -nostdlib -mno-relax -I. -fno-stack-protector -fno-pie -no-pie -nostdinc -I. -Ikernel -c user/initcode.S -o user/initcode.o
riscv64-linux-gnu-ld -z max-page-size=4096 -N -e start -Ttext 0 -o user/initcode.out user/initcode.o
riscv64-linux-gnu-objcopy -S -O binary user/initcode.out user/initcode
riscv64-linux-gnu-objdump -S user/initcode.o > user/initcode.asm
riscv64-linux-gnu-ld -z max-page-size=4096 -T kernel/kernel.ld -o kernel/kernel kernel/entry.o kernel/swtch.o kernel/trampoline.o kernel/kernelvec.o kernel-rs/target/riscv64gc-unknown-none-elfhf/release/librv6_kernel.a
riscv64-linux-gnu-ld: cannot find kernel-rs/target/riscv64gc-unknown-none-elfhf/release/librv6_kernel.a: No such file or directory
make: *** [Makefile:87: kernel/kernel] Error 1
kernel-rs/Cargo.toml
Outdated
@@ -13,6 +13,7 @@ test = [] | |||
|
|||
[profile.dev] | |||
panic = "abort" | |||
lto = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lto = link time optimization
|
요약 :
cargo xbuild
가 항상 debug 모드로 컴파일하도록 하였습니다.make qemu
,make qemu-gdb
둘 다 부팅 성공 + 둘 다 all usertests passed