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

[Draft] fix building on Zephyr 3.7.0 #53

Open
wants to merge 5 commits into
base: 3.6-support
Choose a base branch
from

Conversation

sprhawk
Copy link
Contributor

@sprhawk sprhawk commented Sep 10, 2024

Zephyr 3.7.0 is the latest LTS version, it should be supported for long term application development

Here is just a draft, some Kconfig need to be changed to new ones ( like CPLUSPLUS flag )

image

tylerwhall and others added 5 commits June 30, 2024 21:50
Zephyr 3.5 switches to picolibc by default and can use a binary from the
SDK or build from source. Clang, invoked by zephyr-bindgen from
zephyr-sys's build.rs, cannot find the SDK's picolibc include path,
resulting in this error:

> zephyr/include/zephyr/posix/time.h:55:12: fatal error: 'sys/timespec.h' file not found

This is because when using the SDK version, it picks up the include path
from a spec file.

    if(NOT CONFIG_PICOLIBC_USE_MODULE)
    zephyr_compile_options(--specs=picolibc.specs)

We don't pass zephyr_compile_options for bindgen because it contains
many GCC-specific options that fail under clang, and in this case the
spec file won't work with clang anyway.

Build from source so the include path is added in the normal way.
Add newly supported versions and remove intermediate 2.x versions to
lighten the build load.
@sprhawk
Copy link
Contributor Author

sprhawk commented Sep 11, 2024

A very weird situation:

When I manage zephyr-rust via west:

manifest:
  version: "1.2"
  remotes:
    - name: zephyrproject-rtos
      url-base: https://github.com/zephyrproject-rtos
    - name: iotpi
      url-base: git+ssh://git@github.com/iotpi

  defaults:
    remote: zephyrproject-rtos

  projects:
    - name: zephyr
      revision: v3.7.0
      import:
        name-allowlist:
          - cmsis
          - cmsis-dsp
          - mcuboot
          - picolibc
          - hal_stm32
    - name: zephyr-rust
      remote: iotpi
      revision: 3.7-support
      submodules: true

  self:
    path: rsmc

go inside zephyr-rust, execute:

west build -b qemu_cortex_m3 -p always samples/rust-app/

it failed as following:

  userspace: false
  /usr/lib/llvm-14/lib/clang/14.0.6/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found
  thread 'main' panicked at 'Unable to generate bindings: ClangDiagnostic("/usr/lib/llvm-14/lib/clang/14.0.6/include/inttypes.h:21:15: fatal error: 'inttypes.h' file not found\n")', src/main.rs:53:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

If I remove zephyr-rust from west.yml, and use git clone, then it pass build.

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

Successfully merging this pull request may close these issues.

2 participants