cdsteinkuehler / br2rauc

Buildroot + RAUC
Other
52 stars 18 forks source link

make error related to libgcc #2

Closed Sourabh1107 closed 2 years ago

Sourabh1107 commented 2 years ago

Hello Charles,

I came across your Buildroot + RAUC configuration and wanted to try it out. Even I have Raspberry Pi Compute Module 4. I did the exact steps given in https://github.com/cdsteinkuehler/br2rauc#getting-started. But I am facing many errors related to libgcc. Below are the some of the errors:

../../../libgcc/libgcc2.h:479:15: note: in expansion of macro '__floatditf'
  479 | extern TFtype __floatditf (DWtype);
      |               ^~~~~~~~~~~
../../../libgcc/libgcc2.h:203:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__floatuntitf'
  203 | #define __NDW(a,b) __ ## a ## ti ## b
      |                    ^~
../../../libgcc/libgcc2.h:299:23: note: in expansion of macro '__NDW'
  299 | #define __floatunditf __NDW(floatun,tf)
      |                       ^~~~~
../../../libgcc/libgcc2.h:480:15: note: in expansion of macro '__floatunditf'
  480 | extern TFtype __floatunditf (UDWtype);
      |               ^~~~~~~~~~~~~
../../../libgcc/libgcc2.h:256:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__powitf2'
  256 | #define __N(a) __ ## a
      |                ^~
../../../libgcc/libgcc2.h:345:20: note: in expansion of macro '__N'
  345 | #define __powitf2  __N(powitf2)
      |                    ^~~
../../../libgcc/libgcc2.h:481:15: note: in expansion of macro '__powitf2'
  481 | extern TFtype __powitf2 (TFtype, int);
      |               ^~~~~~~~~
../../../libgcc/libgcc2.h:256:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__divtc3'
  256 | #define __N(a) __ ## a
      |                ^~
../../../libgcc/libgcc2.h:372:19: note: in expansion of macro '__N'
  372 | #define __divtc3  __N(divtc3)
      |                   ^~~
../../../libgcc/libgcc2.h:482:15: note: in expansion of macro '__divtc3'
  482 | extern TCtype __divtc3 (TFtype, TFtype, TFtype, TFtype);
      |               ^~~~~~~~
../../../libgcc/libgcc2.h:256:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__multc3'
  256 | #define __N(a) __ ## a
      |                ^~
../../../libgcc/libgcc2.h:360:19: note: in expansion of macro '__N'
  360 | #define __multc3  __N(multc3)
      |                   ^~~
../../../libgcc/libgcc2.h:483:15: note: in expansion of macro '__multc3'
  483 | extern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype);
      |               ^~~~~~~~
../../../libgcc/libgcc2.h:192:15: error: expected specifier-qualifier-list before 'DItype'
  192 | #define Wtype DItype
      |               ^~~~~~
../../../libgcc/libgcc2.h:493:20: note: in expansion of macro 'Wtype'
  493 |   struct DWstruct {Wtype low, high;};
      |                    ^~~~~
../../../libgcc/libgcc2.h:493:3: warning: empty declaration
  493 |   struct DWstruct {Wtype low, high;};
      |   ^~~~~~
../../../libgcc/libgcc2.h:196:16: error: expected specifier-qualifier-list before 'TItype'
  196 | #define DWtype TItype
      |                ^~~~~~
../../../libgcc/libgcc2.h:503:3: note: in expansion of macro 'DWtype'
  503 |   DWtype ll;
      |   ^~~~~~
../../../libgcc/libgcc2.h:504:3: error: storage class specified for parameter 'DWunion'
  504 | } DWunion;
      |   ^~~~~~~
../../../libgcc/libgcc2.h:508:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__popcount_tab'
  508 | extern const UQItype __popcount_tab[256];
      |                      ^~~~~~~~~~~~~~
../../../libgcc/libgcc2.h:256:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__clz_tab'
  256 | #define __N(a) __ ## a
      |                ^~
../../../libgcc/libgcc2.h:331:20: note: in expansion of macro '__N'
  331 | #define __clz_tab  __N(clz_tab)
      |                    ^~~
../../../libgcc/libgcc2.h:514:22: note: in expansion of macro '__clz_tab'
  514 | extern const UQItype __clz_tab[256];
      |                      ^~~~~~~~~
../../../libgcc/libgcc2.h:256:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__clz_tab'
  256 | #define __N(a) __ ## a
      |                ^~
../../../libgcc/libgcc2.h:331:20: note: in expansion of macro '__N'
  331 | #define __clz_tab  __N(clz_tab)
      |                    ^~~
../../../libgcc/../include/longlong.h:60:22: note: in expansion of macro '__clz_tab'
   60 | extern const UQItype __clz_tab[256] attribute_hidden;
      |                      ^~~~~~~~~
../../../libgcc/libgcc2.h:203:20: error: storage class specified for parameter '__clzti2'
  203 | #define __NDW(a,b) __ ## a ## ti ## b
      |                    ^~
../../../libgcc/libgcc2.h:325:18: note: in expansion of macro '__NDW'
  325 | #define __clzDI2 __NDW(clz,2)
      |                  ^~~~~
../../../libgcc/libgcc2.h:519:12: note: in expansion of macro '__clzDI2'
  519 | extern int __clzDI2 (UDWtype);
      |            ^~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:519:1: warning: parameter names (without types) in function declaration
  519 | extern int __clzDI2 (UDWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:202:19: error: storage class specified for parameter '__clzdi2'
  202 | #define __NW(a,b) __ ## a ## di ## b
      |                   ^~
../../../libgcc/libgcc2.h:319:18: note: in expansion of macro '__NW'
  319 | #define __clzSI2 __NW(clz,2)
      |                  ^~~~
../../../libgcc/libgcc2.h:520:12: note: in expansion of macro '__clzSI2'
  520 | extern int __clzSI2 (UWtype);
      |            ^~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:520:1: warning: parameter names (without types) in function declaration
  520 | extern int __clzSI2 (UWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:202:19: error: storage class specified for parameter '__ctzdi2'
  202 | #define __NW(a,b) __ ## a ## di ## b
      |                   ^~
../../../libgcc/libgcc2.h:320:18: note: in expansion of macro '__NW'
  320 | #define __ctzSI2 __NW(ctz,2)
      |                  ^~~~
../../../libgcc/libgcc2.h:521:12: note: in expansion of macro '__ctzSI2'
  521 | extern int __ctzSI2 (UWtype);
      |            ^~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:521:1: warning: parameter names (without types) in function declaration
  521 | extern int __ctzSI2 (UWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:203:20: error: storage class specified for parameter '__ctzti2'
  203 | #define __NDW(a,b) __ ## a ## ti ## b
      |                    ^~
../../../libgcc/libgcc2.h:326:18: note: in expansion of macro '__NDW'
  326 | #define __ctzDI2 __NDW(ctz,2)
      |                  ^~~~~
../../../libgcc/libgcc2.h:522:12: note: in expansion of macro '__ctzDI2'
  522 | extern int __ctzDI2 (UDWtype);
      |            ^~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:522:1: warning: parameter names (without types) in function declaration
  522 | extern int __ctzDI2 (UDWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:202:19: error: storage class specified for parameter '__clrsbdi2'
  202 | #define __NW(a,b) __ ## a ## di ## b
      |                   ^~
../../../libgcc/libgcc2.h:321:20: note: in expansion of macro '__NW'
  321 | #define __clrsbSI2 __NW(clrsb,2)
      |                    ^~~~
../../../libgcc/libgcc2.h:523:12: note: in expansion of macro '__clrsbSI2'
  523 | extern int __clrsbSI2 (Wtype);
      |            ^~~~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:523:1: warning: parameter names (without types) in function declaration
  523 | extern int __clrsbSI2 (Wtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:203:20: error: storage class specified for parameter '__clrsbti2'
  203 | #define __NDW(a,b) __ ## a ## ti ## b
      |                    ^~
../../../libgcc/libgcc2.h:327:20: note: in expansion of macro '__NDW'
  327 | #define __clrsbDI2 __NDW(clrsb,2)
      |                    ^~~~~
../../../libgcc/libgcc2.h:524:12: note: in expansion of macro '__clrsbDI2'
  524 | extern int __clrsbDI2 (DWtype);
      |            ^~~~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:524:1: warning: parameter names (without types) in function declaration
  524 | extern int __clrsbDI2 (DWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:202:19: error: storage class specified for parameter '__ffsdi2'
  202 | #define __NW(a,b) __ ## a ## di ## b
      |                   ^~
../../../libgcc/libgcc2.h:318:18: note: in expansion of macro '__NW'
  318 | #define __ffsSI2 __NW(ffs,2)
      |                  ^~~~
../../../libgcc/libgcc2.h:525:12: note: in expansion of macro '__ffsSI2'
  525 | extern int __ffsSI2 (UWtype);
      |            ^~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:525:1: warning: parameter names (without types) in function declaration
  525 | extern int __ffsSI2 (UWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:203:20: error: storage class specified for parameter '__ffsti2'
  203 | #define __NDW(a,b) __ ## a ## ti ## b
      |                    ^~
../../../libgcc/libgcc2.h:324:18: note: in expansion of macro '__NDW'
  324 | #define __ffsDI2 __NDW(ffs,2)
      |                  ^~~~~
../../../libgcc/libgcc2.h:526:12: note: in expansion of macro '__ffsDI2'
  526 | extern int __ffsDI2 (DWtype);
      |            ^~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:526:1: warning: parameter names (without types) in function declaration
  526 | extern int __ffsDI2 (DWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:202:19: error: storage class specified for parameter '__popcountdi2'
  202 | #define __NW(a,b) __ ## a ## di ## b
      |                   ^~
../../../libgcc/libgcc2.h:322:23: note: in expansion of macro '__NW'
  322 | #define __popcountSI2 __NW(popcount,2)
      |                       ^~~~
../../../libgcc/libgcc2.h:527:12: note: in expansion of macro '__popcountSI2'
  527 | extern int __popcountSI2 (UWtype);
      |            ^~~~~~~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:527:1: warning: parameter names (without types) in function declaration
  527 | extern int __popcountSI2 (UWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:203:20: error: storage class specified for parameter '__popcountti2'
  203 | #define __NDW(a,b) __ ## a ## ti ## b
      |                    ^~
../../../libgcc/libgcc2.h:328:23: note: in expansion of macro '__NDW'
  328 | #define __popcountDI2 __NDW(popcount,2)
      |                       ^~~~~
../../../libgcc/libgcc2.h:528:12: note: in expansion of macro '__popcountDI2'
  528 | extern int __popcountDI2 (UDWtype);
      |            ^~~~~~~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:528:1: warning: parameter names (without types) in function declaration
  528 | extern int __popcountDI2 (UDWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:202:19: error: storage class specified for parameter '__paritydi2'
  202 | #define __NW(a,b) __ ## a ## di ## b
      |                   ^~
../../../libgcc/libgcc2.h:323:21: note: in expansion of macro '__NW'
  323 | #define __paritySI2 __NW(parity,2)
      |                     ^~~~
../../../libgcc/libgcc2.h:529:12: note: in expansion of macro '__paritySI2'
  529 | extern int __paritySI2 (UWtype);
      |            ^~~~~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:529:1: warning: parameter names (without types) in function declaration
  529 | extern int __paritySI2 (UWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:203:20: error: storage class specified for parameter '__parityti2'
  203 | #define __NDW(a,b) __ ## a ## ti ## b
      |                    ^~
../../../libgcc/libgcc2.h:329:21: note: in expansion of macro '__NDW'
  329 | #define __parityDI2 __NDW(parity,2)
      |                     ^~~~~
../../../libgcc/libgcc2.h:530:12: note: in expansion of macro '__parityDI2'
  530 | extern int __parityDI2 (UDWtype);
      |            ^~~~~~~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:530:1: warning: parameter names (without types) in function declaration
  530 | extern int __parityDI2 (UDWtype);
      | ^~~~~~
In file included from ../../../libgcc/libgcc2.c:56:
../../../libgcc/libgcc2.h:256:16: error: storage class specified for parameter '__enable_execute_stack'
  256 | #define __N(a) __ ## a
      |                ^~
../../../libgcc/libgcc2.h:336:32: note: in expansion of macro '__N'
  336 | #define __enable_execute_stack __N(enable_execute_stack)
      |                                ^~~
../../../libgcc/libgcc2.h:533:13: note: in expansion of macro '__enable_execute_stack'
  533 | extern void __enable_execute_stack (void *);
      |             ^~~~~~~~~~~~~~~~~~~~~~
../../../libgcc/libgcc2.c:1344:1: error: expected declaration specifiers before 'cmp_return_type'
 1344 | cmp_return_type
      | ^~~~~~~~~~~~~~~
In file included from ../../../libgcc/../gcc/tsystem.h:87,
                 from ../../../libgcc/libgcc2.c:27:
/root/raspcm4/sources/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/stdio.h:838:14: error: old-style parameter declarations in prototyped function definition
  838 | extern char *cuserid (char *__s)
      |              ^~~~~~~
../../../libgcc/libgcc2.c:2363: error: expected '{' at end of input
 2363 | #endif /* LIBGCC2_UNITS_PER_WORD <= MIN_UNITS_PER_WORD */
      |
../../../libgcc/libgcc2.c:2363: warning: control reaches end of non-void function [-Wreturn-type]
 2363 | #endif /* LIBGCC2_UNITS_PER_WORD <= MIN_UNITS_PER_WORD */
      |
make[4]: *** [Makefile:501: _ucmpdi2.o] Error 1
make[3]: *** [Makefile:13051: all-target-libgcc] Error 2
make[3]: *** Waiting for unfinished jobs....
libtool: link: (cd ".libs" && rm -f "libcc1plugin.so.0" && ln -s "libcc1plugin.so.0.0.0" "libcc1plugin.so.0")
libtool: link: (cd ".libs" && rm -f "libcc1plugin.so" && ln -s "libcc1plugin.so.0.0.0" "libcc1plugin.so")
libtool: link: /usr/bin/ar rc .libs/libcc1plugin.a  libcc1plugin.o callbacks.o connection.o marshall.o
libtool: link: /usr/bin/ranlib .libs/libcc1plugin.a
libtool: link: ( cd ".libs" && rm -f "libcc1plugin.la" && ln -s "../libcc1plugin.la" "libcc1plugin.la" )
mv -f .deps/libcp1plugin.Tpo .deps/libcp1plugin.Plo
/bin/bash ./libtool --tag=CXX   --mode=link /usr/bin/g++ -W -Wall  -fvisibility=hidden  -O2 -I/root/raspcm4/sources/output/host/include -module -export-symbols ../../libcc1/libcp1plugin.sym  -Xcompiler '-static-libstdc++' -Xcompiler '-static-libgcc' '-L/root/raspcm4/sources/output/host/lib' '-Wl,-rpath,/root/raspcm4/sources/output/host/lib' -o libcp1plugin.la -rpath /root/raspcm4/sources/output/host/lib/gcc/aarch64-buildroot-linux-gnu/10.3.0/plugin libcp1plugin.lo callbacks.lo connection.lo marshall.lo   -Wc,../libiberty/pic/libiberty.a
libtool: link: /usr/bin/g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o  .libs/libcp1plugin.o .libs/callbacks.o .libs/connection.o .libs/marshall.o   -L/root/raspcm4/sources/output/host/lib -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o  -static-libstdc++ -static-libgcc -Wl,-rpath -Wl,/root/raspcm4/sources/output/host/lib ../libiberty/pic/libiberty.a   -Wl,-soname -Wl,libcp1plugin.so.0 -Wl,-retain-symbols-file -Wl,../../libcc1/libcp1plugin.sym -o .libs/libcp1plugin.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libcp1plugin.so.0" && ln -s "libcp1plugin.so.0.0.0" "libcp1plugin.so.0")
libtool: link: (cd ".libs" && rm -f "libcp1plugin.so" && ln -s "libcp1plugin.so.0.0.0" "libcp1plugin.so")
libtool: link: /usr/bin/ar rc .libs/libcp1plugin.a  libcp1plugin.o callbacks.o connection.o marshall.o
libtool: link: /usr/bin/ranlib .libs/libcp1plugin.a
libtool: link: ( cd ".libs" && rm -f "libcp1plugin.la" && ln -s "../libcp1plugin.la" "libcp1plugin.la" )
make[2]: *** [Makefile:959: all] Error 2
make[1]: *** [package/pkg-generic.mk:295: /root/raspcm4/sources/output/build/host-gcc-final-10.3.0/.stamp_built] Error 2
make: *** [Makefile:23: _all] Error 2

Can you please let me know why am I getting these errors and how to resolve it?

Your help will be much appreciated.

Thanks in advance.

cdsteinkuehler commented 2 years ago

What host system are you trying to build on? Are you trying to build gcc from scratch (the Buildroot default) or are you using a pre-built Bootlin toolchain (as suggested in the comments: https://github.com/cdsteinkuehler/br2rauc/blob/master/README.md?plain=1#L61-L64)?

Sourabh1107 commented 2 years ago

Hello Charles,

I am using Buildroot toolchain and not Bootlin toolchain. My build system is docker desktop for windows with WSL2 backend.

Sourabh1107 commented 2 years ago

Update:

By changing Toolchain to Bootlin Toolchain and using "aarch64 glibc stable 2020.08-1" I get below errors related to "libzlib":

(cd /root/raspcm4/sources/output/build/libzlib-1.2.11; rm -rf config.cache; ac_cv_lbl_unaligned_fail=yes ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_memcmp_working=yes ac_cv_have_decl_malloc=yes gl_cv_func_malloc_0_nonnull=yes ac_cv_func_malloc_0_nonnull=yes ac_cv_func_calloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes lt_cv_sys_lib_search_path_spec="" ac_cv_c_bigendian=no  PATH="/root/raspcm4/sources/output/host/bin:/root/raspcm4/sources/output/host/sbin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" AR="/root/raspcm4/sources/output/host/bin/aarch64-linux-ar" AS="/root/raspcm4/sources/output/host/bin/aarch64-linux-as" LD="/root/raspcm4/sources/output/host/bin/aarch64-linux-ld" NM="/root/raspcm4/sources/output/host/bin/aarch64-linux-nm" CC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc" GCC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gcc" CPP="/root/raspcm4/sources/output/host/bin/aarch64-linux-cpp" CXX="/root/raspcm4/sources/output/host/bin/aarch64-linux-g++" FC="/root/raspcm4/sources/output/host/bin/aarch64-linux-gfortran" F77="/root/raspcm4/sources/output/host/bin/aarch64-linux-gfortran" RANLIB="/root/raspcm4/sources/output/host/bin/aarch64-linux-ranlib" READELF="/root/raspcm4/sources/output/host/bin/aarch64-linux-readelf" STRIP="/root/raspcm4/sources/output/host/bin/aarch64-linux-strip" OBJCOPY="/root/raspcm4/sources/output/host/bin/aarch64-linux-objcopy" OBJDUMP="/root/raspcm4/sources/output/host/bin/aarch64-linux-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc" CXX_FOR_BUILD="/usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/root/raspcm4/sources/output/host/include" CFLAGS_FOR_BUILD="-O2 -I/root/raspcm4/sources/output/host/include" CXXFLAGS_FOR_BUILD="-O2 -I/root/raspcm4/sources/output/host/include" LDFLAGS_FOR_BUILD="-L/root/raspcm4/sources/output/host/lib -Wl,-rpath,/root/raspcm4/sources/output/host/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/root/raspcm4/sources/output/host/bin/aarch64-linux-as" DEFAULT_LINKER="/root/raspcm4/sources/output/host/bin/aarch64-linux-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 -D_FORTIFY_SOURCE=1" CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 -D_FORTIFY_SOURCE=1" LDFLAGS="" FCFLAGS=" -Os -g0" FFLAGS=" -Os -g0" PKG_CONFIG="/root/raspcm4/sources/output/host/bin/pkg-config" STAGING_DIR="/root/raspcm4/sources/output/host/aarch64-buildroot-linux-gnu/sysroot" INTLTOOL_PERL=/usr/bin/perl CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os -g0 -D_FORTIFY_SOURCE=1 -fPIC" ./configure --shared --prefix=/usr )
Checking for shared library support...
Building shared library libz.so.1.2.11 with /root/raspcm4/sources/output/host/bin/aarch64-linux-gcc.
Checking for size_t... No.
Checking for long long... Yes.
Failed to find a pointer-size integer type.
** ./configure aborting.
make[1]: *** [package/pkg-generic.mk:285: /root/raspcm4/sources/output/build/libzlib-1.2.11/.stamp_configured] Error 1
make: *** [Makefile:23: _all] Error 2
cdsteinkuehler commented 2 years ago

I suggest trying to build outside of the Docker framework. I can verify builds succeed normally on a WSL2 Debian install (both Bullseye & Buster) as well as on a "traditional" Debian install (Stretch VM running on VMWare).

Sourabh1107 commented 2 years ago

Hello Charles,

I made some progress. And now I am not facing any issue related to compiling libraries. Even rootfs images are built.

But there is an issue with post-image.sh script. At the end of make, I am getting below error:

Number of uids 4
        root (0)
        unknown (1000)
        unknown (1001)
        www-data (33)
Number of gids 4
        root (0)
        unknown (1000)
        unknown (1001)
        www-data (33)
>>>   Executing post-image script /root/raspcm4/sources/br2rauc/board/raspberrypi/post-image.sh
/root/raspcm4/sources/br2rauc/board/raspberrypi/genimage.cfg:41: no such option 'partition-table-type'
make[1]: *** [Makefile:827: target-post-image] Error 1
make: *** [Makefile:23: _all] Error 2

There are no changes made to genimage.cfg file.

Can you please let me know what could be the reason for it?

cdsteinkuehler commented 2 years ago

The partition-table-type option is valid for an hdimage entry in the genimage.cfg file: https://github.com/pengutronix/genimage/blob/master/README.rst

I will not be able to help you further if you do not provide details of your non-working environment. I detailed 3 different confirmed to work build environments in my previous comment. You have not indicated the changes you made to get past your library compiling issue or whether or not you have migrated to a non-Docker based build environment.

If you build in a conventional Debian Linux environment (either a "real" machine, virtual machine, or WSL2) you should have no issues. I have not run any builds in Docker containers and you are on your own (or ask the Buildroot list for help) if you are having problems when using Docker containers as a build machine.

Sourabh1107 commented 2 years ago

I am sorry, I forgot to mention about non-working env. For now, I switched to VirtualBox VM with Ubuntu 20.04. I am on a Windows machine.

BTW, I could also solve the issue with Docker container by properly setting the PATH variable in .bashrc file. Now, build system is not using any x86_64 files in include path (or that's what I observed).

Now, the partition-table-type error is happening in both VM and docker container.

Sourabh1107 commented 2 years ago

Update

I found that partition-table-type option is introduced in newer version of genimage i.e., in version 15. But I have genimage version 14.

One option is to use gpt = true and partition-type-uuid = "L" instead of partition-type in partition section for older genimage versions.

cdsteinkuehler commented 2 years ago

I am glad you got it working. The genimage command should be built as part of the Buildroot host packages. I have been working with the 2022.02 release candidates for Buildroot, but they are tags and not (yet) a branch so the "getting started" directions still list the 2021.11.x branch. I believe I have built successfully with the partition-table-type option in genimage.cfg and Buildroot 2021.11.x, but I've been bouncing around between various working copies enough I'm not 100% positive.

Sourabh1107 commented 2 years ago

Yes, I am using 2021.11.2 Buildroot.

Have you tried casync feature of rauc? And also how about doing atomic delta updates using rauc? For example, doing updates to only appfs. Currently, rauc supports slot-skipping wherein we can skip installing updates to rootfs and only update associated appfs. This reduces update time but not rauc bundle size. But in order to reduce bundle size it should contain appfs image and hash value of installed rootfs. Is it possible to implement this feature?

cdsteinkuehler commented 2 years ago

I have not tried the casync feature of RAUC as it does not fit with my needs. The br2rauc images, however, should support all RAUC mechanisms including casync. The setup for a casync deployment is mostly on the upstream server end. You would need to convert a standard RAUC bundle into a casync bundle and deploy this to your server resource(s).

As for slot-skipping, you can create separate rootfs and appfs partitions. To reduce the bundle size the way you imply I think you need to use something like casync. As far as I know, RAUC doesn't support an update mechanism where you simply include a hash in the bundle but do not have the actual content available via some mechanism (eg: casync, http, included directly in the bundle, etc). The entire purpose of this project is to make it easy to begin experimenting with these RAUC features without having to take a couple weeks to get the baseline pieces in place and building.

There is a known issue that given how the sdcard images are created, there is no rauc status available on the initial image. The rauc.status file does not get populated until you actually install a bundle using RAUC. Seeing if the status file can be 'primed' with the contents which were installed via the genimage tool is on the ToDo list: https://github.com/cdsteinkuehler/br2rauc/blob/master/README.md?plain=1#L399

Sourabh1107 commented 2 years ago

Hello @cdsteinkuehler Thanks for the update. I will try casync and will update here.

I have one more doubt. I changed the config.txt file in board/raspberrypi/raspberrypicm4io_64 to include enable_uart=1. I have a Pl2303TA USB to TTL Rs232 Module Converter Serial Cable Adapter and connected to pins 8 & 10 of IO board. But after running make, the changes are not visible in /output/images/rpi-firmware.

Should I do make clean, before running make?

cdsteinkuehler commented 2 years ago

There should be no need to run a full make clean when changing config.txt, but you need to understand how Buildroot builds and copies it's pacakges. You need to look for the package that installs the config.txt file into the output directory and rebuild that package. The BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE setting which points to the config.txt file is part of the rpi-firmware package, so instead of rebuilding everything you should be able to simply:

make rpi-firmware-rebuild && make

As always, see the Buildroot documentation for details:

When in doubt, run a full rebuild after a make clean. If you have enabled ccache, this shouldn't take too much time or resources.

Sourabh1107 commented 2 years ago

Hello @cdsteinkuehler make rpi-firmware-rebuild && make worked for me. Thanks

I switched to Buildroot 2022 version and reverted the changes made to genimage.cfg I copied the SD card image to uSD and tried to boot from it.

I encountered some errors during boot:


MESS:00:00:03.959471:0: HDMI0:EDID error reading EDID block 0 attempt 1
MESS:00:00:03.968985:0: HDMI0:EDID error reading EDID block 0 attempt 2
.
.
MESS:00:00:05.351593:0: brfs: File read: /mfs/sd/overlays/vc4-kms-v3d.dtbo
MESS:00:00:05.360492:0: dterror: can't find symbol 'i2c2'
MESS:00:00:05.362770:0: Failed to resolve overlay 'vc4-kms-v3d'
.
.
[    1.524926] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[    1.524967] bcm2708_fb: probe of soc:fb failed with error -2
.
.
[    1.630267] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
.
.
[    4.558132] systemd[1]: Load Kernel Modules was skipped because all trigger condition checks failed.
.
.
[    5.733114] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    5.743586] cfg80211: failed to load regulatory.db
.
.
[  OK  ] Started     6.027921] bcmgenet fd580000.ethernet eth0: Link is Down
.
[    6.165737] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.bin failed with error -2
.
.
[FAILED] Failed to start Rauc Update Service.
See 'systemctl status rauc.service' for details.
.
.
Welcome to Buildroot+RAUC

Default username:password is [user:<empty>]
Root login disabled, use sudo su -
eth0:

br2rauc login: [   33.764413] cam-dummy-reg: disabling
[   33.768030] cam1-reg: disabling

I tried to login with username=root. But the console is stuck here.

Can you please let me know what could be the issue here?

Thanks in advance.

P.S: I have a Raspberry Pi CM4 Lite.

cdsteinkuehler commented 2 years ago

Default username:password is [user:<empty>]

Login with username=user, there is no password

Sourabh1107 commented 2 years ago

I am not able to type anything from console. Like my keyboard input is not being passed to console. Also tried by connecting keyboard to IO board, but still same situation. I am using MobaXterm tool for serial console and this USB to TTL Rs232 Module Converter Serial Cable Adapter. And 12V 1.2A power source for IO board. And console is stuck here:

Default username:password is [user:<empty>]
Root login disabled, use sudo su -
eth0:

br2rauc login: [   33.764541] cam-dummy-reg: disabling
[   33.768158] cam1-reg: disabling

There is no cam connected to IO board but it is complaining about cam1-reg: disabling.

Your help will be much appreciated.

Thanks in advance

cdsteinkuehler commented 2 years ago

I have no issues when using the serial console. You might try seeing if you can break into the U-Boot shell to make sure your serial terminal is wired up correctly. If you can't get to the U-Boot console the problem is your serial terminal or wiring and not the OS. If you get a U-Boot shell but can't login to the Buildroot OS, something strange is going on.

I also see the cam-reg: disabling.` message, so that is expected. There's probably a way to disable that I haven't figured out yet...pull requests welcome! :)

Sourabh1107 commented 2 years ago

Hello @cdsteinkuehler you were right, it was the issue with serial cable. After replacing it, it's working fine. Below is the image from linux user-space and hopefully it looks fine with RAUC running on it.

image

Thank you for your help :-)