Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

Error with kernel-cflags-finder on make #225

Closed
kilroyjones opened this issue Jul 20, 2020 · 5 comments
Closed

Error with kernel-cflags-finder on make #225

kilroyjones opened this issue Jul 20, 2020 · 5 comments

Comments

@kilroyjones
Copy link

kilroyjones commented Jul 20, 2020

I'm incredibly new to all this, so pardon my ignorance, but I was trying to compile the hello-world example and experienced this error using Mint 20 with kernels 5.4.0.26, 5.6.19, and 5.7.9 (I attempted it on all three of these kernels).

   Compiling bitflags v1.2.1
   Compiling linux-kernel-module v0.1.0 (/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust)
error: failed to run custom build command for `linux-kernel-module v0.1.0 (/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust)`

Caused by:
  process didn't exit successfully: `/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world/target/debug/build/linux-kernel-module-072fd5c94419c165/build-script-build` (exit code: 1)
  --- stdout   Compiling bitflags v1.2.1
   Compiling linux-kernel-module v0.1.0 (/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust)
error: failed to run custom build command for `linux-kernel-module v0.1.0 (/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust)`

Caused by:
  process didn't exit successfully: `/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world/target/debug/build/linux-kernel-module-072fd5c94419c165/build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-env-changed=KDIR
  cargo:rerun-if-env-changed=CLANG
  cargo:rerun-if-changed=kernel-cflags-finder/Makefile

  --- stderr
  kernel-cflags-finder did not succeed
  stdout: 
  stderr: error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
  make[2]: *** [scripts/Makefile.build:275: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/kernel-cflags-finder/dummy.o] Error 1
  make[1]: *** [Makefile:1719: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/kernel-cflags-finder] Error 2
  make: *** [Makefile:33: all] Error 2

make[2]: *** [/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world/Kbuild:7: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world/target/x86_64-linux-kernel/debug/libhello_world.a] Error 101
make[1]: *** [Makefile:1719: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world] Error 2
make: *** [Makefile:4: all] Error 2
  cargo:rerun-if-env-changed=KDIR
  cargo:rerun-if-env-changed=CLANG
  cargo:rerun-if-changed=kernel-cflags-finder/Makefile

  --- stderr
  kernel-cflags-finder did not succeed
  stdout: 
  stderr: error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
  make[2]: *** [scripts/Makefile.build:275: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/kernel-cflags-finder/dummy.o] Error 1
  make[1]: *** [Makefile:1719: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/kernel-cflags-finder] Error 2
  make: *** [Makefile:33: all] Error 2

make[2]: *** [/home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world/Kbuild:7: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world/target/x86_64-linux-kernel/debug/libhello_world.a] Error 101
make[1]: *** [Makefile:1719: /home/kilroy/code/kernel_modules/rust_based/linux-kernel-module-rust/hello-world] Error 2
make: *** [Makefile:4: all] Error 2

I also tried using this branch and have followed all the recommend changes both here and here. It seemed that some of these have already been changed here, such as cflags.

Any advice would be much appreciated.

@alex
Copy link
Member

alex commented Jul 20, 2020

Interesting. What clang version were you using?

@kilroyjones
Copy link
Author

Tried it with clang 9 and 10, and both produced the same error.

@alex
Copy link
Member

alex commented Jul 21, 2020

Mmm, not sure off hand. @geofft any idea?

@geofft
Copy link
Collaborator

geofft commented Aug 9, 2020

Oh, this is probably also fixed by #227!

@alex
Copy link
Member

alex commented Aug 9, 2020

Optimistically closing this now that #227 is merged. If it's not actually fixed, we can reopen!

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

3 participants