use GCC Tool Chain for 64-bit BSP to build Uboot code fail

Downloaded GCC Tool Chain for 64-bit BSP,set the environment(added PATH in bash.bashrc),I found the tools is rightly work in my host ubuntu 14.04,such as x86_64-linux-gnu-gcc, x86_64-linux-gnu-ld and so on.
Then,I added a script as follow to build u-boot:
#!/bin/bash
source /etc/bash.bashrc
export CROSS_COMPILE=x86_64-linux-gnu-
echo $CROSS_COMPILE
make distclean
make p2371-2180_defconfig
make

It’s a pitty that building failed.Logs as follow:
CLEAN scripts/basic
CLEAN scripts/kconfig
CLEAN include/config include/generated
CLEAN .config include/autoconf.mk include/autoconf.mk.dep include/config.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf

configuration written to .config

scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
UPD include/config.h
GEN include/autoconf.mk
cc1: warning: unknown register name: x18 [enabled by default]
GEN include/autoconf.mk.dep
cc1: warning: unknown register name: x18 [enabled by default]
CHK include/config/uboot.release
UPD include/config/uboot.release
CHK include/generated/version_autogenerated.h
UPD 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 [enabled by default]
[b]lib/asm-offsets.c:1:0: error: bad value (armv8-a) for -march= switch
/*
^
make[1]: *** [lib/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

Is there anything wrong when I set the environment and how to solve the building error?

hello lianghu,

please refer to Tegra Linux Driver Package Development Guide
[url]http://developer.nvidia.com/embedded/dlc/l4t-documentation-24-2-1[/url]

please follow the U-Boot Guide chapter to build your u-boot.
thanks

Hi JerryChang,
I got new uboot code with git clone and git checkout l4t-r27.1,and downloaded and built the toolchains according to the document you give me above.However,even though I used both arm-unknown-linux-gnueabi- and aarch64-unknown-linux-gnu- to build uboot,the error is always there as the log I given.
This problem block my work,please help.
thanks.

R27.1 is for the TX2 and probably won’t work with TX1.

Thank you!The problem has been resolved.There is something wrong when I config the environment of compiling.