Compare commits

...

2 Commits

Author SHA1 Message Date
Jeremy Soller be63ea4991 Merge branch 'xargo-to-cargo' into 'master'
Switch kernel builds away from using xargo

See merge request redox-os/redox!1255
2020-10-06 13:05:56 +00:00
Robin Randhawa b9f43dd529 Switch kernel builds away from using xargo
Use cargo's 'build-std=core,alloc' instead.

Also: Cargo is now given the complete path to the target specific JSON file.
This forces the use of the JSON file (the file is silently ignored if
the target in question was built into the rust compiler).
2020-10-06 14:00:30 +01:00
3 changed files with 5 additions and 4 deletions

View File

@ -38,7 +38,6 @@ endif
ROOT=$(CURDIR) ROOT=$(CURDIR)
export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt
export RUST_TARGET_PATH=$(ROOT)/kernel/targets export RUST_TARGET_PATH=$(ROOT)/kernel/targets
export XARGO_HOME=$(ROOT)/build/xargo
export XARGO_RUST_SRC=$(ROOT)/rust/src export XARGO_RUST_SRC=$(ROOT)/rust/src
## Kernel variables ## Kernel variables

View File

@ -2,19 +2,19 @@ build/libkernel.a: kernel/Cargo.lock kernel/Cargo.toml kernel/src/* kernel/src/*
export PATH="$(PREFIX_PATH):$$PATH" && \ export PATH="$(PREFIX_PATH):$$PATH" && \
export INITFS_FOLDER=$(ROOT)/build/initfs && \ export INITFS_FOLDER=$(ROOT)/build/initfs && \
cd kernel && \ cd kernel && \
xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@ cargo rustc --lib --target=$(ROOT)/kernel/targets/$(KTARGET).json --release -Z build-std=core,alloc -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@
build/libkernel_coreboot.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_coreboot.tag build/libkernel_coreboot.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_coreboot.tag
export PATH="$(PREFIX_PATH):$$PATH" && \ export PATH="$(PREFIX_PATH):$$PATH" && \
export INITFS_FOLDER=$(ROOT)/build/initfs_coreboot && \ export INITFS_FOLDER=$(ROOT)/build/initfs_coreboot && \
cd kernel && \ cd kernel && \
xargo rustc --lib --target $(KTARGET) --release --features live -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@ cargo rustc --lib --target=$(ROOT)/kernel/targets/$(KTARGET).json --release --features live -Z build-std=core,alloc -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_live.tag build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_live.tag
export PATH="$(PREFIX_PATH):$$PATH" && \ export PATH="$(PREFIX_PATH):$$PATH" && \
export INITFS_FOLDER=$(ROOT)/build/initfs_live && \ export INITFS_FOLDER=$(ROOT)/build/initfs_live && \
cd kernel && \ cd kernel && \
xargo rustc --lib --target $(KTARGET) --release --features live -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@ cargo rustc --lib --target=$(ROOT)/kernel/targets/$(KTARGET).json --release --features live -Z build-std=core,alloc -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@
build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
export PATH="$(PREFIX_PATH):$$PATH" && \ export PATH="$(PREFIX_PATH):$$PATH" && \

View File

@ -28,6 +28,8 @@ $(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX)/rust-install
cd "$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
mkdir $@/lib/rustlib/src
ln -s $(ROOT)/rust $@/lib/rustlib/src
$(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
tar \ tar \