Small fixes to Makefiles to be able to build the kernel on

macOS again.

Details

- We are using the toolchain compiler and archiver in order
to generate a proper ELF file when building the 'raw-cpuid'
crate C code which is currently being compiled by the macOS
toolchain.

- I added the 'findutils' and 'coreutils' Homebrew/MacPorts
packages to the bootstrap script in order to setup the proper
environment for the cookbook scripts (as the assume GNU tools).
This should be temporary until the cookbook scripts get migrated
to Rust.
This commit is contained in:
Jose Narvaez 2017-07-13 21:00:55 +01:00
parent 18c2211db4
commit 8a43b5a3e5
2 changed files with 11 additions and 2 deletions

View file

@ -93,6 +93,8 @@ osx_macports()
install_macports_pkg "virtualbox" install_macports_pkg "virtualbox"
fi fi
install_macports_pkg "coreutils"
install_macports_pkg "findutils"
install_macports_pkg "gcc49" "gcc-4.9" install_macports_pkg "gcc49" "gcc-4.9"
install_macports_pkg "nasm" install_macports_pkg "nasm"
install_macports_pkg "pkgconfig" install_macports_pkg "pkgconfig"
@ -120,6 +122,8 @@ osx_homebrew()
install_brew_pkg "virtualbox" install_brew_pkg "virtualbox"
fi fi
install_macports_pkg "coreutils"
install_macports_pkg "findutils"
install_brew_pkg "gcc49" "gcc-4.9" install_brew_pkg "gcc49" "gcc-4.9"
install_brew_pkg "nasm" install_brew_pkg "nasm"
install_brew_pkg "pkg-config" install_brew_pkg "pkg-config"

View file

@ -1,5 +1,10 @@
build/libkernel.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag 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 xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@
else
cd kernel && xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@ cd kernel && xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@
endif
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag build/filesystem.bin build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag build/filesystem.bin
cd kernel && FILESYSTEM="$(PWD)/build/filesystem.bin" xargo rustc --lib --features live --target $(KTARGET) --release -- -C soft-float --emit link=../$@ cd kernel && FILESYSTEM="$(PWD)/build/filesystem.bin" xargo rustc --lib --features live --target $(KTARGET) --release -- -C soft-float --emit link=../$@