We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Cross-Compile failed



  • Hello,
    I'm trying to setup a cross-compiler toolchain on Ubuntu 18.10
    I used these guides:
    https://github.com/OnionIoT/source
    https://docs.onion.io/omega2-docs/cross-compiling.html
    I tried using docker (on a linux) or throught the linux but both failed.

    I get that error below

    make -r world: build failed. Please re-run make with -j1 V=s to see what's going on
    make: *** [/home/george/source/include/toplevel.mk:200: world] Error 1

    This is the output I get when I run "make -j1 V=s"

    freadahead.c: In function 'freadahead':
    freadahead.c:91:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
    #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
    ^~~~~
    make[7]: *** [Makefile:1837: freadahead.o] Error 1
    make[7]: Leaving directory '/home/george/source/build_dir/host/m4-1.4.17/lib'
    make[6]: *** [Makefile:1602: all] Error 2
    make[6]: Leaving directory '/home/george/source/build_dir/host/m4-1.4.17/lib'
    make[5]: *** [Makefile:1506: all-recursive] Error 1
    make[5]: Leaving directory '/home/george/source/build_dir/host/m4-1.4.17'
    make[4]: *** [Makefile:1461: all] Error 2
    make[4]: Leaving directory '/home/george/source/build_dir/host/m4-1.4.17'
    make[3]: *** [Makefile:29: /home/george/source/build_dir/host/m4-1.4.17/.built] Error 2
    make[3]: Leaving directory '/home/george/source/tools/m4'
    make[2]: *** [tools/Makefile:148: tools/m4/compile] Error 2
    make[2]: Leaving directory '/home/george/source'
    make[1]: *** [tools/Makefile:145: /home/george/source/staging_dir/target-mipsel_24kc_musl-1.1.16/stamp/.tools_install_yynyyyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynyynynnyyynnny] Error 2
    make[1]: Leaving directory '/home/george/source'
    make: *** [/home/george/source/include/toplevel.mk:200: world] Error 2



  • [0_1547501358778_onion-iot-gnulib-fread-problem.patch.gz](Uploading 100%) This is a known issue with some build systems and the latest glibc update to 2.28 (see gnu.org link below). Other packages have been patched already, including OpenWRT and lede. Onion needs to pull that patch in to their system. Otherwise, you must use 18.04 latest to build with. I have the same issue on my new laptop which runs 18.10, and have no mechanism for going backward to an older glibc. I have to lean on my KDE Neon desktop to do builds right now.

    To the Onion people, can you find and apply patches to get this going? I believe these links will help identify the issues. I can't seem to apply the patches correctly to the build, but will keep trying to see if I can find a workaround.

    https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
    https://github.com/coreutils/gnulib/commit/4af4a4a71827c0bc5e0ec67af23edef4f15cee8e#diff-5bcce8ce55246264586c4aed2a45ff89

    ** Edit **
    Adding the OpenWRT patch used to make builds work.
    https://github.com/openwrt/openwrt/pull/1290/commits/e5d47f32131849a69a9267de51a30d6be1f0d0ac

    ** Edit 2 **
    It looks like the patch is already applied, but two files need to be "fixed" to get it to build.
    I have a patch, but I can't attach it here. I'll add text if it helps anyone. I am still building and will test soon, so I can't prove yet that this fixes the problem. However, it should be a good start no matter what. Good luck.

    diff -Naur m4-1.4.17/lib/freadahead.c m4-1.4.17-patched/lib/freadahead.c
    --- m4-1.4.17/lib/freadahead.c 2013-09-22 01:15:20.000000000 -0500
    +++ m4-1.4.17-patched/lib/freadahead.c 2019-01-14 15:27:44.358019520 -0600
    @@ -25,7 +25,7 @@
    size_t
    freadahead (FILE fp)
    {
    -#if defined _IO_ftrylockfile || GNU_LIBRARY == 1 /
    GNU libc, BeOS, Haiku, Linux libc5 /
    +#if defined _IO_EOF_SEEN || GNU_LIBRARY == 1 /
    GNU libc, BeOS, Haiku, Linux libc5 */
    if (fp->_IO_write_ptr > fp->_IO_write_base)
    return 0;
    return (fp->_IO_read_end - fp->_IO_read_ptr)
    diff -Naur m4-1.4.17/lib/fseeko.c m4-1.4.17-patched/lib/fseeko.c
    --- m4-1.4.17/lib/fseeko.c 2013-09-22 01:15:55.000000000 -0500
    +++ m4-1.4.17-patched/lib/fseeko.c 2019-01-14 15:27:57.733774421 -0600
    @@ -47,7 +47,7 @@
    #endif

    /* These tests are based on fpurge.c. /
    -#if defined _IO_ftrylockfile || GNU_LIBRARY == 1 /
    GNU libc, BeOS, Haiku, Linux libc5 /
    +#if defined _IO_EOF_SEEN || GNU_LIBRARY == 1 /
    GNU libc, BeOS, Haiku, Linux libc5 */
    if (fp->_IO_read_end == fp->_IO_read_ptr
    && fp->_IO_write_ptr == fp->_IO_write_base
    && fp->_IO_save_base == NULL)



  • I just made a clean install kubuntu 18.04 on my desktop, still no success.



  • I had the same issue, make sure you have at least 60GB of space available for the docker container to build the OS



  • @Peter-Buelow said in Cross-Compile failed:

    The SSD on the desktop I tried is 120GB
    The virtual machines (kubuntu with virtualbox on windows 10) were 20GB and 40GB. Both failed.
    I'll give it a try with over 60GB as you suggest
    Thank you for your help!


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.