Environment
- rustc 1.68.0-nightly (bdb07a8ec 2022-12-11)
- rustup 1.25.1 (bb60b1e89 2022-07-12)
- cargo 1.68.0-nightly (70898e522 2022-12-05)
影響がありそうな箇所。
https://github.com/kaaatsu32329/accelduino-rs/blob/8cb85d3b7daabe105f4339f413210f7a9f536dc0/src/main.rs#L44-L47
コンパイラーオプション周りかもしれない。
出力
> cargo build
Compiling accelduino-rs v0.1.0 (C:\Users\user\Documents\accelduino-rs)
error: linking with `avr-gcc` failed: exit code: 1
|
= note: "avr-gcc" "-mmcu=atmega328p" "-Wl,--as-needed" "C:\\Users\\user\\AppData\\Local\\Temp\\rustcrgXaxG\\symbols.o" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps\\accelduino_rs-94636f02bf0d8abe.serde_json_core-1eead99fff5793d7.serde_json_core.177c91ea-cgu.0.rcgu.o.rcgu.o" "-Wl,--as-needed" "-L" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps" "-L" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\debug\\deps" "-L" "C:\\Users\\user\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\avr-atmega328p\\lib" "-Wl,-Bstatic" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps\\libcompiler_builtins-1aa59d2479cb0a07.rlib" "-Wl,-Bdynamic" "-lgcc" "-Wl,-znoexecstack" "-L" "C:\\Users\\user\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\avr-atmega328p\\lib" "-o" "C:\\Users\\user\\Documents\\accelduino-rs\\target\\avr-atmega328p\\debug\\deps\\accelduino_rs-94636f02bf0d8abe.elf" "-Wl,--gc-sections" "-no-pie"
= note: c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bc of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.data' is not within region `data'
c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.data' will not fit in region `text'
c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bd of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.bss' is not within region `data'
c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bc of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.data' is not within region `data'
c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: address 0x8034bd of C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\accelduino_rs-94636f02bf0d8abe.elf section `.bss' is not within region `data'
c:/avr8-gnu-toolchain-win32_x86_64/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: region `text' overflowed by 8096 bytes
C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.15.rcgu.o): In function `<f64 as compiler_builtins::float::Float>::normalize':
C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\float/mod.rs:164: undefined reference to `core::panicking::panic'
C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.3.rcgu.o): In function `compiler_builtins::float::mul::mul':
C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\float/mul.rs:(.text._ZN17compiler_builtins5float3mul8__muldf317h81f5d26047862690E+0x9aa): undefined reference to `core::panicking::panic'
C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.6.rcgu.o): In function `compiler_builtins::int::shift::Ashl::ashl':
C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\int/shift.rs:15: undefined reference to `core::panicking::panic'
C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.6.rcgu.o): In function `compiler_builtins::int::shift::Lshr::lshr':
C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\int/shift.rs:60: undefined reference to `core::panicking::panic'
C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.6.rcgu.o): In function `compiler_builtins::int::shift::Lshr::lshr':
C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\int/shift.rs:60: undefined reference to `core::panicking::panic'
C:\Users\user\Documents\accelduino-rs\target\avr-atmega328p\debug\deps\libcompiler_builtins-1aa59d2479cb0a07.rlib(compiler_builtins-1aa59d2479cb0a07.compiler_builtins.e959a4ad-cgu.8.rcgu.o):C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\compiler_builtins-0.1.85/src\float/conv.rs:27: more undefined references to `core::panicking::panic' follow
collect2.exe: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `accelduino-rs` due to previous error