U-boot build issue TX2 R28.1

I am trying to build u-boot but hitting below compile error on the release tag tegra-l4t-r28.1

...
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  GEN     include/autoconf.mk
cc1: warning: unknown register name: x18
  GEN     include/autoconf.mk.dep
cc1: warning: unknown register name: x18
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  CC      lib/asm-offsets.s
cc1: warning: unknown register name: x18
lib/asm-offsets.c:1:0: error: bad value (armv8-a) for -march= switch
 /*
 ^
Kbuild:43: recipe for target 'lib/asm-offsets.s' failed
make[1]: *** [lib/asm-offsets.s] Error 1
Makefile:1264: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

CROSS_COMPILE=~/bin/aarch64-unknown-linux-gnu-

I see the same error with R27.1 tag also.
Please let me know if any additional setup is required.

I can’t answer, but you will probably need to include what config you started with (such as one of the “*_defconfig” files) and which compiler version you used (e.g., “~/bin/aarch64-unknown-linux-gnu-gcc --version”).

I am using aarch64-unknown-linux-gnu-gcc (GCC) 4.8.5

As per documentation for TX2 defconfig is p2771-0000-500_defconfig so I have used the same and .config is being generated.

I tried and it worked for me…were there any changes in your config?

My steps, from the “Linux_for_Tegra/” directory of the driver package (my compiler is in an odd location because my host is Fedora and I have a lot of compilers, but this is the same compiler as provided by the NVIDIA documents):

./source_sync.sh -u tegra-l4t-r28.1
cd sources/u-boot
export CROSS_COMPILE=/usr/local/crosstool-ng/4.8.5/bin/aarch64-unknown-linux-gnu-
make distclean
make p2771-0000-500_defconfig
make

There are a lot of warnings, but compile succeeds. I repeated the process with “make -j4” which also works.

Did you run “make distclean” first? How did you download the sources? If you didn’t use source_sync.sh, then this seems like the next thing to check.

I think it is my setup issue and nothing wrong with the build commands.
Owner of u-boot directory was root in my case, now I have created a new directory with user permissions and able to start the build.

./scripts/dtc-version.sh: line 17: dtc: command not found
./scripts/dtc-version.sh: line 18: dtc: command not found
*** Your dtc is too old, please upgrade to dtc 1.4 or newer
Makefile:1363: recipe for target ‘checkdtc’ failed
make: *** [checkdtc] Error 1

The build is now complaining about dtc version being old, so I guess if I upgrade then I should be able to build it.

dtc is an optional package for Linux distributions (at least for the ones I know about). A very wide range of dtc versions all mostly seem interchangeable, so I’d be very curious how old your dtc is, or if perhaps it just isn’t installed and is completely missing.

Note that every kernel source has a scripts directory and a dtc guaranteed compatible with that source will always be there…you just have to build it.