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

ARMv7 support #3

Closed
alanhoff opened this issue Dec 23, 2017 · 5 comments
Closed

ARMv7 support #3

alanhoff opened this issue Dec 23, 2017 · 5 comments

Comments

@alanhoff
Copy link

alanhoff commented Dec 23, 2017

Hello there, I'm trying to compile may but it looks like generator doesn't likes my Raspberry Pi v2.

I used this command to try to build it:

git clone https://github.com/Xudong-Huang/may
cd may && cargo run --example echo --release

This is the error log:

error[E0432]: unresolved import `self::asm`
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/detail/mod.rs:33:15
   |
33 | pub use self::asm::{Registers, swap_registers, initialize_call_frame, prefetch};
   |               ^^^ Could not find `asm` in `self`

error[E0433]: failed to resolve. Use of undeclared type or module `Registers`
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:15:28
   |
15 |         RegContext { regs: Registers::new() }
   |                            ^^^^^^^^^ Use of undeclared type or module `Registers`

error[E0433]: failed to resolve. Use of undeclared type or module `Registers`
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:63:23
   |
63 |         let mut cur = Registers::new();
   |                       ^^^^^^^^^ Use of undeclared type or module `Registers`

error[E0412]: cannot find type `Registers` in this scope
 --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:7:11
  |
7 |     regs: Registers,
  |           ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `initialize_call_frame` in this scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:36:9
   |
36 |         initialize_call_frame(&mut self.regs, init, arg, start, stack);
   |         ^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `Registers` in this scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:47:28
   |
47 |         let out_regs: &mut Registers = match *out_context {
   |                            ^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `Registers` in this scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:50:23
   |
50 |         let in_regs: &Registers = match *in_context {
   |                       ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `swap_registers` in this scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:56:18
   |
56 |         unsafe { swap_registers(out_regs, in_regs) }
   |                  ^^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `Registers` in this scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:64:20
   |
64 |         let regs: &Registers = &to_context.regs;
   |                    ^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `swap_registers` in this scope
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/generator-0.6.1/src/reg_context.rs:66:18
   |
66 |         unsafe { swap_registers(&mut cur, regs) }
   |                  ^^^^^^^^^^^^^^ not found in this scope
error: aborting due to 10 previous errors

error: Could not compile `generator`.
warning: build failed, waiting for other jobs to finish...

This is my /proc/cpu/info

processor       : 0
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 1
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 2
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

processor       : 3
model name      : ARMv7 Processor rev 5 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc07
CPU revision    : 5

Hardware        : BCM2835
Revision        : a21041
Serial          : 0000000095c87563

Kernel, distro, toolchain and Rust info:

root@rust:~/may# lsb_release -a && uname -a && cargo --version && rustc --version && rustup toolchain list
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.3 (stretch)
Release:        9.3
Codename:       stretch
Linux rust 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux
cargo 0.25.0-nightly (930f9d949 2017-12-05)
rustc 1.24.0-nightly (250b49205 2017-12-21)
nightly-armv7-unknown-linux-gnueabihf (default)
@Xudong-Huang
Copy link
Owner

thanks for reporting.
currently this project only supports x64_86 platforms. I don't have ARM based platforms for testing. I hope somebody could help to contribute on other platforms. 😄

@alanhoff
Copy link
Author

I would gladly help you if I didn't lack ASM skills :-(

Even if you don't have an ARM device you can still cross compile and execute/test using qemu:

$ rustc \
    --target=arm-unknown-linux-gnueabihf \
    -C linker=arm-linux-gnueabihf-gcc \
    hello.rs

Then try to run it:

qemu-arm -L /usr/arm-linux-gnueabihf/ ./hello

@Xudong-Huang
Copy link
Owner

the libfringe branch should be an easier porting for ARM, we can just reuse the asm code from libfringe.

ref #4

@crabdancing
Copy link

crabdancing commented Feb 10, 2023

If it helps, I can confirm as of 2023-02 that this library is compiling & working on aarch64, with all tests passing.

@Xudong-Huang
Copy link
Owner

Now armv7 linux is supported. Thanks you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants