How do I prepare a Raspberry Pi with Raspbian so I can cross compile Qt5 programs from a Linux host? -
i want setup cross compile environment on linux raspberry pi 1. want try bleeding edge version, i.e. raspbian testing + qt5 dev branch.
this question: how can create modern cross compile toolchain raspberry pi 1?
...explains how gcc compiler, can create code raspberry pi 1. there changes necessary on raspbian use it? if so, ones?
a full toolchain need
a toolchain set of tools working generate binaries system. depending on how build toolchain, might end in being functional your own image, that's not, in fact problem, clone image , upgrade @ will.
first, understand need:
- functional flagship system. reference board , reference distro bundle, packages , stuff. might want standard raspbian or might want stuff, opencv or less stuff removing xorg. want bleeding edge, fit taste.
- sysroot. ideally copy of functional flagship system added development headers. in case same, raspbian image of second partition, 1 hosts /.
- cross compiler. compiler generates code arm while running on x86 or x86_64. specialized gcc.
- cross compiled qmake. qt need cross qmake, qmake generate qt binaries , uses things need generate arm qt software.
- arm qt libraries. part of functional flagship system, enumerate here sake of clarity. compiled using sysroot , cross compiler.
- qt libraries cross compiling. product of steps follow when generating cross compiling qmake , arm qt libraries. installed in host x86 system.
so how of this?
gather own toolchain
- functional flagship system (fff). raspbian image , install additional software @ will, whatever want in, install on live raspberry.
- sysroot. once have fff, use dd generate image of second raspbian partition. card off, insert x86 system , use dd. there other ways using mount , offsets lot simpler.
- cross compiler. unless know doing, refrain creating yourself. there functional cross compilers.
- qmake cross compiling, arm qt , qt libraries. interesting part...
cross compiling qt 5
you can go bleeding edge please qt git. not wiki enumerate steps. this guide explains lot more detail.
- get fff, image , cross compiler working.
- git clone qt, pick tag (version)
- mount sysroot
- get ia32-libs if under x64
- compile qtbase make install. important: after qtbase generates it's own qmake, use it on.
- use generated , installed qmake qtbase build other qt module want.
- remember use make install on qt modules build. these 'installs' copy binaries sysroot.
- get qt fff. either copy folder , avoid messing permissions, or more umount sysroot, use dd dump modified image same physical partition got from. these arm qt libraries.
- when building qtbase install stuff own x86 system. qmake cross compiling, use qt creator generate cross compiled binaries along cross compiler.
some notes nobody tells you
- there seem no toolchains ready download. because depend lot on specific setup.
- do not use system or regular qmake cross compile. use generated qmake, fits fff, has paths , other specific stuff baked in.
- i repeat, not bother creating cross compiler
- what if need additional development files? install them on fff, copy partition have new sysroot.
- yes, can auto-deploy qt , debug remotely on live pi.
Comments
Post a Comment