Giter Club home page Giter Club logo

Comments (4)

rockboynton avatar rockboynton commented on July 23, 2024 2

Adding quotes around the value seemed to fix the issue

[env]
AVR_CPU_FREQUENCY_HZ = "16000000"

from blink.

chinoto avatar chinoto commented on July 23, 2024 1

Same problem, same version. If I comment it out, I get an error compiling.

❯ cargo build
   Compiling core v0.0.0 (/home/damian/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
warning: target json file contains unused fields: no-compiler-rt

   Compiling rustc-std-workspace-core v1.99.0 (/home/damian/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
error: ran out of registers during register allocation

   Compiling compiler_builtins v0.1.73
warning: `rustc-std-workspace-core` (lib) generated 1 warning (1 duplicate)
warning: `core` (lib) generated 1 warning
error: could not compile `core` due to previous error; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
warning: `compiler_builtins` (lib) generated 1 warning (1 duplicate)

core compiles if I use release mode (maybe that has always been required?), but then avr_delay complains that llvm_asm macro and feature doesn't exist, which sort of makes sense since there has been talk of deprecating it, though shouldn't it still exist for quite awhile?

from blink.

stappersg avatar stappersg commented on July 23, 2024

According https://doc.rust-lang.org/nightly/cargo/reference/config.html#env should it work.

Does it work for you? (So that I know it is just me)

from blink.

stappersg avatar stappersg commented on July 23, 2024

Thank you @chinoto, there are now these commits

Compiling with and without ``--release` makes indeed a difference:

stappers@myhost:~/src/rust/RustAVR/blink
$ cargo build
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling compiler_builtins v0.1.73
   Compiling syn v1.0.60
   Compiling core v0.0.0 (/home/stappers/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling json v0.12.4
   Compiling xml-rs v0.8.3
   Compiling lazy_static v1.4.0
   Compiling target-cpu-fetch v0.1.3
   Compiling xmltree v0.10.2
   Compiling target-cpu-macro v0.1.3
   Compiling avr-mcu v0.3.5
   Compiling quote v1.0.8
   Compiling ruduino v0.3.2
   Compiling const_env_impl--value v0.1.2
   Compiling const_env--value v0.1.2
   Compiling rustc-std-workspace-core v1.99.0 (/home/stappers/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
error: ran out of registers during register allocation

error: could not compile `core` due to previous error
warning: build failed, waiting for other jobs to finish...
stappers@myhost:~/src/rust/RustAVR/blink
$ cargo build --release
   Compiling proc-macro2 v1.0.24
   Compiling unicode-xid v0.2.1
   Compiling compiler_builtins v0.1.73
   Compiling syn v1.0.60
   Compiling core v0.0.0 (/home/stappers/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling json v0.12.4
   Compiling xml-rs v0.8.3
   Compiling lazy_static v1.4.0
   Compiling target-cpu-fetch v0.1.3
   Compiling xmltree v0.10.2
   Compiling target-cpu-macro v0.1.3
   Compiling avr-mcu v0.3.5
   Compiling quote v1.0.8
   Compiling ruduino v0.3.2
   Compiling const_env_impl--value v0.1.2
   Compiling const_env--value v0.1.2
   Compiling rustc-std-workspace-core v1.99.0 (/home/stappers/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling avr-config v1.0.0
   Compiling avr-std-stub v1.0.2
   Compiling avr-config v2.0.1
   Compiling avr_delay v0.3.1
error: cannot find macro `llvm_asm` in this scope
  --> /home/stappers/.cargo/registry/src/github.com-1ecc6299db9ec823/avr_delay-0.3.1/src/lib.rs:34:17
   |
34 |         unsafe {llvm_asm!("1: sbiw $0,1
   |                 ^^^^^^^^

error: cannot find macro `llvm_asm` in this scope
  --> /home/stappers/.cargo/registry/src/github.com-1ecc6299db9ec823/avr_delay-0.3.1/src/lib.rs:41:13
   |
41 |     unsafe {llvm_asm!("1: sbiw $0,1
   |             ^^^^^^^^

error[E0635]: unknown feature `llvm_asm`
 --> /home/stappers/.cargo/registry/src/github.com-1ecc6299db9ec823/avr_delay-0.3.1/src/lib.rs:1:12
  |
1 | #![feature(llvm_asm)]
  |            ^^^^^^^^

For more information about this error, try `rustc --explain E0635`.
error: could not compile `avr_delay` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
stappers@myhost:~/src/rust/RustAVR/blink
$

This issue is now left open as reminder to revert commit 6276e6a.

Work can continue when avr-rust/delay#21 and avr-rust/delay#19 have been solved. (yes, help is appricated)

from blink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.