Building armv5 pkgs under amd64

Is it possible to build armv5 pkgs under amd64?

I assume it is since I built FreeBSD 11.1 for ARM under amd64 following instructions here, and have built a few pkgs under it, but it is a painfully slow process.

Apologies for starting another thread for asking the same. The last one Thread 70499 lead me down a poudriere rabbit hole which went nowhere. I'm hoping that there is some sort of facility - environment variable or /etc/make.conf option where I can set TARGET_ARCH=arm and then just run make...
 
I assume it is since I built FreeBSD 11.1 for ARM
I am confused. In another thread you said you could only run 11.0-RELEASE without problem. Did you find out a way to improve the situation or did I misunderstood ?

lead me down a poudriere rabbit hole which went nowhere.
Have you tried the method I gave you to get out of this rabbit hole ? I think the solution could be applied to 11.1-RELEASE if this is what you use now. I was able to build packages for armv5 that way (to be honest, it was slower than I expected even knowing it was cross compiling).
 
I am confused. In another thread you said you could only run 11.0-RELEASE without problem. Did you find out a way to improve the situation or did I misunderstood ?

I was able to build 11.0 but had no success building pkgs.

With 11.1 I did eventually sort out the build errors see Thread 70467. Not sure how I stumbled across that solution...


Have you tried the method I gave you to get out of this rabbit hole ? I think the solution could be applied to 11.1-RELEASE if this is what you use now. I was able to build packages for armv5 that way (to be honest, it was slower than I expected even knowing it was cross compiling).

I have established a working build environment for FreeBSD itself, I just want to be able to build pkgs. I've looked at poudriere() but my eyes just glaze over after a while...

If I just wanted to build misc/mc, what do I need to run?
poudriere mc -o misc/mc -j jailname
 
what do I need to run?
You have to create a ports tree (see : poudriere-ports(8)). Since you will use a non supported version of FreeBSD (assuming you run 11.0-RELEASE or 11.1-RELEASE), you will have to take an old enough version of the ports tree (or add ALLOW_UNSUPPORTED_SYSTEM=yes to your make.conf file and cross your fingers). If you want to use the ports tree already present in your system, please read : https://github.com/freebsd/poudriere/wiki/use_system_ports_tree

Once you have a ports tree, you just need the following command :
poudriere bulk -p ${YOURPORTSTREENAME} -j ${YOURJAILNAME} misc/mc

That's it.
 
Have you built the native-xtools (-x option to poudriere)?
Thank you. I was not aware of this option. The improvement is quite noticeable. I have yet to read what it does exactly and I am not even sure I can understand. For the moment, I just consider it black magic.
 
Once you have a ports tree, you just need the following command :
poudriere bulk -p ${YOURPORTSTREENAME} -j ${YOURJAILNAME} misc/mc

That's it.

I think I need to do this in small byte size chunks because of the number of options which make learning the process difficult and error prone... I've set up the jail, which is easy enough, but am unsure about ports.

If I just want, as an exmple to use the existing ports tree under /usr/ports and build under the host OS 12.0-RELEASE for amd64 and build editors/nano what do I run?

poudriere bulk -p default -j FreeBSD-12_0-RELEASEx64 editors/nano

Later I will want to use ftp://ftp.fi.freebsd.org/pub/FreeBSD/releases/amd64/11.1-RELEASE/ports.txz for my ports tree and build the same for FreeBSD 11.1-RELEASE on armv5
 
as an exmple to use the existing ports tree under /usr/ports
As shown in the link I provided poudriere ports -c -m null -M /usr/ports -p default .
and build under the host OS 12.0-RELEASE for amd64 and build editors/nano what do I run?
poudriere bulk -p default -j FreeBSD-12_0-RELEASEx64 editors/nano
Yes.
Later I will want to use ftp://ftp.fi.freebsd.org/pub/FreeBSD/releases/amd64/11.1-RELEASE/ports.txz for my ports tree and build the same for FreeBSD 11.1-RELEASE on armv5
Then, you create a new ports tree with the PATH pointing to where you extracted ports.txz and use the corresponding jail to build your packages.
 
As shown in the link I provided poudriere ports -c -m null -M /usr/ports -p default .

Yes.

I'm obviously missing something fundamental since I just ran the above and got:-
Code:
No package built, but repository needs to be created
Creating pkg repository
Error: Unable to extract pkg.

I think I'd best delete the whole thing and start again...
 
So I have serious doubts about the fact that you ran the command you said you ran.

My bad. You were right to have serious doubts about the command I ran. After a few more attempts to run what you suggested I did manage to create the pkg.... but not yet sure how to install it.
 
but not yet sure how to install it
Please, read the point 10 of the following post:
By the way you will learn a lot reading carefully the two first posts. Actually, to be honest, I think you should have started by reading it before posting on the forum about how to build packages using poudriere.
 
Actually, to be honest, I think you should have started by reading it before posting on the forum about how to build packages using poudriere.

I was never really interested in trying to use poudriere initially, it seemed far too complicated with a large number of options specifically designd to trip me up :). My focus was on building pkgs for armv5. I had read around poudriere but didn't really understand how it worked, that's why I asked here. The HowTo you linked to has 71 posts which is no mean amount especially fo someone trying to get an overview as to how it works.

I am now able to build amd64 pkgs using FreeBSD 12.0, but still not sure about armv5 pkgs under FreeBSD 11.1.

I tried
poudriere jail -c -j 11_1-RELEASE-arm -v 11.1-RELEASE -a arm

but am told
Code:
[00:00:00] Cross-building ports for arm on amd64 requires QEMU
[00:00:00] Error: You need to install the qemu-user-static package or setup an emulator with binmiscctl(8) for arm

According to https://lists.freebsd.org/pipermail/freebsd-arm/2019-April/019797.html

qmeu-statoc supports armv[67] only, but not older armv5 which lacks atomic
ops instructions and has to emulate them with RAS sequences. qemu doesn't
work with them.

Looking at binmiscctl() it's not clear to me how to install it into a poudriere environment, and from the comment above I'm not at all sure if it will work.
 
I tried
poudriere jail -c -j 11_1-RELEASE-arm -v 11.1-RELEASE -a arm
but am told

This bring us back to the following post that was given to you by T-Daemon few days ago: https://forums.freebsd.org/threads/building-arm-packages-with-poudriere-the-simple-way.52994/

I am a bit surprised because I used poudriere(8) in that context few days ago (see here). I am at work at the moment so I cannot further check. Interesting anyway.
 
Code:
[00:00:00] Cross-building ports for arm on amd64 requires QEMU
[00:00:00] Error: You need to install the qemu-user-static package or setup an emulator with binmiscctl(8) for arm
You probably forgot to start the 'qemu-user service' service qemu_user_static onestart
 
You probably forgot to start the 'qemu-user service' service qemu_user_static onestart

Actually I forgot to install it on the system I'm currently using... I decided to start again from scratch on another system....

Now after running:-
poudriere jail -c -j 11_1-RELEASE-arm -v 11.1-RELEASE -a arm

I get Fetching MANIFEST for FreeBSD 11.1-RELEASE arm
...except it doesn't work since there is no such file. I've tried -a arm and -a arm.arm but neither work.
Am I supposed to specify -a armv6?
 
Now after running:-
poudriere jail -c -j 11_1-RELEASE-arm -v 11.1-RELEASE -a arm

I get Fetching MANIFEST for FreeBSD 11.1-RELEASE arm
...except it doesn't work since there is no such file. I've tried -a arm and -a arm.arm but neither work.
Am I supposed to specify -a armv6?
It has to be built from source: -m svn+https
 
It has to be built from source: -m svn+https
How do I do that?

I have built FreeBSD 11.1 for ARM from ftp://ftp.fi.freebsd.org/pub/FreeBSD/releases/amd64/11.1-RELEASE/src.txz in a FreeBSD 11.1 jail, but don't know how to get poudriere to build it.
 
It has to be built from source: -m svn+https
I think he cannot. His host system is running 12.0-RELEASE so he will have a problem when compiling due to lint removal.

How do I do that?
As already explained in another thread, you have to download the source, modify it so it compiles without lint (two lines to modify) and then use this modified source to build your jail. See this post : https://forums.freebsd.org/threads/building-arm-pkgs-on-amd64.70499/#post-424906
 
I think he cannot. His host system is running 12.0-RELEASE so he will have a problem when compiling due to lint removal.


As already explained in another thread, you have to download the source, modify it so it compiles without lint (two lines to modify) and then use this modified source to build your jail. See this post : https://forums.freebsd.org/threads/building-arm-pkgs-on-amd64.70499/#post-424906
You can apply a patch on top of the src tree, I don't have poudriere installed here, so can't check the manpages, but it's possible (been there)
 
This is for 11.0-RELEASE, he is trying to build 11.1-RELEASE. The patch is dead simple so may be it applies to both, but I have not tested.
 
Back
Top