Building Dart SDK for Raspberry Pi

Zachary Anderson edited this page Nov 16, 2016 · 4 revisions


These instructions will let you build and run the Dart standalone VM for a Raspberry Pi device running the Raspbian distribution of Linux. For now, this process will likely only work on a Linux machine.


This build will require a cross-compiler that you can obtain by cloning this repository.

You can specify the cross-compiler to the command using the --toolchain argument, as follows. From your Dart checkout, to build just the VM:

./tools/ -m release -a arm \
  --toolchain=/path/to/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf \

You'll find the build products under out/ReleaseXARM/. You can optionally strip the dart binary to make it smaller:

/path/to/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-strip \

Run on Hardware

To run Dart programs on the Pi, we'll create a dart-sdk:

./tools/ -m release -a arm \
  --toolchain=/path/to/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf \

Then, we'll upload this sdk to the device:

scp -r out/ReleaseXARM/dart-sdk pi@[raspberry pi ip address]:./dart-sdk

Now, we're all set. Add dart-sdk/bin to your path and go to town!

Run on an Emulator

  • Download a Raspbian image.
  • Follow the instructions here to run Raspberry Pi in qemu.
  • When you come to the step "First (proper) boot", append the flag "-redir tcp:2222::22" so that we can scp files to the guest OS.
  • Follow instructions as above, replacing the IP address of the Raspberry Pi device with You'll also need to specify the port 2222 with ssh (-p 2222) and scp (-P 2222).

Debian Package

If your Raspberry Pi is running a Debian Wheezy-based Raspbian, it's also possible to create a Debian package for the Dart SDK. First, create a tarball:


Then, use the script, again specifying the cross-compiler:

$ ./tools/ -a armhf \
  -t /path/to/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf

Transfer to the Pi, and install as usual.


This process is experimental, but please feel free to file an Issue with our tracker if you run into any problems.