Skip to content

Tweaks to Makefiles to be able to build the kernel on macOS again.

Jeremy Soller requested to merge goyox86:goyox86/fix-build-macos into master

Created by: goyox86

Problem:

The kernel can't be built (without fiddling with env vars and stuff which) due to one of raw-cpuid C dependencies being compiled as a Mach-O object file by the macOS toolchain and also the cookbook scripts assume GNU utilities. This may be a show stopper for newcomers on macOS.

Solution:

  • Force using the macOS Redox toolchain compiler and archiver in order to generate a proper ELF file when building the 'raw-cpuid' crate C code.

  • Add the findutils and coreutils Homebrew/MacPorts packages to the bootstrap script in order to setup the proper environment for the cookbook scripts (as they assume GNU tools). This should be temporary until the cookbook scripts get migrated to Rust. findutils contains gfind AKA GNU find. And coreutils contain stat which may look overkill but I guess after this we can safely assume that cookbook scripts will have GNU coreutils available making them simpler.

Changes introduced by this pull request:

  • Force CC and AR in kernel buidling/linking on macOS.
  • Add the findutils and coreutils Homebrew/MacPorts packages to the bootstrap script.

Fixes: https://github.com/redox-os/redox/issues/963

State: [the state of this PR, e.g. WIP, ready, etc.]

Blocking/related: I'm gonna link the cookbook PR soon.

Merge request reports