summaryrefslogtreecommitdiff
path: root/docs/target.md
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-05-11 08:02:00 +0800
committerJohn Hodge <tpg@mutabah.net>2018-05-11 08:02:00 +0800
commit174c4f47160dba499c84986d15180fe4307d4adc (patch)
tree9d4f154d404efed09c54e27041eaaa9852773e3b /docs/target.md
parent3b8d8f1a392a2cb5cad1d57d08ced693a0d197d8 (diff)
parentba9b4c4da6b9117529370f402e1015bf1730ccb2 (diff)
downloadmrust-174c4f47160dba499c84986d15180fe4307d4adc.tar.gz
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'docs/target.md')
-rw-r--r--docs/target.md50
1 files changed, 50 insertions, 0 deletions
diff --git a/docs/target.md b/docs/target.md
new file mode 100644
index 00000000..6b5b088d
--- /dev/null
+++ b/docs/target.md
@@ -0,0 +1,50 @@
+
+Target Overrides
+================
+
+Mrustc supports a few targets out of the box (of varying levels of usablity), these are listed in
+`src/trans/target.cpp`. If the built-in targets aren't suitable, a custom target can be specified with the help of a
+custom target toml file.
+
+To specify a target when running `mrustc` (or `minicaro`), pass `--target <triple>` or `--target
+./path/to/target.toml` (the presence of a slash, backwards or forwards, is what determines if the target is treated as
+a custom target file.
+
+
+Custom target format
+--------------------
+
+Recreation of the `arm-linux-gnu` target
+```toml
+[target]
+family = "unix"
+os-name = "linux"
+env-name = "gnu"
+arch = "arm"
+
+[backend.c]
+variant = "gnu"
+target = "arm-linux-gnu"
+```
+
+Recreation of the `i586-windows-gnu` target (with architecture)
+```toml
+[target]
+family = "windows"
+os-name = "windows"
+env-name = "gnu"
+
+[backend.c]
+variant = "gnu"
+target = "mingw32"
+
+[arch]
+name = "x86"
+pointer-bits = 32
+is-big-endian = false
+has-atomic-u8 = true
+has-atomic-u16 = true
+has-atomic-u32 = true
+has-atomic-u64 = false
+has-atomic-ptr = true
+```