Port-mips archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rust for mipsel / mips32




在2022年12月29日十二月 下午5:13,Havard Eidnes写道:
> Hi,
>
> I've finally managed to get rust working on mipsel.  The downside
> is that you need a cpu supporting the mips32 instruction set

Any specific instruction that is required?

It’s possible to trap and emulate missing instructions.

> variant to be able to run it.  As I wrote in the wip/rust commit
> message:
>
>     rust: fix our "mipsel" target so that it can work.
>    
>     Earlier failed attempts:
>      * cpu = "mips1", would have been more "portable" to older CPUs,
>        but llvm failed to generate code for this cpu in at least one
>        instance.  The "mips1" target in llvm is marked "highly experimental",
>        so this is perhaps not surprising.
mips1 requires load delay slot so…
Not a wise choice.

>      * cpu = "mips3", an earlier mistake.  Produces "of course" 64-bit
>        instructions, so gives "illegal instruction" on e.g. cobalt and
>        32-bit-only CPUs.  Despite this also being marked "highly experimental"
>        in llvm, this build completed.

-march=mips3 -mabi=32 ?


>    
>     So ... we give up some portability to the older CPUs, and generate
>     code for cpu = "mips32" with soft-float, and this produces a working
>     rustc / cargo combination, at least to the point that devel/cbindgen
>     can be built using a MIPSSIM kernel on qemu.
>    
>     A native build of rust has yet to be attempted, it will be difficult
>     with the 508MB max memory limit for the 32-bit mips port, so the
>     next best is to try in a o32 chroot on a mips64 kernel which can
>     now get more memory.
>
> To aid in testing, I've locally updated the rust-bin package,
> installed it on my MIPSSIM host, and done "pkg_tarup" on it.  The
> resulting binary package can be fetched from
>
>   
> ftp://ftp.netbsd.org/pub/NetBSD/misc/he/rust-bin-mipsel-mips32-9.3-1.66.0.tgz
> or
>   
> https://cdn.netbsd.org/pub/NetBSD/misc/he/rust-bin-mipsel-mips32-9.3-1.66.0.tgz
>
> You can "pkg_add" this file, and if you have a CPU supporting the
> mips32 instruction set and a kernel which does too, you can use
> it.
>
> Best regards,
>
> - Håvard

-- 
- Jiaxun


Home | Main Index | Thread Index | Old Index