Skip to content

Can't build Coap-Server Example: stdint.h: No such file or directory #1495

@SimonIT

Description

@SimonIT

Summary

I'm trying to run the coap-server example with the following command:

CONFIG_WIFI_NETWORK=XXX CONFIG_WIFI_PASSWORD=XXX laze build -b espressif-esp32-c6-devkitc-1 -DLOG=debug run

Relevant log output

warning: liboscore@0.2.4: In file included from c-src/include/oscore/contextpair.h:4,
warning: liboscore@0.2.4:                  from c-src/contextpair.c:1:
warning: liboscore@0.2.4: /usr/lib/gcc/riscv64-unknown-elf/10.2.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
warning: liboscore@0.2.4:     9 | # include_next <stdint.h>
warning: liboscore@0.2.4:       |                ^~~~~~~~~~
warning: liboscore@0.2.4: compilation terminated.
error: failed to run custom build command for `liboscore v0.2.4`

Caused by:
  process didn't exit successfully: `/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/release/build/liboscore-b87033db7a32c07b/build-script-build` (exit status: 1)
  --- stdout
  cargo:PLATFORMHEADERS=/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out/rust-built-headers
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_riscv32imac-unknown-none-elf
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_riscv32imac_unknown_none_elf
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS
  cargo:rerun-if-changed=oscore_all_headers.h
  cargo:rerun-if-changed=/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out/rust-built-headers/oscore_native/crypto_type.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=c-src/include/oscore/helpers.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdbool.h
  cargo:rerun-if-changed=/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out/rust-built-headers/oscore_native/crypto_type.h
  cargo:rerun-if-changed=c-src/include/oscore/message.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=c-src/include/oscore/helpers.h
  cargo:rerun-if-changed=c-src/include/oscore_native/message.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdbool.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out/rust-built-headers/oscore_native/msg_type.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=c-src/include/oscore/contextpair.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stddef.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdbool.h
  cargo:rerun-if-changed=c-src/include/oscore_native/crypto.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=c-src/include/oscore/helpers.h
  cargo:rerun-if-changed=/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out/rust-built-headers/oscore_native/crypto_type.h
  cargo:rerun-if-changed=c-src/include/oscore/helpers.h
  cargo:rerun-if-changed=c-src/include/oscore/contextpair.h
  cargo:rerun-if-changed=c-src/include/oscore/context_impl/primitive.h
  cargo:rerun-if-changed=c-src/include/oscore_native/crypto.h
  cargo:rerun-if-changed=c-src/include/oscore/helpers.h
  cargo:rerun-if-changed=c-src/include/oscore/protection.h
  cargo:rerun-if-changed=/usr/lib/llvm-14/lib/clang/14.0.0/include/stdint.h
  cargo:rerun-if-changed=c-src/include/oscore_native/message.h
  cargo:rerun-if-changed=c-src/include/oscore/message.h
  cargo:rerun-if-changed=c-src/include/oscore/helpers.h
  cargo:rerun-if-changed=c-src/include/oscore/contextpair.h
  OUT_DIR = Some(/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out)
  OPT_LEVEL = Some(s)
  TARGET = Some(riscv32imac-unknown-none-elf)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CC_riscv32imac-unknown-none-elf
  CC_riscv32imac-unknown-none-elf = None
  cargo:rerun-if-env-changed=CC_riscv32imac_unknown_none_elf
  CC_riscv32imac_unknown_none_elf = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = Some()
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  RUSTC_LINKER = None
  PATH = Some(/home/simon/.cargo/bin:/home/simon/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/mnt/data/flutter/bin:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(true)
  CARGO_CFG_TARGET_FEATURE = Some(a,c,m)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some()
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac_unknown_none_elf
  CFLAGS_riscv32imac_unknown_none_elf = None
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac-unknown-none-elf
  CFLAGS_riscv32imac-unknown-none-elf = None
  CARGO_ENCODED_RUSTFLAGS = Some(--cfgcontext="espressif-esp32-c6-devkitc-1"--cfgcontext="esp32-c6-wroom-1"--cfgcontext="esp32c6"--cfgcontext="esp"--cfgcontext="ariel-os"--cfgcontext="default"-Clink-arg=-Tlinkall.x-Cforce-frame-pointers--cfgcontext="riscv"-Clink-arg=-Tisr_stack.x-Clink-arg=-Tlinkme-region-alias.x-Clink-arg=-Tlinkme.x--cfgstable-Cembed-bitcode=yes-Clto=fat-Ccodegen-units=1-Clink-arg=-Tdefmt.x)
  OUT_DIR = Some(/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out)
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  TARGET = Some(riscv32imac-unknown-none-elf)
  CARGO_CFG_TARGET_FEATURE = Some(a,c,m)
  HOST = Some(x86_64-unknown-linux-gnu)
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = Some()
  cargo:rerun-if-env-changed=CC_SHELL_ESCAPED_FLAGS
  CC_SHELL_ESCAPED_FLAGS = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac_unknown_none_elf
  CFLAGS_riscv32imac_unknown_none_elf = None
  cargo:rerun-if-env-changed=CFLAGS_riscv32imac-unknown-none-elf
  CFLAGS_riscv32imac-unknown-none-elf = None
  cargo:warning=In file included from c-src/include/oscore/contextpair.h:4,
  cargo:warning=                 from c-src/contextpair.c:1:
  cargo:warning=/usr/lib/gcc/riscv64-unknown-elf/10.2.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
  cargo:warning=    9 | # include_next <stdint.h>
  cargo:warning=      |                ^~~~~~~~~~
  cargo:warning=compilation terminated.

  --- stderr


  error occurred in cc-rs: command did not execute successfully (status code exit status: 1): LC_ALL="C" "riscv64-unknown-elf-gcc" "-Os" "-ffunction-sections" "-fdata-sections" "-g" "-fno-omit-frame-pointer" "-march=rv32imac" "-mabi=ilp32" "-I" "c-src/include/" "-I" "." "-I" "/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out/rust-built-headers" "-fno-omit-frame-pointer" "-o" "/mnt/data/Software/Entwicklung/ariel-os/examples/coap-server/../../build/bin/espressif-esp32-c6-devkitc-1/cargo/riscv32imac-unknown-none-elf/release/build/liboscore-3df61e3695b2ff5b/out/a9e0ece707e167cc-contextpair.o" "-c" "c-src/contextpair.c"


warning: build failed, waiting for other jobs to finish...
laze: error: command ` OPENOCD_ARGS="" SCRIPTS=../../scripts CONFIG_BOARD=espressif-esp32-c6-devkitc-1 CARGO_BUILD_TARGET=riscv32imac-unknown-none-elf CARGO_TARGET_RISCV32IMAC_UNKNOWN_NONE_ELF_RUNNER="espflash flash --monitor --log-format defmt" CARGO_TARGET_RISCV32IMAC_UNKNOWN_NONE_ELF_RUSTFLAGS="--cfg context=\"espressif-esp32-c6-devkitc-1\" --cfg context=\"esp32-c6-wroom-1\" --cfg context=\"esp32c6\" --cfg context=\"esp\" --cfg context=\"ariel-os\" --cfg context=\"default\" -Clink-arg=-Tlinkall.x -C force-frame-pointers --cfg context=\"riscv\" -Clink-arg=-Tisr_stack.x -Clink-arg=-Tlinkme-region-alias.x -Clink-arg=-Tlinkme.x --cfg stable -Cembed-bitcode=yes -Clto=fat -Ccodegen-units=1 -Clink-arg=-Tdefmt.x" CARGO_TARGET_DIR=../../build/bin/espressif-esp32-c6-devkitc-1/cargo CONFIG_EXECUTOR_STACKSIZE=32768 CONFIG_ISR_STACKSIZE=32768 CC="" CFLAGS="" CONFIG_HEAPSIZE=73728 DEFMT_LOG=info,debug  cargo  --config ../.././ariel-os-cargo.toml run --profile=release --features=ariel-os/coap-server-config-demokeys,ariel-os/liboscore-provide-assert,ariel-os/alloc,ariel-os/wifi-esp,ariel-os/semihosting,ariel-os/single-core,ariel-os/executor-single-thread,ariel-os/esp-println,ariel-os/panic-printing,ariel-os/defmt,ariel-os/debug-console,ariel-os/hwrng,ariel-os/random,ariel-os/coap,ariel-os/coap-server $@`: task command had non-zero exit code

Hardware/ Setup

ESP32-C6-DEV-KIT-N8, latest main, I'm using Pop!_OS 22.04, if that's relevant

Possible Solution

I had the same issue with briansmith/ring#2703. There helped -ffreestanding -nostdlib (Not sure if both are necessary)

Would you like to work on fixing this bug?

Maybe

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions