Skip to content

[atmega328] build.rs failed with "libclang error" #5

@jsen-

Description

@jsen-

I'm using rust nightly from 2020-09-02

$ rustup default nightly-2020-09-02-x86_64-unknown-linux-gnu
$ rustc -Z unstable-options --print target-spec-json --target avr-unknown-gnu-atmega328 > atmega328.json
$ LLVM_CONFIG_PATH=/usr/lib/llvm-8/bin/llvm-config cargo build --target atmega328.json
   Compiling avr-libc v0.2.0 (/home/max/projects/rust-arduino-blink/deps/libc)
error: failed to run custom build command for `avr-libc v0.2.0 (/home/max/projects/rust-arduino-blink/deps/libc)`

Caused by:
  process didn't exit successfully: `/home/max/projects/rust-arduino-blink/deps/libc/target/debug/build/avr-libc-78b126eedfe0d9fc/build-script-build` (exit code: 101)
  --- stdout
  loading pack '/home/max/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/avr-mcu-0.3.4/packs/atmega/ATmega328.atdf'

  --- stderr
  thread 'main' panicked at 'libclang error; possible causes include:
  - Invalid flag syntax
  - Unrecognized flags
  - Invalid flag arguments
  - File I/O errors
  - Host vs. target architecture mismatch
  If you encounter an error missing from this list, please file an issue or a PR!', /home/max/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.0/src/ir/context.rs:573:15
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/130359cb05246fcacdde61baa2613419ef6570c7/library/std/src/panicking.rs:483
     1: core::panicking::panic_fmt
               at /rustc/130359cb05246fcacdde61baa2613419ef6570c7/library/core/src/panicking.rs:85
     2: core::option::expect_failed
               at /rustc/130359cb05246fcacdde61baa2613419ef6570c7/library/core/src/option.rs:1213
     3: core::option::Option<T>::expect
               at /home/max/.local/share/rustup/toolchains/nightly-2020-09-02-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:333
     4: bindgen::ir::context::BindgenContext::new
               at /home/max/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.0/src/ir/context.rs:567
     5: bindgen::Bindings::generate
               at /home/max/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.0/src/lib.rs:2109
     6: bindgen::Builder::generate
               at /home/max/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.0/src/lib.rs:1422
     7: build_script_build::generate_bindings
               at ./build.rs:190
     8: build_script_build::main
               at ./build.rs:61
     9: core::ops::function::FnOnce::call_once
               at /home/max/.local/share/rustup/toolchains/nightly-2020-09-02-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions