Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more OpenWRT devices #4

Closed
japaric opened this issue Sep 29, 2016 · 5 comments
Closed

Support more OpenWRT devices #4

japaric opened this issue Sep 29, 2016 · 5 comments
Labels
feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 openwrt upstream

Comments

@japaric
Copy link
Member

japaric commented Sep 29, 2016

Currently, the Rust compiler supports MIPS OpenWRT devices via these targets:

  • mips(el)-unknown-linux-uclibc. OpenWRT 15.05. There is no binary release of std for this
    target though. Having binary releases for this target is at least blocked by add support for mips-uclibc targets rust-lang/libc#361
  • mips(el)-unknown-linux-musl. OpenWRT Trunk. As a Tier 3 (?) target.

OpenWRT not only supports MIPS devices but also ARM devices and other architectures. We should
investigate what's required to support those other targets.

For OpenWRT 15.05 ARM devices, we'll probably need an arm-unknown-linux-uclibc target.

OpenWRT Trunk for ARM seems more tricky. In theory, the arm-unknown-linux-musleabi target is the
right target but that produces statically linked binaries but users of these devices will probably
want dynamically linked binaries to keep binary sizes small. Hence something like
rust-lang/rfcs#1721 to support these devices.

@japaric japaric mentioned this issue Oct 7, 2016
@jamesmunns jamesmunns added the feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 label Feb 3, 2019
@jamesmunns
Copy link
Member

We have not made any particular progress on this issue in 2 or so years, so I would like to propose that we close this issue. Marking this for a cleanup sweep. If we would like this to stay open, please provide an update to what this issue should be focused on.

@jamesmunns
Copy link
Member

CC @aep, who might have some insight of what is and isn't possible/reasonable in this space. I'm interested in keeping this issue open if we think it is still valuable, or if there is progress to be made here!

Also CC @cr1901, who commented about this on IRC.

@cr1901
Copy link

cr1901 commented Feb 4, 2019

@jamesmunns To clarify, I made a passing comment on IRC.

I'm interested in this topic to the extent that it's another target to play w/, and there does still seem to be binary size issues (some OpenWRT distros fit on a 4MB flash!) if you're using anything beyond libcore.

But I don't have any OpenWRT hardware and I don't have the bandwidth to contribute; I simply appreciate someone trying to use Rust w/ MIPS :).

@aep
Copy link

aep commented Feb 4, 2019

uclibc is pretty dead. I'd not recommend adding any targets with it. openwrt will use musl where possible and it's definitely the superior libc.

arm-unknown-linux-musleabi is broken and will stay broken. rustup comes with a libc, including a crt, but they're shipping the wrong crt for the link mode so it just crashes.

rust-lang/rust#54294

the workaround is to have a linker wrapper that strips the incorrect linker flags and lets it use its own defaults.

mips(el)-unknown-linux-musl works fine with the usual caveats that most of libstd is never tested on mips/el so for example backtrace doesn't compile because they use GNU specific extensions in a unix ifdef, so you need to avoid any library that uses backtrace, including failure (which would be easy to fix, but meh rust-lang-deprecated/failure#246 )

openwrt on x86 will work fine with the default compiler. i don't see any need to do anything here.

(re @cr1901): we're have nearly thirty thousand devices out there with most of its userspace in rust. we replaced tokio with a reasonably sized alternative (i just happened to blog about that http://aep.github.io/rust-async-without-the-noise/), but libstd is an open problem. I'm hoping the embedded group will come up with something some day, since we have the same issue on bare metal :)

@jamesmunns
Copy link
Member

I am closing this issue, please feel free to open another issue if you would like this discussed further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 openwrt upstream
Projects
None yet
Development

No branches or pull requests

4 participants