|
|
There are two ways of installing the miosix toolchain on macOS: use the precompiled binaries or compile them yourself.
|
|
|
|
|
|
# Precompiled binaries pkg
|
|
|
|
|
|
Download the miosix toolchain pkg; you can find it [here](https://drive.google.com/file/d/1GloSDM6SlXd-7pinvq7VxIXBrxKDoSTo/view?usp=sharing). Open it and follow installation instructions. Note: you may have to authorize its opening in System Settings -> Privacy & Security.
|
|
|
|
|
|
# Manual Installation
|
|
|
|
|
|
## Preinstall
|
|
|
|
|
|
Install Homebrew (it will also install Command Lines Tools for Xcode if they are not already present):
|
|
|
|
|
|
`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
|
|
|
|
|
Install the following packages with Homebrew: `brew install gnu-tar gcc@9`
|
|
|
|
|
|
Create the appropriate symlinks to use gcc@9:
|
|
|
|
|
|
```shell
|
|
|
ln -s /usr/local/bin/gcc-9 /usr/local/bin/gcc
|
|
|
ln -s /usr/local/bin/gcc-9 /usr/local/bin/cc
|
|
|
ln -s /usr/local/bin/g++-9 /usr/local/bin/g++
|
|
|
ln -s /usr/local/bin/cpp-9 /usr/local/bin/cpp
|
|
|
ln -s /usr/local/bin/c++-9 /usr/local/bin/c++
|
|
|
```
|
|
|
|
|
|
Add gcc@9 to the $PATH; in order to do this, add the following lines to the .zshrc file in the home folder:
|
|
|
|
|
|
```shell
|
|
|
#homebrew gcc
|
|
|
export PATH=/usr/local/bin:$PATH
|
|
|
#gnu-tar
|
|
|
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH
|
|
|
```
|
|
|
|
|
|
Load changes with: `source .zshrc`
|
|
|
|
|
|
Check if all went well up to this point:
|
|
|
|
|
|
* `gcc -v` should return something like `gcc version 9.5.0 (Homebrew GCC 9.5.0)`
|
|
|
* `ld -v` should return something like `LTO support using: LLVM version 14.0.0`
|
|
|
|
|
|
Install needed dependencies with: `brew install make ncurses byacc flex texinfo patchutils unzip lzip libelf perl expat wget git bash coreutils xz stlink cmake`
|
|
|
|
|
|
Edit the .zshrc file to use GNU make as make instead of gmake by adding the following line:
|
|
|
|
|
|
`PATH="/usr/local/opt/make/libexec/gnubin:$PATH"`
|
|
|
|
|
|
Load changes with: `source .zshrc`
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
Clone miosix repo:
|
|
|
|
|
|
```shell
|
|
|
git clone https://miosix.org/git-public/miosix-kernel.git
|
|
|
cd miosix-kernel
|
|
|
git fetch origin
|
|
|
```
|
|
|
|
|
|
Move to the compiler directory: `cd miosix/\_tools/compiler/gcc-9.2.0-mp3.1`
|
|
|
|
|
|
Execute the download script: `sh download.sh`
|
|
|
|
|
|
Execute the install script: `sudo sh install-script.sh -j$(nproc)`
|
|
|
|
|
|
Note: the installation process could around 20 to 40 min, depending on the specs of the pc.
|
|
|
|
|
|
|
|
|
Add toolchain to path: `#arm-miosix-eabi export PATH=/opt/arm-miosix-eabi/bin:$PATH`
|
|
|
|
|
|
Load changes with: `source .zshrc`
|
|
|
|
|
|
## Cleanup
|
|
|
|
|
|
Remove from .zshrc:
|
|
|
|
|
|
```shell
|
|
|
#homebrew gcc
|
|
|
export PATH=/usr/local/bin:$PATH
|
|
|
#gnu-tar
|
|
|
export PATH=/usr/local/opt/gnu-tar/libexec/gnubin:$PATH
|
|
|
```
|
|
|
|
|
|
Load changes with: `source .zshrc`
|
|
|
|
|
|
Go to /miosix-kernel/miosix/\_tools/compiler/gcc-9.2.0-mp3.1 and execute the cleanup script: `sudo sh cleanup.sh` |
|
|
\ No newline at end of file |