Re: Cross compiling user applications for armv7
Mark Millard <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.arm |
|---|---|
| Message-ID | <[email protected]> |
On Sep 13, 2025, at 00:20, 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. > 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. I found this AI based note about Buildroot's way of putting cross-build toolchains to use: QUOTE Buildroot pre-configures and compiles all necessarily packages during the build process to create a custom root filesystem. . . . Buildroot focuses on static builds, meaing all selected packages are compiled and integrated into the final root filesystem image during the build process. There is no concept of installing or updating packages on the target after the initial build. END QUOTE This is certainly not what the FreeBSD ports tree is set up for. Buildroot or analogous does not exist for FreeBSD --or most *BSD or Unix-- to my knowledge. May be NetBSD's pkgsrc cross build support: https://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/HOWTO-use-crosscompile would be closer to how you like to work? (I've never used such.) > 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 > === Mark Millard marklmi at yahoo.com