I'm trying to Cross compile a kernel for Android using Ubuntu.
After successfully setting up the menuconfig, and compiling with the following option:
make ARCH=arm CROSS_COMPILE="arm-bravo-" -i -j10
It starts building, but then terminates with a lot of these errors:
error: variable '*something*' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
Now I understand that this can be fixed by running gcc with --disable-werror
option. Probem is that this is a huge project (kernel) and I am not well versed enough with make and Makefile, to know where I have to set this value. Kindly help me understand and fix this problem.
After weeks, I'm now in a position to answer my own question..
Look for KBUILD_CFLAGS
in the main Makefile, and add the following to suppress warnings as errors:
KBUILD_CFLAGS += -w
// if all errors are to be suppressed
KBUILD_CFLAGS += -Wno-error=unused-but-set-variable
// if that specific error is to be suppressed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With