Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Fails to compile on Ubuntu 18.04 #86

Closed
jabedude opened this issue Sep 21, 2020 · 3 comments
Closed

Fails to compile on Ubuntu 18.04 #86

jabedude opened this issue Sep 21, 2020 · 3 comments

Comments

@jabedude
Copy link

Hello, a clean git checkout is failing to build on my system. Steps to reproduce:

git clone https://github.com/redsift/redbpf.git
cd redbpf/
cargo build

Truncated error:

error: failed to run custom build command for `bpf-sys v1.1.2 (/home/josh/Projects/redbpf/bpf-sys)`

Caused by:
  process didn't exit successfully: `/home/josh/Projects/redbpf/target/debug/build/bpf-sys-d1bf8c504042c2a7/build-script-build` (exit code: 1)
  --- stdout
  cargo:rustc-link-lib=static=bpf
  TARGET = Some("x86_64-unknown-linux-gnu")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-unknown-linux-gnu")
  CC_x86_64-unknown-linux-gnu = None
  CC_x86_64_unknown_linux_gnu = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-unknown-linux-gnu = None
  CFLAGS_x86_64_unknown_linux_gnu = None
  HOST_CFLAGS = None
  CFLAGS = None
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "libbpf/include/uapi" "-I" "libbpf/include" "-I" "bcc" "-I" "libelf" "-I" "." "-Wall" "-Wextra" "-Wno-sign-compare" "-Wno-int-conversion" "-Wno-unused-parameter" "-Wno-unused-result" "-Wno-format-truncation" "-Wno-missing-field-initializers" "-include" "linux/stddef.h" "-o" "/home/josh/Projects/redbpf/target/debug/build/bpf-sys-b06a29b56a4a908c/out/libbpf/src/bpf.o" "-c" "libbpf/src/bpf.c"
  cargo:warning=cc: error: libbpf/src/bpf.c: No such file or directory
  cargo:warning=cc: fatal error: no input files
  cargo:warning=compilation terminated.
  exit code: 1

  --- stderr


  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-m64" "-I" "libbpf/include/uapi" "-I" "libbpf/include" "-I" "bcc" "-I" "libelf" "-I" "." "-Wall" "-Wextra" "-Wno-sign-compare" "-Wno-int-conversion" "-Wno-unused-parameter" "-Wno-unused-result" "-Wno-format-truncation" "-Wno-missing-field-initializers" "-include" "linux/stddef.h" "-o" "/home/josh/Projects/redbpf/target/debug/build/bpf-sys-b06a29b56a4a908c/out/libbpf/src/bpf.o" "-c" "libbpf/src/bpf.c" with args "cc" did not execute successfully (status code exit code: 1).

Rust version:


active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.46.0 (04488afe3 2020-08-24)
@rsdy
Copy link
Collaborator

rsdy commented Sep 21, 2020

You'll need to check out the submodules before building:

git submodule sync
git submodule update --init

Let me know if you still have problems after that.

@jabedude
Copy link
Author

jabedude commented Sep 21, 2020

Hey! Thanks for the pointer. I'm getting further in the build, but this is the error:

libbpf/include/linux/types.h:6:10: fatal error: 'stdbool.h' file not found

I do have the llvm-10 and llvm-10-dev packages installed on my system if that helps

@jabedude
Copy link
Author

This fixed it: actions/runner-images#104 (comment) :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants