|
| 1 | +# armeb-unknown-linux-gnueabi |
| 2 | +**Tier: 3** |
| 3 | + |
| 4 | +Target for cross-compiling Linux user-mode applications targetting the ARM BE8 architecture. |
| 5 | + |
| 6 | +## Overview |
| 7 | +BE8 architecture retains the same little-endian ordered code-stream used by conventional little endian ARM systems, however the data accesses are in big-endian. BE8 is used primarily in high-performance networking applications where the ability to read packets in their native "Network Byte Order" is important (many network protocols transmit data in big-endian byte order for their wire formats). |
| 8 | + |
| 9 | +## History |
| 10 | +BE8 architecture is the default big-endian architecture for ARM since [ARMv6](https://developer.arm.com/documentation/101754/0616/armlink-Reference/armlink-Command-line-Options/--be8?lang=en). It's predecessor, used for ARMv4 and ARMv5 devices was [BE32](https://developer.arm.com/documentation/dui0474/j/linker-command-line-options/--be32). On ARMv6 architecture, endianness can be configured via [system registers](https://developer.arm.com/documentation/ddi0290/g/unaligned-and-mixed-endian-data-access-support/mixed-endian-access-support/interaction-between-the-bus-protocol-and-the-core-endianness). However, BE32 was withdrawn for [ARMv7](https://developer.arm.com/documentation/ddi0406/cb/Appendixes/Deprecated-and-Obsolete-Features/Obsolete-features/Support-for-BE-32-endianness-model) onwards. |
| 11 | + |
| 12 | +## Target Maintainers |
| 13 | +* [@WorksButNotTested](https://github.com/WorksButNotTested) |
| 14 | + |
| 15 | +## Requirements |
| 16 | +The target is cross-compiled. This target supports `std` in the normal way (indeed only nominal changes are required from the standard ARM configuration). |
| 17 | + |
| 18 | +## Target definition |
| 19 | +The target definition can be seen [here](https://github.com/rust-lang/rust/tree/master/compiler/rustc_target/src/spec/armeb_unknown_linux_gnueabi.rs). In particular, it should be noted that the `features` specify that this target is built for the ARMv8 core. Though this can likely be modified as required. |
| 20 | + |
| 21 | +## Building the target |
| 22 | +Because it is Tier 3, rust does not yet ship pre-compiled artifacts for this target. |
| 23 | + |
| 24 | +Therefore, you can build Rust with support for the target by adding it to the target list in config.toml, a sample configuration is shown below. It is expected that the user already have a working GNU compiler toolchain and update the paths accordingly. |
| 25 | + |
| 26 | +```toml |
| 27 | +[llvm] |
| 28 | +download-ci-llvm = false |
| 29 | +skip-rebuild = true |
| 30 | +optimize = true |
| 31 | +ninja = true |
| 32 | +targets = "ARM;X86" |
| 33 | +clang = false |
| 34 | + |
| 35 | +[build] |
| 36 | +target = ["x86_64-unknown-linux-gnu", "armeb-unknown-linux-gnueabi"] |
| 37 | +docs = false |
| 38 | +docs-minification = false |
| 39 | +compiler-docs = false |
| 40 | +[install] |
| 41 | +prefix = "/home/user/x-tools/rust/" |
| 42 | + |
| 43 | +[rust] |
| 44 | +debug-logging=true |
| 45 | +backtrace = true |
| 46 | +incremental = true |
| 47 | + |
| 48 | +[target.x86_64-unknown-linux-gnu] |
| 49 | + |
| 50 | +[dist] |
| 51 | + |
| 52 | +[target.armeb-unknown-linux-gnueabi] |
| 53 | +cc = "/home/user/x-tools/armeb-unknown-linux-gnueabi/bin/armeb-unknown-linux-gnueabi-gcc" |
| 54 | +cxx = "/home/user/x-tools/armeb-unknown-linux-gnueabi/bin/armeb-unknown-linux-gnueabi-g++" |
| 55 | +ar = "/home/user/x-tools/armeb-unknown-linux-gnueabi/bin/armeb-unknown-linux-gnueabi-ar" |
| 56 | +ranlib = "/home/user/x-tools/armeb-unknown-linux-gnueabi/bin/armeb-unknown-linux-gnueabi-ranlib" |
| 57 | +linker = "/home/user/x-tools/armeb-unknown-linux-gnueabi/bin/armeb-unknown-linux-gnueabi-gcc" |
| 58 | +llvm-config = "/home/user/x-tools/clang/bin/llvm-config" |
| 59 | +llvm-filecheck = "/home/user/x-tools/clang/bin/FileCheck" |
| 60 | +``` |
| 61 | + |
| 62 | +## Building Rust programs |
| 63 | + |
| 64 | +The following `.cargo/config` is needed inside any project directory to build for the BE8 target: |
| 65 | + |
| 66 | +```toml |
| 67 | +[build] |
| 68 | +target = "armeb-unknown-linux-gnueabi" |
| 69 | + |
| 70 | +[target.armeb-unknown-linux-gnueabi] |
| 71 | +linker = "armeb-unknown-linux-gnueabi-gcc" |
| 72 | +``` |
| 73 | + |
| 74 | +Note that it is expected that the user has a suitable linker from the GNU toolchain. |
0 commit comments