Skip to content

Commit

Permalink
Merge pull request redox-os#1114 from dlrobertson/master
Browse files Browse the repository at this point in the history
Keep debug info in a .sym file
  • Loading branch information
jackpot51 authored Dec 3, 2017
2 parents 1f3ebdb + 804d0ad commit 3f51531
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kernel
Submodule kernel updated 1 files
+0 −1 linkers/x86_64.ld
6 changes: 4 additions & 2 deletions mk/kernel.mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
build/libkernel.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag
# Temporary fix for https://github.com/redox-os/redox/issues/963 allowing to build on macOS
ifeq ($(UNAME),Darwin)
cd kernel && CC=$(ARCH)-elf-gcc AR=$(ARCH)-elf-ar CFLAGS=-ffreestanding INITFS_FOLDER=$(ROOT)/build/initfs xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@
cd kernel && CC=$(ARCH)-elf-gcc AR=$(ARCH)-elf-ar CFLAGS=-ffreestanding INITFS_FOLDER=$(ROOT)/build/initfs xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 --emit link=../$@
else
cd kernel && INITFS_FOLDER=$(ROOT)/build/initfs xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@
cd kernel && INITFS_FOLDER=$(ROOT)/build/initfs xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 --emit link=../$@
endif

build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs_live.tag
cd kernel && INITFS_FOLDER=$(ROOT)/build/initfs_live xargo rustc --lib --features live --target $(KTARGET) --release -- -C soft-float --emit link=../$@

build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel.a
objcopy --only-keep-debug $@ $@.sym
objcopy --strip-debug $@

build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o
Expand Down
3 changes: 3 additions & 0 deletions mk/qemu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ endif
ifneq ($(usb),no)
QEMUFLAGS+=-device nec-usb-xhci,id=xhci -device usb-tablet,bus=xhci.0
endif
ifneq ($(gdb),yes)
QEMUFLAGS+=-s
endif
ifeq ($(UNAME),Linux)
ifneq ($(kvm),no)
QEMUFLAGS+=-enable-kvm -cpu host
Expand Down

0 comments on commit 3f51531

Please sign in to comment.