[U-Boot] problem building fw_printenv

Kári Davíðsson kari.davidsson at marel.com
Mon Jan 18 11:31:27 CET 2010


I did not see real solution on the list, so i will post mine :)

The trick (for me) was to install the mtd-utils headers into the build environment.
I.e. install the contents of mtd-utils/include/mtd  into $(your_buildenv)/usr/include/mtd.
I had to to this manually, since make install of mtd-utils does not install the headers.

You will find mtd-utils e.g. at ftp://ftp.infradead.org/pub/mtd-utils/.
There is probably a git also for the mtd-utils.

I am using mtd-utils_1.0.0 and should upgrade but for now 1.0.0 will have to do.

Hope this helps others that will run into the problem and do not have "sane" build env.

rg
kd

On 12/10/2009 09:20 PM, twebb wrote:
>>
>> I think it comes from the libc, so it wouldn't be present if someone just
>> installed binutils+gcc for standalone development.
>>
> Great, that was the clue.  I was compiling using cross-compile tools
> from android that don't use a standard libc.  When I changed to using
> Codesourcery tools, I got farther...
>
> jb at jb:u-boot-arm$ make env ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
> make -C tools/env all MTD_VERSION= || exit 1
> make[1]: Entering directory `/home/jb/work-1130/boot/u-boot-arm/tools/env'
> arm-none-linux-gnueabi-gcc -Wall -DUSE_HOSTCC
> -I/home/jb/work-1130/boot/u-boot-arm/include crc32.c  fw_env.c
> fw_env_main.c -o fw_printenv
> fw_env.c:43:27: error: mtd/mtd-user.h: No such file or directory
>
> So then, I have this problem with mtd-user.h not being found.  If I
> define MTD_VERSION=old, it then uses mtd.h and gets further but
> encounters another error within mtd.h.
>
> jb at jb:u-boot-arm$ make env ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
> make -C tools/env all MTD_VERSION=old || exit 1
> make[1]: Entering directory `/home/jb/work-1130/boot/u-boot-arm/tools/env'
> arm-none-linux-gnueabi-gcc -Wall -DUSE_HOSTCC
> -I/home/jb/work-1130/boot/u-boot-arm/include -DMTD_OLD crc32.c
> fw_env.c  fw_env_main.c -o fw_printenv
> In file included from fw_env.c:40:
> /home/jb/work-1130/boot/u-boot-arm/include/linux/mtd/mtd.h:143: error:
> expecteddeclaration specifiers or '...' before 'phys_addr_t'
> make[1]: *** [fw_printenv] Error 1
> make[1]: Leaving directory `/home/jb/work-1130/boot/u-boot-arm/tools/env'
> make: *** [env] Error 1
>
> Seems like I shouldn't have to define MTD_VERSION=old in the first
> place, but without it no mtd-user.h file.  Any more suggestions?
>
> Thanks,
> twebb
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


More information about the U-Boot mailing list