Skip to content
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

Merged
merged 2 commits into from
Aug 13, 2020
Merged

[#closes 127] Compile in release mode with debug symbol #134

merged 2 commits into from
Aug 13, 2020

Conversation

kimjungwow
Copy link
Collaborator

요약 : cargo xbuild가 항상 debug 모드로 컴파일하도록 하였습니다.

@kimjungwow kimjungwow requested a review from jeehoonkang August 13, 2020 04:28
@kimjungwow kimjungwow self-assigned this Aug 13, 2020
@@ -13,6 +13,7 @@ test = []

[profile.dev]
panic = "abort"
lto = true
Copy link
Member

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

혹시 이렇게 하면 부팅이 안되나요?

Copy link
Collaborator

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

@@ -13,6 +13,7 @@ test = []

[profile.dev]
panic = "abort"
lto = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lto = link time optimization

@kimjungwow
Copy link
Collaborator Author

  • 말씀하신대로 release profile을 사용하고 debug symbol을 사용하도록 수정하였습니다.
  • make qemu + make qemu-gdb에서 부팅 성공 + usertests passed

@kimjungwow kimjungwow changed the title [#closes 127] Compile only with debug mode [#closes 127] Compile in release mode with debug symbol Aug 13, 2020
@jeehoonkang jeehoonkang merged commit 1301316 into kaist-cp:riscv Aug 13, 2020
@kimjungwow kimjungwow deleted the issue127 branch August 13, 2020 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

debug로 컴파일시 부팅 안됨
3 participants