Hello
My environment is i.MX6Q and Android 4.4.2.
I want to build fw_printenv but get stuck,and this is my steps:
l@workspace-All-Series:~/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx$ make distclean
l@workspace-All-Series:~/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx$ make mx6q_sabresd_android_config
Configuring for mx6q_sabresd_android board...
l@workspace-All-Series:~/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx$ export ARCH=arm
l@workspace-All-Series:~/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx$ export CROSS_COMPILE=~/android-4.4.2_sdi_in/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
l@workspace-All-Series:~/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx$ make env
make -C tools/env all MTD_VERSION= || exit 1
make[1]: Entering directory `/home/l/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx/tools/env'
/home/l/android-4.4.2_sdi_in/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc -Wall -DUSE_HOSTCC -I/home/l/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx/include crc32.c fw_env.c fw_env_main.c -o fw_printenv
In file included from crc32.c:14:0:
/home/l/android-4.4.2_sdi_in/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/../lib/gcc/arm-eabi/4.6.x-google/include/stdint.h:3:26: fatal error: stdint.h: No such file or directory
compilation terminated.
fw_env.c:27:19: fatal error: errno.h: No such file or directory
compilation terminated.
fw_env_main.c:42:19: fatal error: stdio.h: No such file or directory
compilation terminated.
make[1]: *** [fw_printenv] Error 1
make[1]: Leaving directory `/home/l/android-4.4.2_sdi_in/bootable/bootloader/uboot-imx/tools/env'
make: *** [env] Error 1
I think I use wrong cross compiler,please help me what can I do.
Thank You
Qiulong Li
use another cross compile "arm-fsl-linux-gnueabi-" is OK, build cmd like below:
$ make mx6qsabresd_defconfig
$ make CROSS_COMPILE=/opt/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- env
I also meet this question, my step is like below:
vmuser@ubuntu:~/imx6/uboot/2016.03-r0$ source /opt/fsl-imx-fb/4.1.15-2.0.0/environment-setup-cortexa9hf-neon-poky-linux-gnueabi
vmuser@ubuntu:~/imx6/uboot/2016.03-r0$ make mx6sxsabresd_defconfig
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
#
vmuser@ubuntu:~/imx6/uboot/2016.03-r0$ make
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
UPD include/config.h
GEN include/autoconf.mk
GEN include/autoconf.mk.dep
......
OBJCOPY examples/standalone/hello_world.bin
LDS u-boot.lds
LD u-boot
OBJCOPY u-boot-nodtb.bin
COPY u-boot.bin
CFGS board/freescale/mx6sxsabresd/imximage.cfg.cfgtmp
MKIMAGE u-boot.imx
OBJCOPY u-boot.srec
SYM u-boot.sym
CFG u-boot.cfg
vmuser@ubuntu:~/imx6/uboot/2016.03-r0$ make env
LD tools/env/built-in.o
HOSTCC tools/env/aes.o
In file included from tools/env/aes.c:1:0:
tools/env/../../lib/aes.c:28:20: fatal error: string.h: No such file or directory
compilation terminated.
make[1]: *** [tools/env/aes.o] Error 1
make: *** [env] Error 2
vmuser@ubuntu:~/imx6/uboot/2016.03-r0$
Is there something wrong in this uboot source code?
use another cross compile "arm-fsl-linux-gnueabi-" is OK, new build cmd like below:
$ make mx6sxsabresd_defconfig
$ make CROSS_COMPILE=/opt/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- env
but why pre toolchain which build from yocto project 4.1.15-2.0.0ga is not OK?
build cmd like below:
$ bitbake meta-toolchain
or
$ bitbake meta-toolchain-qt5
good answer
Dear Qiulong Li:
you can compiled fw_printenv with gcc -static option.
eg:
modify $(UBOOT_PATH_TOP)/tools/env/Makefile
what's more,you should use linux-gnueabi- not for android provied prebuilts/gcc/linux-x86/arm/arm-linux-androideabi.
eg:
export ARCH=arm
export CROSS_COMPILE=/opt/Embedsky/tq-linaro-toolchain/bin/arm-none-linux-gnueabi-
modify $(UBOOT_PATH_TOP)/tools/env/Makefile
make env
Hi Qiulong
these are special uboot utilities and its support/building may depend on uboot version.
Please read about its usage on uboot wiki:
HowCanIAccessUBootEnvironmentVariablesInLinux < DULG < DENX
and post possible questions on uboot mail list
For android 4.4.2 uboot building it may be useful to look at attached Porting Guide sect.1.2.1
Preparing the Code
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi igor
Thanks for your reply.
My u-boot's version is v2009.08.
The attach file you give me tells me how to Preparing the Code,I have read and I'm sure my environment is OK,because I can build u-boot.
I can use the follow cmd to build u-boot
make distclean
make mx6q_sabresd_android_config
export ARCH=arm
export CROSS_COMPILE=~/android-4.4.2_sdi_in/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
make
But I can't use the follow cmd to make make fw_printenv
make distclean
make mx6q_sabresd_android_config
export ARCH=arm
export CROSS_COMPILE=~/android-4.4.2_sdi_in/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
make env
Thanks
Qiulong Li