rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.22k stars 12.57k forks source link

Can not run on ASUS Router with Merlin #105478

Closed qiaolb closed 1 year ago

qiaolb commented 2 years ago

I install rust compiler on my ASUS Router with Merlin. And the information:

package:  rust-1.57.0-armv7-unknown-linux-gnueabihf.tar.gz
rustc version: 1.57.0

uname: Linux RT-AC66U_B1-5838 2.6.36.4brcmarm rust-lang/rust-forge#1 SMP PREEMPT Sat Aug 7 08:32:18 UTC 2021 armv7l GNU/Linux
Router: RT-AC66U_B1
OS: Merlin 386.3_2

Error:

admin@RT-AC66U_B1-5838:/tmp/opt# rustc
-sh: rustc: not found
# readelf -a /opt/bin/rustc | grep interpreter
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]

Because root path can not write, ld-linux-armhf.so.3 is installed in /opt/lib.

# patchelf --set-interpreter /opt/lib/ld-linux.so.3 /opt/bin/rustc
# readelf -a /opt/bin/rustc | grep interpreter
      [Requesting program interpreter: /opt/lib/ld-linux.so.3]
# rustc
rustc: error while loading shared libraries: /tmp/opt/bin/../lib/librustc_driver-56e6e64e3bf57c2c.so: internal error
bjorn3 commented 2 years ago

Then you will have to use patchelf to change the interpreter in the rustc executable to the right path.

qiaolb commented 2 years ago

@bjorn3 Thanks.

I check:

# ls -l /opt/lib/ld-linux.so.3
lrwxrwxrwx    1 admin    root            10 Jan  3 10:13 /opt/lib/ld-linux.so.3 -> ld-2.23.so
# ls -l /tmp/opt/bin/../lib/librustc_driver-56e6e64e3bf57c2c.so
-rw-r--r--    1 admin    root     169961416 Jan  5 08:37 /tmp/opt/bin/../lib/librustc_driver-56e6e64e3bf57c2c.so

These libraries exist. How do I check?

bjorn3 commented 2 years ago

Is Merlin glibc or musl based? If it is musl based you will have to use rust-1.57.0-armv7-unknown-linux-musleabihf.tar.gz.

qiaolb commented 2 years ago

Merlin is uClibc. Maybe I just use source code.

bjorn3 commented 2 years ago

Probably. According to https://doc.rust-lang.org/nightly/rustc/platform-support.html armv7-unknown-linux-uclibceabihf is a tier 3 target. It says that it is unknown if building rustc for it is supported.

Dylan-DPC commented 1 year ago

Closing this to clean up the issue tracker. This complies with the target policy. If you need further help you can check the forums or other spaces for rust discussions.