I can't cross compile the linux kernel on osX and I don't understand why. Following the steps on the eLinux website I get the following error:
Code: Select all
scripts/sortextable.c:244:7: error: use of undeclared identifier 'EM_S390'http://blog.y3xz.com/blog/2012/10/07/se ... n-mac-os-x
This is the script I used to compile (edited a little bit from the eLinux):
Code: Select all
#!/bin/bash
# sudo port install arm-none-eabi-gcc
# sudo port install arm-none-eabi-binutils
brew install libelf
sudo ln -s /usr/local/Cellar/libelf /usr/include/libelf
sudo curl http://opensource.apple.com/source/dtrace/dtrace-48/sys/elftypes.h?txt -o /usr/include/elftypes.h
sudo curl http://opensource.apple.com/source/dtrace/dtrace-48/sys/elf.h?txt -o /usr/include/elf.h
#code to append to elf.h
echo "
#define R_386_NONE 0
#define R_386_32 1
#define R_386_PC32 2
#define R_ARM_NONE 0
#define R_ARM_PC24 1
#define R_ARM_ABS32 2
#define R_MIPS_NONE 0
#define R_MIPS_16 1
#define R_MIPS_32 2
#define R_MIPS_REL32 3
#define R_MIPS_26 4
#define R_MIPS_HI16 5
#define R_MIPS_LO16 6" > elf-append.h
sudo -s 'cat elf-append.h >> /usr/include/elf.h'
#Make a case sensitive 3 GB disk image, raspberrypi-kernel, and attach it:
hdiutil create -size 10g -type SPARSEBUNDLE -nospotlight -volname raspberrypi-kernel -fs "Case-sensitive Journaled HFS+" -attach ./raspberrypi-kernel.dmg
cp raspberrypi.config /Volumes/raspberrypi-kernel/
mkdir /Volumes/raspberrypi-kernel/src
cd /Volumes/raspberrypi-kernel/src
git init
git clone --depth 1 git://github.com/raspberrypi/linux.git
cpu=$(sysctl hw.ncpu | awk '{print $2}')
cpup1=$((cpu+1))
cd /Volumes/raspberrypi-kernel/src/linux/
export CCPREFIX=~/arm-cs-tools/bin/arm-none-eabi-
make mrproper
cp /Volumes/raspberrypi-kernel/raspberrypi.config .config
#Answer yes to all config options
yes "" | make ARCH=arm CROSS_COMPILE=${CCPREFIX} oldconfig
make ARCH=arm CROSS_COMPILE=${CCPREFIX} -j2
#make ARCH=arm CROSS_COMPILE=${CCPREFIX} modules -j$cpup1