Cloud or Cross-Compiling?



  • Got my Omega2+ up and running no problem with the latest firmware, but I'm a little stumped as to where to go from here. I tried the Cloud Compile functionality but it never seems to leave the "queued" state. I can't seem to find any current/relevant information RE cross-compiling, only https://wiki.onion.io/Tutorials/Cross-Compile which is for the previous gen. What am I missing, I don't understand why there's not a lot more discussion of this topic, or why I'm unable to find it. What are people doing with their Omega2s once they've got them set up? :sweat_smile:



  • If you want to build C (etc) programs from source, you need a mipsel_24kc_gcc-5.4.0_musl-1.1.15 or similar toolchain - mipsel_24kc being the machine specification and musl being the C library used by LEDE.

    One way to get one is to build a suitable LEDE image from source, though there may be places you can download it.

    A crude approach is then to use command line environment variable overrides, ie

    STAGING_DIR=$(ABSOLUTE_LEDE_PATH)/staging_dir/ GCC=$(ABSOLUTE_LEDE_PATH)/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.15/bin/mipsel-openwrt-linux-musl-gcc make whatever
    

    But this is crude because is assumes that your build system is looking for a GCC variable, if it is looking for a CC it will break and build for the development machine instead. And anything that uses autoconf or pkgconfig, etc will be broken.

    The upstream cross-compilation instructions are at https://lede-project.org/docs/guide-developer/compile_packages_for_lede_with_the_sdk but are not particularly helpful either, as they inherit buildroot's spiritual assumption that you only want to build programs in connection with the setup for building a complete system - you can specify to only build a particular program, but you are still kind of expected to plug your program into the overall system's build system in order to do so.

    So, no great answer, but between the first option of explicitly invoking the cross compiler and the second of merging your program into the system, you can at least get things accomplished.


Log in to reply
 

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