Building U-Boot - redefinition error

Started by adjivas, July 01, 2018, 04:44:05 AM

Previous topic - Next topic

adjivas

Hi,

I try to apply the chapiter 3 U-Boot from the wiki https://www.olimex.com/wiki/AM335x.
So, my command lines are:

# 2 Cross compiler ; https://www.olimex.com/wiki/AM335x#Cross_compiler#Cross_compiler
# Optionally download toolchain from here. For example:
wget -c https://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/arm-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
tar xf gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
rm -v gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz
export PATH=$(pwd)/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf/bin:$PATH
# In this tutorial gcc 5.4.0 is used:
arm-linux-gnueabihf-gcc --version
# 3 U-Boot ; https://www.olimex.com/wiki/AM335x#U-Boot
# 3.1 Building U-Boot
# Get sources with:
git clone git://git.denx.de/u-boot.git && cd u-boot
# The patch is built against specific commit, so reset repository:
git reset --hard b89dfcfd926b8224edd24608065eb9bb601c0d3b
# Get and apply patch:
wget https://raw.githubusercontent.com/OLIMEX/OLINUXINO/master/SOFTWARE/AM335x/patches/0001-Add-support-for-AM335x-Olimex-boards.patch
git apply 0001-Add-support-for-AM335x-Olimex-boards.patch
# Build image, where <board_defconfig> is am335x_olimex_som_defconfig or am335x_olimex_som_nandboot_defconfig:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_olimex_som_defconfig


The configuration is good written to .config.
But this not produce two files named MLO and u-boot.img.
So I understand that I shoul compile it with the command `make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-` but there is this output error:

scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  UPD     include/config.h
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
  GEN     spl/include/autoconf.mk
  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
  CHK     include/generated/generic-asm-offsets.h
  UPD     include/generated/generic-asm-offsets.h
  CC      arch/arm/lib/asm-offsets.s
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  HOSTCC  tools/img2srec
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/os_support.o
  WRAP    tools/lib/crc32.c
  HOSTCC  tools/lib/crc32.o
  HOSTLD  tools/mkenvimage
  HOSTCC  tools/aisimage.o
In file included from tools/../include/libfdt.h:54,
                 from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
/usr/include/libfdt_env.h:70:30: error: conflicting types for 'fdt64_t'
typedef uint64_t FDT_BITWISE fdt64_t;
                              ^~~~~~~
In file included from <command-line>:
././include/libfdt_env.h:19:16: note: previous declaration of 'fdt64_t' was here
typedef __be64 fdt64_t;
                ^~~~~~~
In file included from ././include/libfdt_env.h:12,
                 from <command-line>:
/usr/include/libfdt_env.h:90:24: error: expected ')' before 'x'
static inline uint32_t fdt32_to_cpu(fdt32_t x)
                        ^~~~~~~~~~~~
././include/compiler.h:66:9: error: expected ')' before '&' token
  ((((x) & 0xff000000) >> 24) | \
         ^
././include/compiler.h:66:23: error: expected ')' before '>>' token
  ((((x) & 0xff000000) >> 24) | \
                       ^~
././include/compiler.h:66:30: error: expected ')' before '|' token
  ((((x) & 0xff000000) >> 24) | \
                              ^
/usr/include/libfdt_env.h:94:23: error: expected ')' before 'x'
static inline fdt32_t cpu_to_fdt32(uint32_t x)
                       ^~~~~~~~~~~~
././include/compiler.h:66:9: error: expected ')' before '&' token
  ((((x) & 0xff000000) >> 24) | \
         ^
././include/compiler.h:66:23: error: expected ')' before '>>' token
././include/compiler.h:66:30: error: expected ')' before '|' token
  ((((x) & 0xff000000) >> 24) | \
                              ^
/usr/include/libfdt_env.h:99:24: error: expected ')' before 'x'
static inline uint64_t fdt64_to_cpu(fdt64_t x)
                        ^~~~~~~~~~~~
././include/compiler.h:71:9: error: expected ')' before '&' token
  ((((x) & 0xff00000000000000##sfx) >> 56) | \
         ^
././include/compiler.h:71:36: error: expected ')' before '>>' token
  ((((x) & 0xff00000000000000##sfx) >> 56) | \
                                    ^~
././include/compiler.h:71:43: error: expected ')' before '|' token
  ((((x) & 0xff00000000000000##sfx) >> 56) | \
                                           ^
/usr/include/libfdt_env.h:103:23: error: expected ')' before 'x'
static inline fdt64_t cpu_to_fdt64(uint64_t x)
                       ^~~~~~~~~~~~
././include/compiler.h:71:9: error: expected ')' before '&' token
  ((((x) & 0xff00000000000000##sfx) >> 56) | \
         ^
././include/compiler.h:71:36: error: expected ')' before '>>' token
  ((((x) & 0xff00000000000000##sfx) >> 56) | \
                                    ^~
././include/compiler.h:71:43: error: expected ')' before '|' token
  ((((x) & 0xff00000000000000##sfx) >> 56) | \
                                           ^
In file included from include/image.h:53,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:149:21: error: redefinition of 'fdt_offset_ptr_w'
static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
                     ^~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:136:21: note: previous definition of 'fdt_offset_ptr_w' was here
static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
                     ^~~~~~~~~~~~~~~~
In file included from include/image.h:53,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:234:1: error: redefinition of 'fdt_set_magic'
fdt_set_hdr_(magic);
^~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:214:21: note: previous definition of 'fdt_set_magic' was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:219:1: note: in expansion of macro '__fdt_set_hdr'
__fdt_set_hdr(magic);
^~~~~~~~~~~~~
In file included from include/image.h:53,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:235:1: error: redefinition of 'fdt_set_totalsize'
fdt_set_hdr_(totalsize);
^~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:214:21: note: previous definition of 'fdt_set_totalsize' was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:220:1: note: in expansion of macro '__fdt_set_hdr'
__fdt_set_hdr(totalsize);
^~~~~~~~~~~~~
In file included from include/image.h:53,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:236:1: error: redefinition of 'fdt_set_off_dt_struct'
fdt_set_hdr_(off_dt_struct);
^~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:214:21: note: previous definition of 'fdt_set_off_dt_struct' was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:221:1: note: in expansion of macro '__fdt_set_hdr'
__fdt_set_hdr(off_dt_struct);
^~~~~~~~~~~~~
In file included from include/image.h:53,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:237:1: error: redefinition of 'fdt_set_off_dt_strings'
fdt_set_hdr_(off_dt_strings);


How can I solve it?