building zephyr with mainline toolchain for Arduino 101


Lukasz Janyst <xyz@...>
 

Hi there,

I have recently started playing with Zephyr and decided to see whether I
can build it for Arduino 101 with the mainline toolchain. I compiled the
following for both i586-none-elfiamcu and arc-none-elf targets:

* binutils master branch, 2.26.51 has messed up commandline parsing for
arc (fixed in master)
* gcc 6.1
* newlib 2.4.0
* gdb 7.11 (mainline for Intel, foss-for-synopsys-dwc-arc-processors for
arc)

Things work well for Intel except for one minor glitch in newlib's
'strtold()'. However, for arc, I have encountered some issues with
zephyr itself:

1) In various assembler files you use the 'j_s.nd [blink]' instruction.
I could not find anywhere what it is supposed to do and mainline gas
does not know what to do about it. When you look at the actual opcodes
emitted by poky gas, it seems that what you meant is 'j_s [blink]':

https://jany.st/tools/zerobin/?0720d0b22d454d12#0isJEY6pqj4aMNiHL5tUOn627K/c746sR24Smx9qKL8=

Things work if I change that. I can send out a patch if there is an
interest.

2) gcc 6.1 for arc seems to emit code containing traps calling
'abort()':

https://jany.st/tools/zerobin/?4b679a767b37a3a5#JBh80TwI4M3jahfRBLvWQvjVhRIDFnnB4AVEewXUTNY=

Zephyr does not provide the symbol, so the compilation fails. It seems
that Linux provides 'abort()' for certain architectures:

http://lxr.free-electrons.com/source/arch/arm/kernel/traps.c#L756

I don't know enough about arc to provide a sensible implementation so
suggestions would be appreciated. A dummy symbol makes the compilation
pass.

Cheers,
Lukasz

Join devel@lists.zephyrproject.org to automatically receive all group messages.