Skip to content

Commit 3c943d0

Browse files
authored
Rollup merge of #94777 - lancethepants:armv7-unknown-linux-uclibceabi, r=Mark-Simulacrum
Update armv7-unknown-linux-uclibceabi platform support page. A few edits and fixes to the support page for the armv7-unknown-linux-uclibceabi target.
2 parents 2f9bc56 + 9c5616a commit 3c943d0

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

src/doc/rustc/src/platform-support/armv7-unknown-linux-uclibceabi.md

+21-11
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ target = ["armv7-unknown-linux-uclibceabi"]
3636
cc = "/path/to/arm-unknown-linux-uclibcgnueabi-gcc"
3737
cxx = "/path/to/arm-unknown-linux-uclibcgnueabi-g++"
3838
ar = "path/to/arm-unknown-linux-uclibcgnueabi-ar"
39-
ranlib = "path/to/arm-unknown-linux-uclibcgnueabi-"
40-
linker = "/path/to/arm-unknown-linux-uclibcgnueabi-"
39+
ranlib = "path/to/arm-unknown-linux-uclibcgnueabi-ranlib"
40+
linker = "/path/to/arm-unknown-linux-uclibcgnueabi-gcc"
4141
```
4242

4343
## Building Rust programs
@@ -75,27 +75,37 @@ To cross compile, you'll need to:
7575
```
7676
* Build with:
7777
```text
78-
CC=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-gcc \
79-
CXX=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-g++ \
80-
AR=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-ar \
78+
CC_armv7_unknown_linux_uclibceabi=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-gcc \
79+
CXX_armv7_unknown_linux_uclibceabi=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-g++ \
80+
AR_armv7_unknown_linux_uclibceabi=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-ar \
81+
CFLAGS_armv7_unknown_linux_uclibceabi="-march=armv7-a -mtune=cortex-a9" \
82+
CXXFLAGS_armv7_unknown_linux_uclibceabi="-march=armv7-a -mtune=cortex-a9" \
8183
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABI_LINKER=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-gcc \
8284
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABI_RUSTFLAGS='-Clink-arg=-s -Clink-arg=-Wl,--dynamic-linker=/mmc/lib/ld-uClibc.so.1 -Clink-arg=-Wl,-rpath,/mmc/lib' \
83-
cargo +stage2 build --target armv7-unknown-linux-uclibceabi --release
85+
cargo +stage2 \
86+
build \
87+
--target armv7-unknown-linux-uclibceabi \
88+
--release
8489
```
8590
* Copy the binary to your target device and run.
8691
87-
We specify `CC`, `CXX`, and `AR` because somtimes a project or a subproject requires the use of your `'C'` cross toolchain. Since Tomatoware has a modified sysroot we also pass via RUSTFLAGS the location of the dynamic-linker and rpath.
92+
We specify `CC`, `CXX`, `AR`, `CFLAGS`, and `CXXFLAGS` environment variables because somtimes a project or a subproject requires the use of your `'C'` cross toolchain. Since Tomatoware has a modified sysroot we also pass via RUSTFLAGS the location of the dynamic-linker and rpath.
8893
8994
### Test with QEMU
9095
9196
To test a cross-compiled binary on your build system follow the instructions for `Cross Compilation`, install `qemu-arm-static`, and run with the following.
9297
```text
93-
CC=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-gcc \
94-
CXX=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-g++ \
95-
AR=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-ar \
98+
CC_armv7_unknown_linux_uclibceabi=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-gcc \
99+
CXX_armv7_unknown_linux_uclibceabi=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-g++ \
100+
AR_armv7_unknown_linux_uclibceabi=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-ar \
101+
CFLAGS_armv7_unknown_linux_uclibceabi="-march=armv7-a -mtune=cortex-a9" \
102+
CXXFLAGS_armv7_unknown_linux_uclibceabi="-march=armv7-a -mtune=cortex-a9" \
96103
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABI_LINKER=/opt/tomatoware/arm-soft-mmc/bin/arm-linux-gcc \
97104
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_UCLIBCEABI_RUNNER="qemu-arm-static -L /opt/tomatoware/arm-soft-mmc/arm-tomatoware-linux-uclibcgnueabi/sysroot/" \
98-
cargo +stage2 run --target armv7-unknown-linux-uclibceabi --release
105+
cargo +stage2 \
106+
run \
107+
--target armv7-unknown-linux-uclibceabi \
108+
--release
99109
```
100110
### Run in a chroot
101111

0 commit comments

Comments
 (0)