buglloc / nanopi-r5

MIT License
0 stars 0 forks source link

u-boot build has error #2

Closed altmangood closed 1 year ago

altmangood commented 1 year ago

OS: Ubuntu 20.04 LTS arch : amd64

cc1: warning: unknown register name: x18
cc1: error: bad value (‘armv8-a+crc’) for ‘-march=’ switch
cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 native
cc1: warning: unknown register name: x18
cc1: error: bad value (‘armv8-a+crc’) for ‘-march=’ switch
cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server cascadelake tigerlake bonnell atom silvermont slm goldmont goldmont-plus tremont knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 btver1 btver2 native
make[1]: *** [scripts/Makefile.build:147: lib/asm-offsets.s] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:147: arch/arm/lib/asm-offsets.s] Error 1
make: *** [Makefile:1930: prepare0] Error 2
make: *** Waiting for unfinished jobs....
  HOSTLD  scripts/dtc/dtc
make: Leaving directory '/workspace/haha/nanopi-r5/uboot/u-boot'

do you use arm host os to build u-boot?

buglloc commented 1 year ago

do you use arm host os to build u-boot?

Yep :)

altmangood commented 1 year ago

x86-64 OS solution:

install cross-compile tools

sudo apt update
sudo apt install gcc-aarch64-linux-gnu

then

export CROSS_COMPILE=/usr/bin/aarch64-linux-gnu-

then it works well