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

Can't use inline assembly #64

Closed
NathanMcMillan54 opened this issue Aug 3, 2021 · 8 comments
Closed

Can't use inline assembly #64

NathanMcMillan54 opened this issue Aug 3, 2021 · 8 comments

Comments

@NathanMcMillan54
Copy link

When I try to compile anything that uses an assembly macro on any xtensa target, I get this error:

error[E0472]: inline assembly is unsupported on this target

This is my .cargo/config.toml:

[target.xtensa-esp32-none-elf]
rustflags = [
    "-C", "link-arg=-nostartfiles",
]

And I compiled with:

cargo xbuild --target xtensa-esp32-none-elf

Did I compile the compiler wrong? Or did I compile the project wrong?

@MabezDev
Copy link
Member

MabezDev commented Aug 3, 2021

Typed Inline asm has not been ported to the xtensa arch yet, see #32. You can however use the llvm_asm! macro.

@NathanMcMillan54
Copy link
Author

But when I try to compile xtensa-lx-rt I get this error because of the global_asm! macro. How does that get compiled?

@MabezDev
Copy link
Member

MabezDev commented Aug 4, 2021

I see, it seems global_asm! has been ported to the asm! format, without providing a global_llvm_asm! alternative. I'll see what I can do to work around this.

@MabezDev
Copy link
Member

Hi @NathanMcMillan54, sorry about the trouble - I have added support for the new asm! format and merged it into the esp branch. New releases of xtensa-lx, xtensa-lx-rt have been released too with support for this assembly syntax.

Please report back if you run into any issues - hope this helps :)

@NathanMcMillan54
Copy link
Author

Oh thanks! I'll see if it worked

@NathanMcMillan54
Copy link
Author

This isn't related to this issue, when I recompiled Xtensa Rust and try to compile anything I get this error:

error: linking with `xtensa-esp32-elf-gcc` failed: exit status: 1
  |
  = note: "xtensa-esp32-elf-gcc" .... a ton of file paths....

    ....

  = note: xtensa-esp32-elf-gcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
          compilation terminated.

Is liblto_plugin.so a file I need to install?

@MabezDev
Copy link
Member

Seems like you have an old version on xtensa gcc? Try with the latest from here: https://github.com/espressif/crosstool-NG/releases.

@NathanMcMillan54
Copy link
Author

Thanks! I'll try that

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

No branches or pull requests

2 participants