1 Reply Latest reply on Apr 9, 2014 5:58 PM by tinkerer8473

    Using the cross-compiler from the Arduino installation kit

    University-user

      One easy way of cross-compiling is to use the C/C++ compilers included in the Arduio IDE kit.

       

      On windows, to compile <filename>.c, assuming you have installed to C:\Programs\arduino-1.5.3, you can use the command:

       

      C:\Programs\arduino-1.5.3\hardware\tools\x86\i686-pokysdk-mingw32\usr\bin\i586-poky-linux-uclibc\i586-poky-linux-uclibc-g++.exe -m32 -march=i586 --sysroot=C:\Programs\arduino-1.5.3\hardware\tools\sysroots\i586-poky-linux-uclibc -I C:\Programs\arduino-1.5.3\hardware\tools\x86\i686-pokysdk-mingw32\usr\lib\i586-poky-linux-uclibc\gcc\i586-poky-linux-uclibc\4.7.2\include -I C:\Programs\arduino-1.5.3\hardware\tools\x86\i586-poky-linux-uclibc\usr\include -L C:\Programs\arduino-1.5.3\hardware\tools\x86\i586-poky-linux-uclibc\usr\lib -L C:\Programs\arduino-1.5.3\hardware\tools\x86\i686-pokysdk-mingw32\usr\lib\i586-poky-linux-uclibc\gcc\i586-poky-linux-uclibc\4.7.2\lib -L C:\Programs\arduino-1.5.3\hardware\tools\x86\i586-poky-linux-uclibc\lib -L C:\Programs\arduino-1.5.3\hardware\tools\x86\i586-poky-linux-uclibc\usr\lib -L C:\Programs\arduino-1.5.3\hardware\tools\x86\i686-pokysdk-mingw32\usr\lib\i586-poky-linux-uclibc\gcc\i586-poky-linux-uclibc\4.7.2\lib -L C:\Programs\arduino-1.5.3\hardware\tools\x86\i586-poky-linux-uclibc\usr\lib -B C:\Programs\arduino-1.5.3\hardware\tools\x86\i586-poky-linux-uclibc\usr\lib -o <filename>-uclibc <filename>.c

       

      (Or put it into a makefile or batch file)

       

      Linux commands to follow.

        • 1. Re: Using the cross-compiler from the Arduino installation kit
          tinkerer8473

          This is my attempt at the linux commands. Beware of erroneous line breaks.

          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /tmp/build7183516734123310168.tmp/sketch_apr06a.cpp -o
          /tmp/build7183516734123310168.tmp/sketch_apr06a.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/fast_gpio_sc.c
          -o /tmp/build7183516734123310168.tmp/fast_gpio_sc.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/wiring_analog.c
          -o /tmp/build7183516734123310168.tmp/wiring_analog.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/wiring_digital.c
          -o /tmp/build7183516734123310168.tmp/wiring_digital.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/sysfs.c
          -o /tmp/build7183516734123310168.tmp/sysfs.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/i2c.c
          -o /tmp/build7183516734123310168.tmp/i2c.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/interrupt.c
          -o /tmp/build7183516734123310168.tmp/interrupt.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/mux.c
          -o /tmp/build7183516734123310168.tmp/mux.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-gcc
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -ffunction-sections -fdata-sections -MMD -march=i586 -m32
          -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/trace.c
          -o /tmp/build7183516734123310168.tmp/trace.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/UtilTime.cpp
          -o /tmp/build7183516734123310168.tmp/UtilTime.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/WMath.cpp
          -o /tmp/build7183516734123310168.tmp/WMath.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/WString.cpp
          -o /tmp/build7183516734123310168.tmp/WString.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/Print.cpp
          -o /tmp/build7183516734123310168.tmp/Print.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/main.cpp
          -o /tmp/build7183516734123310168.tmp/main.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/Stream.cpp
          -o /tmp/build7183516734123310168.tmp/Stream.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/RingBuffer.cpp
          -o /tmp/build7183516734123310168.tmp/RingBuffer.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/TTYUART.cpp
          -o /tmp/build7183516734123310168.tmp/TTYUART.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/cores/arduino/IPAddress.cpp
          -o /tmp/build7183516734123310168.tmp/IPAddress.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD
          -march=i586 -m32 -DARDUINO=153
          -I/arduino-1.5.3/hardware/arduino/x86/cores/arduino
          -I/arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d
          /arduino-1.5.3/hardware/arduino/x86/variants/galileo_fab_d/variant.cpp
          -o /tmp/build7183516734123310168.tmp/variant.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/fast_gpio_sc.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/wiring_analog.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/wiring_digital.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/sysfs.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/i2c.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/interrupt.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/mux.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/trace.c.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/UtilTime.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/WMath.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/WString.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/Print.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/main.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/Stream.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/RingBuffer.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/TTYUART.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/IPAddress.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-ar
          rcs /tmp/build7183516734123310168.tmp/core.a
          /tmp/build7183516734123310168.tmp/variant.cpp.o
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++
          -m32 -march=i586
          --sysroot=/arduino-1.5.3/hardware/tools/sysroots/i586-poky-linux-uclibc
          -Os -Wl,--gc-sections -march=i586 -o
          /tmp/build7183516734123310168.tmp/sketch_apr06a.cpp.elf
          /tmp/build7183516734123310168.tmp/sketch_apr06a.cpp.o
          /tmp/build7183516734123310168.tmp/core.a
          -L/tmp/build7183516734123310168.tmp -lm -lpthread
          
          /arduino-1.5.3/hardware/tools/sysroots/i586-pokysdk-linux/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-strip
          /tmp/build7183516734123310168.tmp/sketch_apr06a.cpp.elf