How to get the Linux Add-In working on 64-bit Ubuntu

Document created by Gregchen Employee on Sep 27, 2017
Version 1Show Document
  • View in full screen mode

Q: When building U-Boot from Linux Add-In source code on 64-bit Ubuntu, you may receive the following error:

 

Header 1
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

A: The issue is caused by lack of 32-bit compat libraries on Ubuntu 14.04 LTS (64-bit) or newer, so we need to install these libraries on host PC:

Header 1
$ sudo apt-get install lib32z1
$ sudo apt-get install lib32stdc++6
$ sudo apt-get install lib32ncurses5

After installing them, we'd better reboot host PC and build it again.

Q: While re-building Buildroot from Linux Add-In source code on Ubuntu 17.04, you may receive the following two errors:

  1.  libglib2 fails to build:

    Header 1
    Makefile:1800: recipe for target 'libglib_2_0_la-gdate.lo' failed
    make[5]: *** [libglib_2_0_la-gdate.lo] Error 1
    make[5]: *** Waiting for unfinished jobs....
    make[5]: Leaving directory '/home/test/workspace/buildroot/output/build/host-libglib2-2.42.0/glib'
    Makefile:2462: recipe for target 'all-recursive' failed
    make[4]: *** [all-recursive] Error 1
    make[4]: Leaving directory '/home/test/workspace/buildroot/output/build/host-libglib2-2.42.0/glib'
    Makefile:1175: recipe for target 'all' failed
    make[3]: *** [all] Error 2
    make[3]: Leaving directory '/home/test/workspace/buildroot/output/build/host-libglib2-2.42.0/glib'
    Makefile:1215: recipe for target 'all-recursive' failed
    make[2]: *** [all-recursive] Error 1
    make[2]: Leaving directory '/home/test/workspace/buildroot/output/build/host-libglib2-2.42.0'
    Makefile:857: recipe for target 'all' failed
    make[1]: *** [all] Error 2
    make[1]: Leaving directory '/home/test/workspace/buildroot/output/build/host-libglib2-2.42.0'
    package/pkg-generic.mk:184: recipe for target '/home/test/workspace/buildroot/output/build/host-libglib2-2.42.0/.stamp_built' failed
    make: *** [/home/test/workspace/buildroot/output/build/host-libglib2-2.42.0/.stamp_built] Error 2
    test@test:~/workspace/buildroot$
  2.  lzop fails to build:
    Header 1
    configure: error: ACC conformance test failed. Stop.
    package/pkg-generic.mk:174: recipe for target '/home/test/workspace/buildroot/output/build/host-lzop-1.03/.stamp_configured' failed
    make: *** [/home/test/workspace/buildroot/output/build/host-lzop-1.03/.stamp_configured] Error 1

A:  These two issues are related with the update GCC, we recommend that you'd better install the latest Linux Add-In package which is available at this page, since the patches for these failures have been included in the latest package ("buildroot/package/libglib2/gcc-libglib2-2.42.0.patch" and "buildroot/package/lzop/lzop-1.03.patch"), please refer to the following patch for Buildroot:

Header 1
diff --git a/package/libglib2/gcc-libglib2-2.42.0.patch b/package/libglib2/gcc-libglib2-2.42.0.patch
new file mode 100644
index 0000000..b356a7d
--- /dev/null
+++ b/package/libglib2/gcc-libglib2-2.42.0.patch
@@ -0,0 +1,14 @@
+diff -Nurp host-libglib2-2.42.0_new/glib/gdate.c host-libglib2-2.42.0/glib/gdate.c
+--- host-libglib2-2.42.0_new/glib/gdate.c  2017-08-04 13:40:33.405533818 +0800
++++ host-libglib2-2.42.0/glib/gdate.c  2017-08-04 13:46:16.133548755 +0800
+@@ -2494,7 +2494,10 @@ g_date_strftime (gchar       *s,
+        * recognize whether strftime actually failed or just returned "".
+        */
+       tmpbuf[0] = '\1';
++      #pragma GCC diagnostic push
++      #pragma GCC diagnostic ignored "-Wformat-nonliteral"
+       tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);
++      #pragma GCC diagnostic pop
+
+       if (tmplen == 0 && tmpbuf[0] != '\0')
+         {
diff --git a/package/lzop/lzop-1.03.patch b/package/lzop/lzop-1.03.patch
new file mode 100644
index 0000000..bb144a5
--- /dev/null
+++ b/package/lzop/lzop-1.03.patch
@@ -0,0 +1,27 @@
+diff -Nrup lzop-1.03_new/src/miniacc.h lzop-1.03/src/miniacc.h
+--- lzop-1.03_new/src/miniacc.h    2017-08-04 13:16:46.149471612 +0800
++++ lzop-1.03/src/miniacc.h    2017-08-04 13:19:33.737478916 +0800
+@@ -4469,12 +4469,12 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mod
+ #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
+ #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+ #else
+-    ACCCHK_ASSERT((1   << (8*SIZEOF_INT-1)) < 0)
++    ACCCHK_ASSERT((int)(1u   << (8*SIZEOF_INT-1)) < 0)
+ #endif
+     ACCCHK_ASSERT((1u  << (8*SIZEOF_INT-1)) > 0)
+ #if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+ #else
+-    ACCCHK_ASSERT((1l  << (8*SIZEOF_LONG-1)) < 0)
++    ACCCHK_ASSERT((long)(1ul  << (8*SIZEOF_LONG-1)) < 0)
+ #endif
+     ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
+ #if defined(acc_int16e_t)
+@@ -4703,7 +4703,7 @@ ACCLIB_EXTERN(int, acc_spawnve) (int mod
+ #elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC)
+ #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
+ #elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
+-    ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
++    ACCCHK_ASSERT( (int)((unsigned int)((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
+ #endif
+ #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
+ #  pragma option pop

We should rebuild Buildroot after applying this patch to Buildroot.

Attachments

    Outcomes