[Resolved] Omega2+ Cross Compilation on Ubuntu 17.04 LEDE Build failing



  • Hi,
    Im following the Cross Compilation guide for the Omega 2 https://docs.onion.io/omega2-docs/cross-compiling.html and when running the command:

    make 
    

    of the LEDE source, it is failing with the following error on my Ubuntu 17.04 Droplet server.

    me@myserver:~/repo/source$ make
     make[1] world
     make[2] tools/compile
     make[3] -C tools/flock compile
     make[3] -C tools/sed compile
     make[3] -C tools/xz compile
     make[3] -C tools/tar compile
     make[3] -C tools/patch compile
     make[3] -C tools/m4 compile
     make[3] -C tools/autoconf compile
     make[3] -C tools/pkg-config compile
     make[3] -C tools/automake compile
     make[3] -C tools/missing-macros compile
     make[3] -C tools/libtool compile
     make[3] -C tools/gmp compile
     make[3] -C tools/mpfr compile
     make[3] -C tools/mpc compile
     make[3] -C tools/libelf compile
     make[3] -C tools/expat compile
     make[3] -C tools/flex compile
     make[3] -C tools/bison compile
     make[3] -C tools/mklibs compile
     make[3] -C tools/sstrip compile
     make[3] -C tools/make-ext4fs compile
     make[3] -C tools/e2fsprogs compile
     make[3] -C tools/mtd-utils compile
     make[3] -C tools/libressl compile
     make[3] -C tools/mkimage compile
     make[3] -C tools/firmware-utils compile
     make[3] -C tools/patch-image compile
     make[3] -C tools/findutils compile
     make[3] -C tools/quilt compile
     make[3] -C tools/padjffs2 compile
     make[3] -C tools/mm-macros compile
     make[3] -C tools/cmake compile
    make -r world: build failed. Please re-run make with -j1 V=s to see what's going on
    /home/me/repo/source/include/toplevel.mk:207: recipe for target 'world' failed
    make: *** [world] Error 1 
    

    After rerunning with the -j1 V=s option:

    make[3]: Entering directory '/home/me/repo/source/tools/cmake'
    (cd /home/me/repo/source/build_dir/host/cmake-3.8.1/; if [ -x configure ]; then cp -fpR /home/me/repo/source/scripts/config.{guess,sub} /home/me/repo/source/build_dir/host/cmake-3.8.1// && CC="gcc" CFLAGS="-O2 -I/home/me/repo/source/staging_dir/host/include -I/home/me/repo/source/staging_dir/host/usr/include " CPPFLAGS="-I/home/me/repo/source/staging_dir/host/include -I/home/me/repo/source/staging_dir/host/usr/include " LDFLAGS="-L/home/me/repo/source/staging_dir/host/lib -L/home/me/repo/source/staging_dir/host/usr/lib " CONFIG_SHELL="/usr/bin/env bash" MAKEFLAGS="" CXXFLAGS="-O2 -I/home/me/repo/source/staging_dir/host/include -I/home/me/repo/source/staging_dir/host/usr/include "  bash ./configure  --prefix=/home/me/repo/source/staging_dir/host ; fi )
    ---------------------------------------------
    CMake 3.8.1, Copyright 2000-2017 Kitware, Inc. and Contributors
    C compiler on this system is: gcc -O2 -I/home/me/repo/source/staging_dir/host/include -I/home/me/repo/source/staging_dir/host/usr/include
    C++ compiler on this system is: g++ -O2 -I/home/me/repo/source/staging_dir/host/include -I/home/me/repo/source/staging_dir/host/usr/include
    Makefile processor on this system is: make
    g++ is GNU compiler
    g++ has setenv
    g++ has unsetenv
    g++ does not have environ in stdlib.h
    g++ has stl wstring
    g++ has <ext/stdio_filebuf.h>
    ---------------------------------------------
    make[4]: Entering directory '/home/me/repo/source/build_dir/host/cmake-3.8.1/Bootstrap.cmk'
    g++ -O2 -I/home/me/repo/source/staging_dir/host/include -I/home/me/repo/source/staging_dir/host/usr/include   -I/home/me/repo/source/build_dir/host/cmake-3.8.1/Bootstrap.cmk -I/home/me/repo/source/build_dir/host/cmake-3.8.1/Source   -I/home/me/repo/source/build_dir/host/cmake-3.8.1/Utilities  -c /home/me/repo/source/build_dir/host/cmake-3.8.1/Source/cmCommonTargetGenerator.cxx -o cmCommonTargetGenerator.o
    
    ##### LONG WAIT HERE
    
    g++: internal compiler error: Killed (program cc1plus)
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-6/README.Bugs> for instructions.
    Makefile:44: recipe for target 'cmCommonTargetGenerator.o' failed
    make[4]: *** [cmCommonTargetGenerator.o] Error 4
    make[4]: Leaving directory '/home/me/repo/source/build_dir/host/cmake-3.8.1/Bootstrap.cmk'
    ---------------------------------------------
    Error when bootstrapping CMake:
    Problem while running make
    ---------------------------------------------
    Log of errors: /home/me/repo/source/build_dir/host/cmake-3.8.1/Bootstrap.cmk/cmake_bootstrap.log
    ---------------------------------------------
    Makefile:34: recipe for target '/home/me/repo/source/build_dir/host/cmake-3.8.1/.configured' failed
    make[3]: *** [/home/me/repo/source/build_dir/host/cmake-3.8.1/.configured] Error 9
    make[3]: Leaving directory '/home/me/repo/source/tools/cmake'
    tools/Makefile:148: recipe for target 'tools/cmake/compile' failed
    make[2]: *** [tools/cmake/compile] Error 2
    make[2]: Leaving directory '/home/me/repo/source'
    tools/Makefile:146: recipe for target '/home/me/repo/source/staging_dir/target-mipsel_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynyynynnyyynny' failed
    make[1]: *** [/home/me/repo/source/staging_dir/target-mipsel_24kc_musl/stamp/.tools_compile_yynyyyyynyyyyynyynnyyyynyyyyyyyyyyyyyyynyynynnyyynny] Error 2
    make[1]: Leaving directory '/home/me/repo/source'
    /home/me/repo/source/include/toplevel.mk:207: recipe for target 'world' failed
    make: *** [world] Error 2
    

    Any advise on what the issue could be?



  • In case anyone stumbled upon this issue or something related to this.

    Since I do not have a linux machine, I decided to spin up a cheap 1cpu, 512MB ram, $5 digital ocean droplet to setup my toolchain and compile some code for the onion. The above issue occurred on a fresh ubuntu 16 and ubuntu 17 droplet. A friend did some googling and pointed out that these type of issues could be memory related and he was spot on.

    After setting up 2GB swap space using this guide: Adding Space on Ubuntu the compile has completed successfully on both Ubuntu 16 and 17.

    Hope this helps someone experiencing this frustration.

    Cheers.



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