Power & Source of Big Ideas

Errors during u-boot compile

Moderator: FATechsupport

Hi! I would like to compile u-boot but get following errors. Could you please give me a clue how to solve them? Thank you!

ArchLinux Other Linux 4.x or later kernel 64-bit-2018-06-02-21-26-41.png
ArchLinux Other Linux 4.x or later kernel 64-bit-2018-06-02-21-26-41.png (20.62 KiB) Viewed 702 times
I got normal log of my build, hope it will help to figure out what the problem I have.

Code: Select all

[fire3@vmware u-boot]$ make CROSS_COMPILE=aarch64-linux-
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  CHK     include/generated/generic-asm-offsets.h
  CHK     include/generated/asm-offsets.h
  HOSTCC  tools/mkenvimage.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
  ((((x) & 0xff000000) >> 24) | \
                       ^~
././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:50,
                 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:50,
                 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:50,
                 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:50,
                 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:50,
                 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);
 ^~~~~~~~~~~~
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_strings’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:222:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(off_dt_strings);
 ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:238:1: error: redefinition of ‘fdt_set_off_mem_rsvmap’
 fdt_set_hdr_(off_mem_rsvmap);
 ^~~~~~~~~~~~
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_mem_rsvmap’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:223:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(off_mem_rsvmap);
 ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:239:1: error: redefinition of ‘fdt_set_version’
 fdt_set_hdr_(version);
 ^~~~~~~~~~~~
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_version’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:224:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(version);
 ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:240:1: error: redefinition of ‘fdt_set_last_comp_versio’
 fdt_set_hdr_(last_comp_version);
 ^~~~~~~~~~~~
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_last_comp_version’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:225:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(last_comp_version);
 ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:241:1: error: redefinition of ‘fdt_set_boot_cpuid_phys’
 fdt_set_hdr_(boot_cpuid_phys);
 ^~~~~~~~~~~~
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_boot_cpuid_phys’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:226:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(boot_cpuid_phys);
 ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:242:1: error: redefinition of ‘fdt_set_size_dt_strings’
 fdt_set_hdr_(size_dt_strings);
 ^~~~~~~~~~~~
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_size_dt_strings’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:227:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(size_dt_strings);
 ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:243:1: error: redefinition of ‘fdt_set_size_dt_struct’
 fdt_set_hdr_(size_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_size_dt_struct’ was here
  static inline void fdt_set_##name(void *fdt, uint32_t val) \
                     ^~~~~~~~
tools/../include/libfdt.h:228:1: note: in expansion of macro ‘__fdt_set_hdr’
 __fdt_set_hdr(size_dt_struct);
 ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:595:36: error: redefinition of ‘fdt_get_property_w’
 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
                                    ^~~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:516:36: note: previous definition of ‘fdt_get_property_w’ was here
 static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
                                    ^~~~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:692:21: error: redefinition of ‘fdt_getprop_w’
 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
                     ^~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:601:21: note: previous definition of ‘fdt_getprop_w’ was here
 static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
                     ^~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1190:19: error: redefinition of ‘fdt_setprop_inplace_u3’
 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1057:19: note: previous definition of ‘fdt_setprop_inplace_u32’ was here
 static inline int fdt_setprop_inplace_u32(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1225:19: error: redefinition of ‘fdt_setprop_inplace_u6’
 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1092:19: note: previous definition of ‘fdt_setprop_inplace_u64’ was here
 static inline int fdt_setprop_inplace_u64(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1237:19: error: redefinition of ‘fdt_setprop_inplace_cell’
 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1104:19: note: previous definition of ‘fdt_setprop_inplace_cell’ was here
 static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1303:19: error: redefinition of ‘fdt_property_u32’
 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
                   ^~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1170:19: note: previous definition of ‘fdt_property_u32’ was here
 static inline int fdt_property_u32(void *fdt, const char *name, uint32_t val)
                   ^~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1308:19: error: redefinition of ‘fdt_property_u64’
 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
                   ^~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1175:19: note: previous definition of ‘fdt_property_u64’ was here
 static inline int fdt_property_u64(void *fdt, const char *name, uint64_t val)
                   ^~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1313:19: error: redefinition of ‘fdt_property_cell’
 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
                   ^~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1180:19: note: previous definition of ‘fdt_property_cell’ was here
 static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
                   ^~~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1510:19: error: redefinition of ‘fdt_setprop_u32’
 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1330:19: note: previous definition of ‘fdt_setprop_u32’ was here
 static inline int fdt_setprop_u32(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1545:19: error: redefinition of ‘fdt_setprop_u64’
 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1365:19: note: previous definition of ‘fdt_setprop_u64’ was here
 static inline int fdt_setprop_u64(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1557:19: error: redefinition of ‘fdt_setprop_cell’
 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1377:19: note: previous definition of ‘fdt_setprop_cell’ was here
 static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
                   ^~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1682:19: error: redefinition of ‘fdt_appendprop_u32’
 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1472:19: note: previous definition of ‘fdt_appendprop_u32’ was here
 static inline int fdt_appendprop_u32(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1717:19: error: redefinition of ‘fdt_appendprop_u64’
 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1507:19: note: previous definition of ‘fdt_appendprop_u64’ was here
 static inline int fdt_appendprop_u64(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~
In file included from include/image.h:50,
                 from tools/aisimage.c:10:
/usr/include/libfdt.h:1729:19: error: redefinition of ‘fdt_appendprop_cell’
 static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~
In file included from tools/fdt_host.h:11,
                 from tools/imagetool.h:24,
                 from tools/aisimage.c:8:
tools/../include/libfdt.h:1519:19: note: previous definition of ‘fdt_appendprop_cell’ was here
 static inline int fdt_appendprop_cell(void *fdt, int nodeoffset,
                   ^~~~~~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.host:108: tools/aisimage.o] Error 1
make: *** [Makefile:1249: tools] Error 2
I send more time tracking this errors. My original build environment was Arch Linux on VMware virtual machine. I setted up Ubuntu on VMware virtual machine and got everything compiled just fine.

The only difference I see between these two setups is that Arch Linus has device-tree-compiler executable and C header files right in one package (https://www.archlinux.org/packages/comm ... 86_64/dtc/) while Ubuntu separates them as device-tree-compiler (https://packages.ubuntu.com/bionic/amd6 ... r/filelist) and libfdt-dev (https://packages.ubuntu.com/bionic/amd6 ... v/filelist), the last one maybe is not installed, need to check.

Maybe that lid to conflict of inclusion of two different definitions for fdt64_t:

Code: Select all

typedef uint64_t FDT_BITWISE fdt64_t;
typedef __be64 fdt64_t

one comes from u-boot internal definition and the other one comes from Arch Linux /usr/include/libfdt_env.h.

Same time Makefile supposed to handle the presence of both definitions, but something goes wrong.

I would quite appreciate any hints on how to get u-boot to compile on Arch Linux as I am more familiar with this environment and my goal is to get Arch Linux running on Fire3.
Oleg wrote:
I would quite appreciate any hints on how to get u-boot to compile on Arch Linux as I am more familiar with this environment and my goal is to get Arch Linux running on Fire3.


Which kernel are you trying to compile? 3.4 or 4.4?

3.4 is 32 bit and 4.4 is 64 bit. You need to be using the correct compiler. I found this out myself when trying to use the aarch64 with the 3.4 kernel. It doesn't build and spit our heaps of errors.
v8dave wrote:
You need to be using the correct compiler.


Or you use Armbian build engine which does that (and much more) - pick the right compiler - for your. It can save you a lot time.
On the subject of compilers, is there an easy way to build the kernel with an IDE such as Eclipse? I'd like a way to edit and navigate variables across the build. It's tedious trying to search each time to find where a variable is declared.

Who is online

In total there are 0 users online :: 0 registered, 0 hidden and 0 guests (based on users active over the past 5 minutes)
Most users ever online was 106 on Tue Jun 04, 2019 5:48 pm

Users browsing this forum: No registered users and 0 guests