I have been having some trouble doing this and was wondering if it is a common theme or there is room to make it better.
Sometimes packages wont compile at all and thats fine. But recently I cross compiled some system packages and it bricked my system and was no longer able to ssh into it. I am not asking for help in this specific issue, but want to ask if this is a common occurrence for this kind of setup? It does not seem to be a popular setup

  • InverseParallax@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    1 year ago

    It used to be common, did a lot of work on aarch64 as it was basically coming up, a lot of work was ad-hoc using codesourcery and later rolling my own tool chain for cross compiles.

    Once the platform became semi-stable we tried to build everything locally, libraries are the real nightmare, you just can’t deal with them long term. If you’re at the bottom of the stack with 1-2 dependencies it’s definitely doable, it’s as you climb up higher that things fall apart.

    Via con Dios my friend.

    Edit: if you’re going this way, look closely at building your own tool chain with sysroot, it might help.

  • NaN@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    1 year ago

    Cross compilling C/C++ package is a nightmare. Just use virtual machines or containers to build natively.

  • z3bra@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    You gotta make sure you don’t run make install without thinking about it. Always set your $DESTDIR and $PREFIX properly, so the binaries don’t overlap with your system binaries.

  • bizdelnick
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    In general there should not be any problem with most popular build systems (autoconf, cmake etc.) if they are used properly. However some pieces of software use build systems that are not so robust, or even self written scripts to build that causes tons of troubles. E. g. cross compiling samba is very painful. The most difficult case in when some tool is compiled and then used to generate code that will be compiled later, if developers did not implement bootstrapping properly.

    So it is impossible to give a common answer. In general cross compiling is not a problem, but in some particular cases you may need to put in a lot of effort to get it working correctly.