If you are building on another architecture, e.g., if you are building arm64/aarch64/ARMv8-a from a desktop PC (amd64/x86_64), then you have to cross compile. Native compiling builds for the wrong architecture and won’t work on the Jetson. The documents which come with the particular L4T release (see “head -n 1 /etc/nv_tegra_release”, then log in at https://developer.nvidia.com/linux-tegra and click the link a second time since redirect doesn’t work) will show the cross compile steps in the kernel customization section.
If you would rather compile natively on the Jetson, then see this:
Beware though that you have to adjust for your L4T release version…the URL is probably using a different version than what you are using, e.g., you might use “./source_sync.sh -k tegra-l4t-r32.2.0” if you are at R32.2.0. “source_sync.sh” is used for downloading not only the source which is within the kernel tree, but also some source related to the board support package which is “out of tree”. The “source_sync.sh” script creates a “sources/” subdirectory, and within that the actual kernel source is the “sources/kernel/kernel-4.9/” (or kernel-4.4 in older releases) content.
NOTE: source_sync.sh downloads the valid source regardless of whether you are on a host PC cross compiling or doing native compile from the TX2.