4

I am trying to compile OpeniBoot on an ARM device, namely the PocketCHIP, as per this guide (abeit with some minor modifications, considering I am not using a Raspberry Pi.). OpeniBoot is a custom low-level bootloader designed to be installed on Apple devices, such as the iPod Touch or iPhone. It permits the user to run a Linux kernel alongside the stock iOS kernel, as well as execute other low-level operations.

I have managed to compile and install almost every dependency listed in order to compile the binary for OpeniBoot. However, when running scons iPhone4, I get an error:

chip@chip:~/openiBoot$ scons iPhone4
...
arch-arm/asmhelpers.sx: Assembler messages:
arch-arm/asmhelpers.sx:212: Error: selected processor does not support `wfi'
scons: *** [arch-arm/iPhone4_asmhelpers.o] Error 1
scons: building terminated because of errors.

I've researched this error, and I've found this solution:

Fixed it by adding "-mcpu=cortex-a8" to the compiler options.

I have already tried appending the option to the scons command itself, in a syntax similar to this:

scons -mcpu=cortex-a8 iPhone4

to no avail.

So the question is: How can I pass options to the compiler when using scons?

--EDIT--

I have since resolved this question, by changing a line in the file "ARMEnviroment.SConscript" to the likes of this:

plat_flags = ['-mlittle-endian', '-mfpu=vfp', '-mthumb', '-mthumb-interwork', '-fPIC', '-mcpu=cortex-a8']

However, I now encounter a new error upon compiling:

chip@chip:~/openiBoot$ scons iPhone4
...
arch-arm/entry.sx:0: error: bad value (cortex-a8) for -mcpu= switch
scons: *** [arch-arm/iPhone4_entry.o] Error 1
scons: building terminated because of errors.

I believe this is because scons is still using the old toolchain installed with apt-get, GCC-4.9.2, instead of using the openiboot-toolchain that I had compiled (and I believe is necessary for compiling this program).

So the question is, how do I change which toolchain scons uses to compile code?

unilock
  • 41

0 Answers0