]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arm: add Rust target.json
authorSven Van Asbroeck <thesven73@gmail.com>
Tue, 13 Apr 2021 14:19:27 +0000 (10:19 -0400)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 27 Apr 2021 03:06:13 +0000 (05:06 +0200)
This is simply based on output from:
 $ rustc +nightly -Z unstable-options \
     --target=arm-unknown-linux-gnueabi \
     --print target-spec-json

Changes made:
- removed "unsupported-abis"
  (does not build)
- added   "function-sections": false
  (all kernel functions should go in the .text section)
- added   "relocation-model": "static"
  (kernel does not support .data.rel.ro sections)

Note that the vanilla `arm-unknown-linux-gnueabi` triple lets
rustc generate the armv6 instruction set.

Signed-off-by: Sven Van Asbroeck <thesven73@gmail.com>
[normalized title]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
arch/arm/rust/target.json [new file with mode: 0644]

diff --git a/arch/arm/rust/target.json b/arch/arm/rust/target.json
new file mode 100644 (file)
index 0000000..37710eb
--- /dev/null
@@ -0,0 +1,28 @@
+{
+  "arch": "arm",
+  "crt-static-respected": true,
+  "data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64",
+  "dynamic-linking": true,
+  "env": "gnu",
+  "executables": true,
+  "features": "+strict-align,+v6",
+  "function-sections": false,
+  "has-elf-tls": true,
+  "has-rpath": true,
+  "is-builtin": true,
+  "linker-is-gnu": true,
+  "llvm-target": "arm-unknown-linux-gnueabi",
+  "max-atomic-width": 64,
+  "os": "linux",
+  "position-independent-executables": true,
+  "pre-link-args": {
+    "gcc": [
+      "-Wl,--as-needed",
+      "-Wl,-z,noexecstack"
+    ]
+  },
+  "relocation-model": "static",
+  "target-family": "unix",
+  "target-mcount": "\u0001__gnu_mcount_nc",
+  "target-pointer-width": "32"
+}