使用ELDK构建U-boot

时间:2015-02-02 11:17:01

标签: embedded-linux u-boot yocto

我安装了一个嵌入式Linux开发套件(ELDK v5.5.3,它连接到Yocto项目),我的系统没有任何问题。它安装在/ opt / ARM / eldk-v553中。在安装结束时,我必须使用此脚本来设置正确的环境变量:

export PATH=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux/usr/bin:/opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux/usr/bin/arm-linux-gnueabi:$PATH
export PKG_CONFIG_SYSROOT_DIR=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi
export PKG_CONFIG_PATH=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi/usr/lib/pkgconfig
export CONFIG_SITE=/opt/ARM/eldk-v553/eldk/armv5te/site-config-armv5te-linux-gnueabi
export CC="arm-linux-gnueabi-gcc  -march=armv5te -marm -mthumb-interwork --sysroot=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi"
export CXX="arm-linux-gnueabi-g++  -march=armv5te -marm -mthumb-interwork --sysroot=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi"
export CPP="arm-linux-gnueabi-gcc -E  -march=armv5te -marm -mthumb-interwork --sysroot=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi"
export AS="arm-linux-gnueabi-as "
export LD="arm-linux-gnueabi-ld  --sysroot=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi"
export GDB=arm-linux-gnueabi-gdb
export STRIP=arm-linux-gnueabi-strip
export RANLIB=arm-linux-gnueabi-ranlib
export OBJCOPY=arm-linux-gnueabi-objcopy
export OBJDUMP=arm-linux-gnueabi-objdump
export AR=arm-linux-gnueabi-ar
export NM=arm-linux-gnueabi-nm
export M4=m4
export TARGET_PREFIX=arm-linux-gnueabi-
export CONFIGURE_FLAGS="--target=arm-linux-gnueabi --host=arm-linux-gnueabi --build=i686-linux --with-libtool-sysroot=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi"
export CFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types"
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types -fpermissive"
export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed"
export CPPFLAGS=""
export OECORE_NATIVE_SYSROOT="/opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux"
export OECORE_TARGET_SYSROOT="/opt/ARM/eldk-v553/eldk/armv5te/sysroots/armv5te-linux-gnueabi"
export OECORE_ACLOCAL_OPTS="-I /opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux/usr/share/aclocal"
export OECORE_DISTRO_VERSION="5.5.3"
export OECORE_SDK_VERSION="5.5.3"
export PYTHONHOME=/opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux/usr
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-

所以在我完成后,我从GIT下载了U-boot源,然后将一个补丁应用到uboot,以便为EA3141板添加配置,并使用make启动交叉编译。我收到了一个错误:

make EA3131_config
Configuring for ea31xx board...
[ziga@Ziga-laptop u-boot]$ make
Generating include/autoconf.mk
Generating include/autoconf.mk.dep
for dir in tools examples/standalone examples/api ; do make -C $dir _depend ; done
make[1]: Entering directory '/opt/ARM/u-boot/tools'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/opt/ARM/u-boot/tools'
make[1]: Entering directory '/opt/ARM/u-boot/examples/standalone'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/opt/ARM/u-boot/examples/standalone'
make[1]: Entering directory '/opt/ARM/u-boot/examples/api'
make[1]: Nothing to be done for '_depend'.
make[1]: Leaving directory '/opt/ARM/u-boot/examples/api'
make -C tools all
make[1]: Entering directory '/opt/ARM/u-boot/tools'
gcc -g -Wall -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -c -o env_embedded.o /opt/ARM/u-boot/common/env_embedded.c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -o envcrc crc32.o env_embedded.o envcrc.o sha1.o
gcc -g -Wall -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -c -o default_image.o /opt/ARM/u-boot/tools/default_image.c
gcc -g -Wall -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -c -o fit_image.o /opt/ARM/u-boot/tools/fit_image.c
gcc -g -Wall -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -c -o image.o /opt/ARM/u-boot/common/image.c
gcc -g -Wall -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -c -o kwbimage.o /opt/ARM/u-boot/tools/kwbimage.c
/opt/ARM/u-boot/tools/kwbimage.c: In function ‘kwbimage_verify_header’:
/opt/ARM/u-boot/tools/kwbimage.c:350:10: warning: variable ‘calc_exthdrcsum’ set but not used [-Wunused-but-set-variable]
  uint8_t calc_exthdrcsum;
          ^
gcc -g -Wall -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O -c -o mkimage.o /opt/ARM/u-boot/tools/mkimage.c
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -idirafter /opt/ARM/u-boot/include -idirafter /opt/ARM/u-boot/include2 -idirafter /opt/ARM/u-boot/include -I /opt/ARM/u-boot/libfdt -I /opt/ARM/u-boot/tools -DTEXT_BASE=0x33600000 -DUSE_HOSTCC -D__KERNEL_STRICT_NAMES -O  -o mkimage crc32.o default_image.o fit_image.o image.o kwbimage.o md5.o mkimage.o os_support.o sha1.o fdt.o fdt_ro.o fdt_rw.o fdt_strerror.o fdt_wip.o
strip mkimage
make[1]: Leaving directory '/opt/ARM/u-boot/tools'
make -C examples/standalone all
make[1]: Entering directory '/opt/ARM/u-boot/examples/standalone'
arm-linux-gnueabi-gcc  -g  -Os   -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x33600000 -I/opt/ARM/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux/usr/bin/arm-linux-gnueabi/../../lib/arm-linux-gnueabi/gcc/arm-linux-gnueabi/4.8.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5te -Wall -Wstrict-prototypes -fno-stack-protector   -o hello_world.o hello_world.c -c
arm-linux-gnueabi-gcc  -g  -Os   -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x33600000 -I/opt/ARM/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux/usr/bin/arm-linux-gnueabi/../../lib/arm-linux-gnueabi/gcc/arm-linux-gnueabi/4.8.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5te -Wall -Wstrict-prototypes -fno-stack-protector   -o atmel_df_pow2.o atmel_df_pow2.c -c
arm-linux-gnueabi-gcc  -g  -Os   -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x33600000 -I/opt/ARM/u-boot/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/ARM/eldk-v553/eldk/armv5te/sysroots/i686-eldk-linux/usr/bin/arm-linux-gnueabi/../../lib/arm-linux-gnueabi/gcc/arm-linux-gnueabi/4.8.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm  -mabi=aapcs-linux -mno-thumb-interwork -march=armv5te -Wall -Wstrict-prototypes -fno-stack-protector   -o stubs.o stubs.c -c
arm-linux-gnueabi-ar crv libstubs.a stubs.o
r - stubs.o
arm-linux-gnueabi-ld -g -Ttext 0xc100000 \
                -o hello_world -e hello_world hello_world.o libstubs.a \
                -L. -lgcc
arm-linux-gnueabi-ld: cannot find -lgcc
Makefile:83: recipe for target 'hello_world' failed
make[1]: *** [hello_world] Error 1
make[1]: Leaving directory '/opt/ARM/u-boot/examples/standalone'
Makefile:364: recipe for target 'examples/standalone' failed
make: *** [examples/standalone] Error 2

我认为问题出在-L参数中,其值为.且当前文件夹中没有gcc。如果有人知道在U-boot中存储lib的位置,那么-L的值应该是多少?我应该在哪个makefile中修复这个L参数?有这么多......

0 个答案:

没有答案