1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-23 00:16:17 +04:00

build: remove filling symbols. prepare command 'make test'.

This commit is contained in:
Runji Wang 2019-09-24 14:26:18 +08:00
parent f1642ec547
commit 3beddf12da
2 changed files with 17 additions and 21 deletions

View File

@ -52,9 +52,7 @@ before_script:
script: script:
- cd user && make sfsimg arch=$ARCH prebuilt=1 && cd .. - cd user && make sfsimg arch=$ARCH prebuilt=1 && cd ..
- cd kernel && make build arch=$ARCH $OPTS && cd .. - cd kernel && make build arch=$ARCH $OPTS && cd ..
- if [ $ARCH = riscv32 ]; then - cd kernel && make test arch=$ARCH $OPTS && cd ..
cd tests && ./test.sh && cd ..;
fi
before_cache: before_cache:
- if [ $TRAVIS_OS_NAME = osx ]; then brew cleanup; fi - if [ $TRAVIS_OS_NAME = osx ]; then brew cleanup; fi

View File

@ -2,10 +2,8 @@
# make build Build # make build Build
# make run Build and run in QEMU # make run Build and run in QEMU
# make justrun Run the last build # make justrun Run the last build
# make runnet Build and run in QEMU with nic # make test Build and run in QEMU with specified program
# make justrunnet Run the last build with nic # make justtest Run the last build with specified program
# make runtest Build and run in QEMU with specified program
# make justruntest Run the last build with specified program
# make doc Generate docs # make doc Generate docs
# make asm Open the deassemble file of the last build # make asm Open the deassemble file of the last build
# make header Open 'objdump -h' of the last build # make header Open 'objdump -h' of the last build
@ -26,6 +24,7 @@
# | k210 Only available on riscv64, run on K210, use Sv39 # | k210 Only available on riscv64, run on K210, use Sv39
# | rocket_chip Only available on riscv64, run on Rocket Chip, use Sv39 # | rocket_chip Only available on riscv64, run on Rocket Chip, use Sv39
# | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+ # | raspi3 Only available on aarch64, run on Raspberry Pi 3 Model B/B+
# net = on | off Only available on x86_64, enable NIC
# pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device # pci_passthru = 0000:00:00.1 Only available on x86_64, passthrough the specified PCI device
# init = /bin/ls Only available on riscv64, run specified program instead of user shell # init = /bin/ls Only available on riscv64, run specified program instead of user shell
# extra_nic = on | off Only available on x86_64, add an additional e1000 nic # extra_nic = on | off Only available on x86_64, add an additional e1000 nic
@ -41,6 +40,7 @@ pci_passthru ?=
init ?= init ?=
extra_nic ?= off extra_nic ?= off
qemu := qemu-system-$(arch)
target := $(arch) target := $(arch)
build_path := target/$(target)/$(mode) build_path := target/$(target)/$(mode)
kernel := $(build_path)/rcore kernel := $(build_path)/rcore
@ -182,6 +182,11 @@ ifeq ($(graphic), off)
qemu_opts += -nographic qemu_opts += -nographic
endif endif
ifeq ($(net), on)
qemu_opts += $(qemu_net_opts)
qemu := sudo $(qemu)
endif
### build args ### ### build args ###
ifeq ($(graphic), off) ifeq ($(graphic), off)
features += nographic features += nographic
@ -238,7 +243,7 @@ strip := cargo strip --
dtc := dtc dtc := dtc
hostcc := gcc hostcc := gcc
.PHONY: all clean build asm doc debug kernel sfsimg install run justrun runnet justrunnet runtest justruntest .PHONY: all clean build asm doc debug kernel sfsimg install run justrun test justtest
all: kernel all: kernel
@ -251,20 +256,17 @@ doc:
@cargo rustdoc -- --document-private-items @cargo rustdoc -- --document-private-items
run: build justrun run: build justrun
runnet: build justrunnet test: build justtest
runtest: build justruntest
justrun: justrun:
@qemu-system-$(arch) $(qemu_opts) @$(qemu) $(qemu_opts)
justrunnet: justtest:
@sudo qemu-system-$(arch) $(qemu_opts) $(qemu_net_opts) # unavailable now
@#$(qemu) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(init) -serial file:../tests/stdout -monitor null
justruntest:
@qemu-system-$(arch) $(filter-out -serial mon:stdio, $(qemu_opts)) --append $(init) -serial file:../tests/stdout -monitor null
debug: $(kernel) $(kernel_img) debug: $(kernel) $(kernel_img)
@qemu-system-$(arch) $(qemu_opts) -s -S & @$(qemu) $(qemu_opts) -s -S &
@sleep 1 @sleep 1
@$(gdb) $(kernel) -x ../tools/gdbinit @$(gdb) $(kernel) -x ../tools/gdbinit
@ -293,8 +295,6 @@ ifeq ($(arch), x86_64)
@cd ../rboot && make build @cd ../rboot && make build
endif endif
ifeq ($(arch), aarch64) ifeq ($(arch), aarch64)
@echo "Patching symbols into kernel."
@../tools/fill_symbols/aarch64.sh target/aarch64/$(mode)/rcore $(prefix)
@echo Building $(arch) bootloader @echo Building $(arch) bootloader
@$(strip) $(kernel) -o $(kernel)_stripped @$(strip) $(kernel) -o $(kernel)_stripped
@cd $(bootloader_dir) && make arch=$(arch) mode=$(mode) payload=../kernel/$(kernel)_stripped @cd $(bootloader_dir) && make arch=$(arch) mode=$(mode) payload=../kernel/$(kernel)_stripped
@ -320,8 +320,6 @@ kernel: $(dtb)
@echo Building $(arch) kernel @echo Building $(arch) kernel
ifeq ($(arch), x86_64) ifeq ($(arch), x86_64)
@cargo xbuild $(build_args) @cargo xbuild $(build_args)
@echo "Now patching kernel symbols onto kernel."
@../tools/fill_symbols/x86_64.sh target/x86_64/$(mode)/rcore
else ifeq ($(arch), $(filter $(arch), riscv32 riscv64)) else ifeq ($(arch), $(filter $(arch), riscv32 riscv64))
ifeq ($(board), k210) ifeq ($(board), k210)
@cp src/arch/riscv32/board/k210/linker.ld src/arch/riscv32/boot/linker64.ld @cp src/arch/riscv32/board/k210/linker.ld src/arch/riscv32/boot/linker64.ld