Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
from setuptools import setup
# from setuptools.extension import Extension
import sys
from glob import glob
from Cython.Build import cythonize
import Cython.Distutils
@piec
piec / setup.py
Created September 23, 2016 11:45
#!/usr/bin/env python3
from setuptools import setup
import sys
try:
from Cython.Build import cythonize
except ImportError:
print('Requires cython: pip install cython', file=sys.stderr)
sys.exit(1)
@piec
piec / build_testcase.py
Created January 6, 2016 09:41
lcdfilter test
#!/usr/bin/env python2
#
# This script will generate a fontconfig file that you should link from your ~/.fonts.conf, using:
#
# <include ignore_missing="yes">/path_to_this_directory/fonts.conf</include>
#
import os, os.path
PANGO_VIEW_PATH = "/usr/bin/"
A [ XXX ]
A [X X]
A [X X]
A [XXXXX]
A [X X]
A [X X]
A [X X]
A [ ]
B [XXXX ]
B [X X]
// X XX X X
// X X
// XX X X XXXX XXX XXX X XX XXX XXXX XXX X XXX
// X X X X X X X X X X XX X X X X X X
// X X X X X X XXXXX X X XXXX X X X XXXX
// X X X X X X X X X X X X X X X X
// X X X X X XXXX XXX X XXXX X X X XXXX
package minecraftia
@piec
piec / gitlab.log
Created September 8, 2015 10:16
gitlab failing to start
[2015-09-08T09:52:46+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /opt/gitlab/embedded
One version per cookbook
[2015-09-08T09:52:46+00:00] INFO: Forking chef instance to converge...
[2015-09-08T09:52:46+00:00] INFO: *** Chef 12.4.0.rc.2 ***
[2015-09-08T09:52:46+00:00] INFO: Chef-client pid: 19
[2015-09-08T09:52:47+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/a5948ad0938d
[2015-09-08T09:52:47+00:00] INFO: Setting the run_list to ["recipe[gitlab]"] from CLI options
[2015-09-08T09:52:47+00:00] INFO: Run List is [recipe[gitlab]]
[2015-09-08T09:52:47+00:00] INFO: Run List expands to [gitlab]
@piec
piec / gpg2qrcodes.sh
Last active August 27, 2015 08:41 — forked from joostrijneveld/gpg2qrcodes.sh
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
~/work/dev/cargo-git/cargo-cross % which arm-unknown-linux-gnueabi-gcc
/home/pierre/work/dev/gcc-linaro-arm-linux-gnueabi-2012.04-20120426_linux/bin/arm-unknown-linux-gnueabi-gcc
~/work/dev/cargo-git/cargo-cross % which rustc
/home/pierre/work/dev/rust-arm/prefix3/bin/rustc
~/work/dev/cargo-git/cargo-cross % echo $LD_LIBRARY_PATH
/home/pierre/work/dev/rust-arm/prefix3/lib:
~/work/dev/cargo-git/cargo-cross % rustc --version
@piec
piec / cargo build --verbose --target=arm-unknown-linux-gnueabi
Last active September 20, 2017 20:29
cargo build --verbose --target=arm-unknown-linux-gnueabi
~/work/dev/rust-arm/prefix3/bin/hallo % cargo build --verbose --target=arm-unknown-linux-gnueabi
Compiling hallo v0.0.1 (file:///home/pierre/work/dev/rust-arm/prefix3/bin/hallo)
Running `rustc src/main.rs --crate-name hallo --crate-type bin -g --out-dir /home/pierre/work/dev/rust-arm/prefix3/bin/hallo/target/arm-unknown-linux-gnueabi --emit=dep-info,link --target arm-unknown-linux-gnueabi -L dependency=/home/pierre/work/dev/rust-arm/prefix3/bin/hallo/target/arm-unknown-linux-gnueabi -L dependency=/home/pierre/work/dev/rust-arm/prefix3/bin/hallo/target/arm-unknown-linux-gnueabi/deps`
error: linking with `cc` failed: exit code: 1
note: cc '-Wl,--as-needed' '-L' '/home/pierre/work/dev/rust-arm/prefix3/lib/rustlib/arm-unknown-linux-gnueabi/lib' '-o' '/home/pierre/work/dev/rust-arm/prefix3/bin/hallo/target/arm-unknown-linux-gnueabi/hallo' '/home/pierre/work/dev/rust-arm/prefix3/bin/hallo/target/arm-unknown-linux-gnueabi/hallo.o' '-Wl,--whole-archive' '-lmorestack' '-Wl,--no-whole-archive' '-Wl,--gc-section

I want to write Rust code on my computer (x86_64, Ubuntu 14.04) and produce arm executables. I found hints on the internet, but not a concise set of instructions on what to do. So I wrote them down exactly:

apt-get install g++-arm-linux-gnueabihf
git clone https://github.com/mozilla/rust.git
mkdir rust/build-cross
cd rust/build-cross
../configure --target=arm-unknown-linux-gnueabihf --prefix=$HOME/local/rust-cross
make -j8 && make install