A basic proof of concept getting Rust code to run on the Steam Link.
Tested on Rust 1.22 nightly. Requires rustc nightly and Xargo.
Haven't tried interfacing with OpenGL ES/SDL/Qt yet.
- Clone both this repo and steamlink-sdk
- If #109 isn't merged yet, go into
$steamlink-sdk/rootfs/lib
and runln -s libgcc_s.so.1 libgcc_s.so
. source $steamlink-sdk/setenv.sh
to setup the Steam Link SDK environment variablessource ./fix-setenv.sh
to fix the$CC
environment variable, needed for things to compile correctly.- Run
./gen-target.sh
to generate the target file. The generated file will have a path to the Steam Link SDK hardcoded in it. - Run
xargo build --target armv7a-cros-linux-gnueabi
to build - Your binary will show up in
target/armv7a-cros-linux-gnueabi/debug/
.
$ rustc -V
rustc 1.22.0-nightly (8493813cd 2017-10-22)
$ xargo build --target armv7a-cros-linux-gnueabi
Compiling steamlink-sdk-rs-maybe v0.1.0 (file:///home/zekesonxx/bullshit/steamlink-sdk-rs-maybe)
Finished dev [unoptimized + debuginfo] target(s) in 0.44 secs
$ scp target/armv7a-cros-linux-gnueabi/debug/steamlink-sdk-rs-maybe steamlink:
steamlink-sdk-rs-maybe 100% 2258KB 2.2MB/s 00:01
$ ssh steamlink
/home/steam
# ./steamlink-sdk-rs-maybe
Hello World!
- Valve somehow thinks it's okay to put flags in
$CC
(this is whatfix-setenv.sh
fixes) - The LLVM triple is specified in the target file as
armv7a-cros-linux-gnueabihf
rather than-gnueabi
since it is hard-float, and this makes LLVM compile things properly. panic = "abort"
only for right now. Not sure how to get unwrap working yet.
Public domain / CC0.