Hi I need to add custom camera device to kernel and trying to update files in /public_sources/kernel folder. While compiling using make, i got following error. How can I fix it? Thanks.
drivers/base/dma-coherent.c:971:12: error: ‘shrink_thread’ defined but not used [-Werror=unused-function]
static int shrink_thread(void *arg)
drivers/base/dma-coherent.c:280:12: error: ‘declare_coherent_heap’ defined but not used [-Werror=unused-function]
static int declare_coherent_heap(struct device *dev, phys_addr_t base,
drivers/base/dma-coherent.c:96:13: error: ‘dma_debugfs_init’ defined but not used [-Werror=unused-function]
static void dma_debugfs_init(struct device *dev, struct heap_info *heap)
cc1: all warnings being treated as errors
scripts/Makefile.build:335: recipe for target ‘drivers/base/dma-coherent.o’ failed
make: *** [drivers/base/dma-coherent.o] Error 1
scripts/Makefile.build:649: recipe for target ‘drivers/base’ failed
make: *** [drivers/base] Error 2
Makefile:1104: recipe for target ‘drivers’ failed
make: *** [drivers] Error 2
your building failure seems you had some defined but not used functions/variables.
- may I know which JetPack release you’re working with?
- could you please revert all the adding code and confirm the building environment works.
please check your GCC toolchain version.
FYI, you should refer to Building the NVIDIA Kernel chapter that we recommends using the Linaro 7.3.1 2018.05 toolchain.
you may download GCC-7.3.1 toolchain from 3rdparty,
or, we had also test building l4t-r32.1 kernel successfully with gcc-6.4.1
We are having the same problem (activating CAN on TX2). We found the Linaro 7.3.1 2018.05 toolchain binary but don’t know how to install it.
This is just some information to perhaps get you started (in some cases you may find that Ubuntu has releases available directly through “apt”, although there may be a need to enable a repository to see it).
If you look closely you will see three components:
Kernels are “bare metal”, and thus only require the compiler (sysroot and runtime are basically user space libraries and linking).
A compiler example is this:
The i686 says this works from a PC architecture (the older 64-bit), the aarch64 says this produces aarch64 output. The “.xz” suffix is just the latest compression. From some clean directory location, if using this file:
tar xvfJ ./gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu.tar.xz
This will produce a subdirectory, “gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu/”. Within this is a “bin/” subdirectory (“gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu/bin/”). The compiler tools are in this “bin/” subdirectory.
Example if you have this at “/usr/local/gcc-linaro-7.3.1-2018.05-i686_aarch64-linux-gnu/bin/”:
# Then the compile would see the CROSS_COMPILE as a prefix...