mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2024-10-27 20:34:19 +00:00
Lesson 24, upgrading to El Capitan
This commit is contained in:
parent
d8babeefc1
commit
19cb91f8fe
1
24-el-capitan/Makefile
Symbolic link
1
24-el-capitan/Makefile
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../23-fixes/Makefile
|
64
24-el-capitan/README.md
Normal file
64
24-el-capitan/README.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
**Goal: Update our build system to El Capitan**
|
||||||
|
|
||||||
|
If you were following this guide from the beginning, and upgraded to El Capitan only
|
||||||
|
to find that Makefiles don't compile anymore, follow these instructions to upgrade
|
||||||
|
your cross-compiler.
|
||||||
|
|
||||||
|
Otherwise, move on to the next lesson
|
||||||
|
|
||||||
|
Upgrading the cross-compiler
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
We will follow the same instructions as in lesson 11, more or less.
|
||||||
|
|
||||||
|
First, run `brew upgrade` and you will get your gcc upgraded to version 5.0 (at the time this guide was written)
|
||||||
|
|
||||||
|
Then run `xcode-select --install` to update OSX commandline tools
|
||||||
|
|
||||||
|
Once installed, find where your packaged gcc is (remember, not clang) and export it. For example:
|
||||||
|
|
||||||
|
```
|
||||||
|
export CC=/usr/local/bin/gcc-5
|
||||||
|
export LD=/usr/local/bin/gcc-5
|
||||||
|
```
|
||||||
|
|
||||||
|
We will need to recompile binutils and our cross-compiled gcc. Export the targets and prefix:
|
||||||
|
|
||||||
|
```
|
||||||
|
export PREFIX="/usr/local/i386elfgcc"
|
||||||
|
export TARGET=i386-elf
|
||||||
|
export PATH="$PREFIX/bin:$PATH"
|
||||||
|
```
|
||||||
|
|
||||||
|
binutils
|
||||||
|
--------
|
||||||
|
|
||||||
|
Rember: always be careful before pasting walls of text from the internet. I recommend copying line by line.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir /tmp/src
|
||||||
|
cd /tmp/src
|
||||||
|
curl -O http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.gz # If the link 404's, look for a more recent version
|
||||||
|
tar xf binutils-2.24.tar.gz
|
||||||
|
mkdir binutils-build
|
||||||
|
cd binutils-build
|
||||||
|
../binutils-2.24/configure --target=$TARGET --enable-interwork --enable-multilib --disable-nls --disable-werror --prefix=$PREFIX 2>&1 | tee configure.log
|
||||||
|
make all install 2>&1 | tee make.log
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
gcc
|
||||||
|
---
|
||||||
|
```sh
|
||||||
|
cd /tmp/src
|
||||||
|
curl -O http://mirror.bbln.org/gcc/releases/gcc-4.9.1/gcc-4.9.1.tar.bz2
|
||||||
|
tar xf gcc-4.9.1.tar.bz2
|
||||||
|
mkdir gcc-build
|
||||||
|
cd gcc-build
|
||||||
|
../gcc-4.9.1/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --disable-libssp --enable-languages=c --without-headers
|
||||||
|
make all-gcc
|
||||||
|
make all-target-libgcc
|
||||||
|
make install-gcc
|
||||||
|
make install-target-libgcc
|
||||||
|
```
|
||||||
|
|
1
24-el-capitan/boot
Symbolic link
1
24-el-capitan/boot
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../23-fixes/boot
|
1
24-el-capitan/cpu
Symbolic link
1
24-el-capitan/cpu
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../23-fixes/cpu
|
1
24-el-capitan/drivers
Symbolic link
1
24-el-capitan/drivers
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../23-fixes/drivers
|
1
24-el-capitan/kernel
Symbolic link
1
24-el-capitan/kernel
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../23-fixes/kernel
|
1
24-el-capitan/libc
Symbolic link
1
24-el-capitan/libc
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../23-fixes/libc
|
Loading…
Reference in New Issue
Block a user