Re: Cross compiling user applications for armv7
Warner Losh <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.arm |
|---|---|
| Message-ID | <CANCZdfqxb=NLF5ukLUDshYH3cUk9oz6+L+VicP9xk-MFjU68hg@mail.gmail.com> |
On Sat, Sep 13, 2025 at 1:21 AM Michał Kruszewski <[email protected]> wrote: > Basically you are saying that I should have a separate physical arm64 > machine for doing embedded armv7 development on FreeBSD. > This is the most performant way to do it, but not the only way. I've only done it for testing purposes (eg, the arm64 box ran armv7 binaries faster than the embedded solution could, so I was able to leverage that to debug things faster). But it's not the only way. I've also done it with much less performant x86 machines... > If I understand this correctly, I just can't understand how can people say > that FreeBSD is embedded friendly. > This is so much complex and convoluted compared to just using, for > example, Buildroot on Linux. > This also doesn't feel like a *nix way of solving things. > I thought that after cross compiling world and kernel, there is some shell > script that I can simply source to start cross-development for target > platform. > You can. The hardest part in all this is setting things up, since as you are finding, there's some tricks, and not all advice is useful. Warner > Regards, > Michał Kruszewski > > > Sent with Proton Mail secure email. > > On Saturday, September 13th, 2025 at 12:23 AM, Mark Millard < > [email protected]> wrote: > > > On Sep 12, 2025, at 14:10, Michał Kruszewski [email protected] wrote: > > > > > A simple way is to set up an armv7 chroot / jail on an arm64 host such > as a Raspberry Pi (Apple devices don't work!). > > > Then it's just like a native environment, but usually much faster. > > > > > I don't have physical arm64 host. > > > I also don't want to create a VM. > > > The whole idea seems weird and unnatural. > > > > > > Ignoring the RPi4B detail: > > > > FreeBSD official armv7 port-packages are built this way > > on arm64 hardware that natively supports user-space > > armv7 code. (ampere* systems are used.) > > > > FreeBSD official i386 port-packages are built this way > > on amd64 hardware that natively supports user-space > > i386 code. > > > > No use of qemu variants of any kind: no attempt at > > non-native-capable host environments. > > > > (Back when amd64 and qemu was used for the likes > > of armv7, lots of stuff failed to build mcuh of > > the time over the years --stuff that builds > > just fine now. This was abandoned after native > > became available. armv6 was always qemu based > > on amd64 and could not build much as of the last > > time a build was run.) > > > > > It sounds more like an exotic workaround. > > > > > > It is the official technique used for what FreeBSD > > distributes for armv7 port-packages. > > > > > Regards, > > > Michał Kruszewski > > > > > > Sent with Proton Mail secure email. > > > > > > On Friday, September 12th, 2025 at 10:46 PM, Robert Clausecker > [email protected] wrote: > > > > > > > Hi Michał, > > > > > > > > A simple way is to set up an armv7 chroot / jail on an arm64 host > such as > > > > a Raspberry Pi (Apple devices don't work!). Then it's just like a > native > > > > environment, but usually much faster. > > > > > > > > Yours, > > > > Robert Clausecker > > > > > > > > Am Fri, Sep 12, 2025 at 04:19:42PM +0000 schrieb Michał Kruszewski: > > > > > > > > > Is there any tutorial on how to cross compile custom user > application for armv7? > > > > > I struggle t find any. > > > > > Cross compiling the system is pretty easy. > > > > > However, how can one cross compile custom user application or > kernel drivers. > > > > > > > > > > Regards, > > > > > Michał Kruszewski > > > > > > > > > > Sent with Proton Mail secure email. > > > > > > > > -- > > > > () ascii ribbon campaign - for an encoding-agnostic world > > > > /\ - against html email - against proprietary attachments > > > > === > > Mark Millard > > marklmi at yahoo.com > >