Building and Installing Kernel for Jetson Nano Failing because of Missing Seperator

Hello, I am currently following the Developers Guide for setting up and install the e-con systems, e-CAM50_CUNX camera and I am running into some issue’s when I try to build the kernel on my local machine. The Developers guide has to be requested from their website, so I can’t post a link to it but I can walk through what steps I am currently doing.

Currently on my local machine, which is running Ubuntu 18.04 , I have downloaded and unpacked all the necessary packages to build the L4T 32.4.3 kernel. I extract all the files then navigate to the kernel directory: /Linux_for_Tegra/source/public/kernel/kernel-4.9 and then run the following code:

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_ecam_defconfig
make ARCH=arm64 O=$TEGRA_KERNEL_OUT Image -j4

The first command runs fine, with no errors but when I run the second line after about 10 minutes I get the following error:

/home/nkoch/top_dir/kernel_sources/Linux_for_Tegra/source/public/kernel/kernel-4.9/../../hardware/nvidia/platform/t210/porg/kernel-dts/Makefile.rej:1: *** missing separator.  Stop.
arch/arm64/Makefile:139: recipe for target 'Image' failed
make[1]: *** [Image] Error 2
make[1]: Leaving directory '/home/nkoch/top_dir/kernel_out'
Makefile:171: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2

I suspect it has something to do with the version of gcc I am using to make these files, but I am not sure how to resolve this, because I am using the recommended gcc toolchain version 7.3.1 found here.
I then set my CROSS_COMPILE variable to be /home/nkoch/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- and add that gcc version to my PATH variable.

It’s my understanding that these steps should ensure that I am using the correct gcc toolchain when making these files, but it still seems that there is some kind of versioning error. Anyone who has build a kernel and run into an issue like this, any help would be appreaciated!

Try to install dtc by below command.

sudo apt-get install device-tree-compiler

I installed dtc, should I be running some commands with dtc instead of the make files?

FYI, the kernel source includes its own self-contained dtc build target. After building some targets (e.g., “Image”) you will find it at “scripts/dtc/dtc”. I usually use the one installed on the system from the command given by @ShaneCCC, but if it is needed, then a build target will actually build a local dtc for you.

I do have a suggestion which quite possibly won’t have any effect, but consider this:

  • If you use “ARCH”, then you should also always use “CROSS_COMPILE”. Don’t use ARCH on a native compile, and don’t skip CROSS_COMPILE on a cross compile command even for parts which might not use the compiler. Think of it as a bit of a “sanity” setting.
  • If in doubt about your current source code, run “sudo make mrproper” to reset it. After that, always compile without sudo and always set the “O=...” (such as to “O=$TEGRA_KERNEL_OUT”). Every single command you use when any command uses “O=...” should always use “O=...”.
  • If you get an error the build terminates, but if you are using a job server (the “-j4” in your case), then several other modules may build independently. You can repeat the build with “-j4” until no other non-failing modules terminate the build. Once that is done, then running make without the job server “-j4” will cause all build messages to be related to only the failing module or feature. This is a good log to post in its entirety, versus one which shows build content for all of the other threads of compile. Even though “-j4” is designed for speed on a 4-core system, one could run “-j 16” on the same system if you are trying to get past an error and have as many non-failing modules complete before compile stops (think of “-j4” being repeated a total of four times as getting past three non-failing components four times, but “-j16” getting past 15 non-failing components once…it ends up being a shorter build so long as you don’t run out of RAM). You could log the final build when only the one module fails via (modify as needed, this is for cross compile):
make ARCH=arm64 CROSS_COMPILE=...whatever... O=$TEGRA_KERNEL_OUT Image 2>&1 | tee build_log.txt

(then you could post “build_log.txt”, and if you’d built everything non-failing first, it would be a fairly short log with only the failing component messages)