cmake – How to install dev packages for Raspberry Pi cross-compiling?

I want to compile my project for Raspberry Pi 5. I want to run compilation in my PC that runs a Debian Linux, as it would be much faster than do it on a Pi. Installing the cross compiler is easy, but how to get the Pi’s root filesystem and development packages on my host computer?

Actually my project is generated using CMake, and relies on libwebkit2gtk-4.0-dev and its dependencies.

I know it is possible to install the ARM version of packages on my host Debian via multiarch. but firstly there are bugs on multiarch packages, such as file conflicts (the ARM version and x86_64 version of package uses same file path which ruins the system). Secondly it is not guaranteed that my host Debian is really compatible with Raspbian, i.e. theoretically they can use different glibc version. So I seek for a possibility to use a “true” rootfs.

Can I copy the directories from a running Pi to my PC and use it?

Read more here: Source link