Re: compiling for other architecture [armv6 targeting specifically]

From: Oliver Epper <oliver.epper_at_gmail.com>
Date: Fri, 08 Mar 2024 09:34:24 UTC
For reference: I've just installed FreeBSD-14.0-RELEASE for aarch64 under
Apples Hypervisor on a M1 MacBook Pro and setup poudriere. Now things seem
to build just fine and naturally much much faster than under qemu
emulation. This seems feasible. Build times effectively halved even
compared to my native amd64 build. (granted that was on a slightly older
i7).

greetings
Oliver

Am Fr., 8. März 2024 um 09:25 Uhr schrieb Oliver Epper <
oliver.epper@gmail.com>:

> Hey Mark,
>
> Thanks for that information. I messed up the target architecture. I was
> trying to build for 64 bit arm, anyways (just a typo). I've tried poudriere
> with qemu-user-static but there are a lot of errors, indeed. Only a few
> packages build just fine.
>
> Since I am fairly new to FreeBSD I was under the impression that it would
> support aarch64 as a platform. I guess it does, but this does not include
> the ports collection.
>
> No problem. Since I was targeting the Pi as a device for a few simple
> things I might be able to build what I need without using the ports
> collection.
>
> Are there any plans (or a working group) trying to improve the situation
> of the ports collection for other platforms? Doing real native
> cross-compiling and slowly working things out that outright fail even under
> emulation?
>
> Am Di., 5. März 2024 um 18:43 Uhr schrieb Mark Millard <marklmi@yahoo.com
> >:
>
>> Mathieu Arnold <mat_at_freebsd.org> wrote on
>> Date: Tue, 05 Mar 2024 15:37:08 UTC :
>>
>> > I don't think you need to do much of the things you are saying, cross
>> > building can't really work because most ports will compile something and
>> > then try to run it, which won't work because an armv6 binary won't run
>> > on a x86_64 machine.
>> >
>> > What works on the other hand is using poudriere and qemu-user-static.
>> >
>> > you install both, and if you want to build packages for armv6, you just
>> > create a jail with the arch as "arm.armv6", and then simply run
>> > poudriere bulk with the arm jail. It will build everything in a jail,
>> > and you'll get arm packages in the end.
>>
>> Back when FreeBSD ran official port -> package building was
>> targeting armv6 it worked this way. But there were major problems.
>>
>> The last armv6 attempt was on Thu, 05 Oct 2023 02:37:41 GMT. It
>> queued 34637 packages (so a from-scratch build attempt). It built
>> 8276. 242 failed. 25763 were skipped because of the failures. 356
>> were ignored up front. The overall ending status was
>> "stopped:crashed:". This was a 132releng-armv6 quarterly build.
>>
>> The prior from-scratch "stopped:done:" build was on
>> Sat, 05 Aug 2023 04:40:30 GMT. Queued 34382. Built 26346. Failed
>> 407. Skipped 6844. Ignored 721. Again a 132releng-armv6 quarterly
>> build. (Unusually successful for fairly modern times.)
>>
>> The most recent from-scratch main-armv6 build (non-quarterly)
>> goes back to Sun, 11 Dec 2022 03:52:32 GMT. It had a
>> large incremental build on Thu, 12 Jan 2023 03:51:11 GMT,
>> which is the last of the "stopped:done" builds for main-armv6.
>>
>> From my own on-time involvement and and general observation
>> of the official package build attempts for 32 bit architectures
>> on 64-bit hosts is that has rarely gone well overall.
>>
>> > On Sun, Mar 03, 2024 at 01:53:31PM +0100, Oliver Epper wrote:
>> > > Hi all,
>> > >
>> > > I am currently working on an updated port of net/pjsip. I have a
>> personal
>> > > use case building for the raspberry-pi, too. All the information that
>> I
>> > > found so far seemed outdated. Many are talking about building a
>> > > cross-compiler. With clang that should not be necessary, right?
>> > >
>> > > Can anyone point me to more recent information on how I can build for
>> armv6
>> > > on a x86_64 machine?
>> > >
>> > > greetings
>> > > Oliver
>> > >
>> > > P.S.: I know how to build for different architectures. My questions
>> are all
>> > > about the "dos and don'ts" and best practices when it comes to the
>> FreeBSDs
>> > > ports system.
>>
>> ===
>> Mark Millard
>> marklmi at yahoo.com
>>
>>