Documente Academic
Documente Profesional
Documente Cultură
2. Prerequisites:
This section details the host system and necessary tools for the steps coming up in next
section to cross-compile the applications for target Quark SoC.
a. Host system configuration supported Linux OS based machine:
i.
Download and install Intel System Studio with Intel Composer XE installed on the
host.
3. Steps:
This section provides the steps necessary to first setup the cross-compilation environment
and then usage of proper flags for cross-compilation.
Following hello-world example is used for cross-compilation in rest of the steps:
$ cat HelloWorldQuark.c
#include <stdio.h>
int main(int argc, char* argv[])
{
#ifdef __INTEL_COMPILER
printf("Hello World from QUARK - using ICC!!!\n");
#else
printf("Hello World from QUARK - using GCC!!!\n");
#endif
return(0);
}
Include path for uCLibc tools under Poky Linux SDK tools:
$ export PATH=/home/jdpatel/arduino-1.5.3/hardware/tools/sysroots/x86_64pokysdk-linux/usr/bin/i586-poky-linux-uclibc/:$PATH
$
$ which i586-poky-linux-uclibc-g++
~/2rduino-1.5.3/hardware/tools/sysroots/x86_64-pokysdk-linux/usr/bin/i586poky-linux-uclibc/i586-poky-linux-uclibc-g++
$
This is not an error because the cross-compiled binary is targeted to run on Quark
SoC and not on the host system running on Core series processor.
iii.
iv.
00:00
ii.
Include path for uCLibc tools under Poky Linux SDK tools (same as for build using
GCC):
$ export PATH=/home/jdpatel/arduino-1.5.3/hardware/tools/sysroots/x86_64pokysdk-linux/usr/bin/i586-poky-linux-uclibc/:$PATH
$
$ which i586-poky-linux-uclibc-g++
~/arduino-1.5.3/hardware/tools/sysroots/x86_64-pokysdk-linux/usr/bin/i586poky-linux-uclibc/i586-poky-linux-uclibc-g++
$
iii.
This is not an error because the cross-compiled binary is targeted to run on Quark
SoC and not on the host system running on Core series processor.
v.
vi.
00:00
4. Troubleshooting:
This section may help resolving some of the common errors related to above steps:
i.
If the Arduino SDK setup was not completed, following compilation error occurs:
$ i586-poky-linux-uclibc-g++ --sysroot=/home/jdpatel/arduino1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc HelloWorldQuark.c -o
helloworld-quark-gcc
-bash: /home/jdpatel/arduino-1.5.3/hardware/tools/sysroots/x86_64-pokysdklinux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++: /opt/clantontiny/1.4.2/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2: bad ELF
interpreter: No such file or directory
$
Arduino SDK setup step explained in prerequisites section should now be successful.