Cross-compiling ports for the same architecture, but different OS version

Hi there!

I have a spare laptop and I'd like to utilize it for cross-compiling stuff (ports and the base) for my main machine, because I can not afford to do it on my main laptop, due to amount of time it takes.

I had never had an experience of cross-compilation of any kind and I'd like to start with ports. Both of my laptops are amd64, but spare runs FreeBSD-14.3 RELEASE, and main runs 15-STABLE with latest ports. Could I ask to help me and give a brief overview of how should this process look in general? Will I need to have a separate binaries for clang(1) and other toolchain things having the same architecture but different OS versions? Then, how shall I install the resulting packages on my main machine (I have access to spare via ssh(1))? I guees, that 'package' target in ports(7) is what I need?
I'd guees I'd also like to use portmaster(8) for the task (for compiling multiple ports with one command).

I appreciate any help!
Thank you.
 
Thanks! I heard about poudriere, but completely forgot about it. I will explore now. By the way, as far as I already found, it seems that is should be possible to compile for newer system on older one.
 
that seems a little surprising to us, we'd think newer worlds would require features from newer kernels, and jails don't virtualize the kernel, just the userland.
 
that seems a little surprising to us, we'd think newer worlds would require features from newer kernels, and jails don't virtualize the kernel, just the userland.
Maybe I got something wrong. I didn't have a chance to set it up and run yet. I will post some updates, maybe I am wrong indeed.
 
Only if it is a pure cross-compile. If any of the compile results have to run as part of the build process, then no.
Thank you! So, I guess, then, that the best choice for me would be to wait until 15.0-RELEASE is released, then roll it on my spare machine and then use it for compiling for 15-STABLE? Should the same OS major version number (15) be enough for my task?
 
Thank you! So, I guess, then, that the best choice for me would be to wait until 15.0-RELEASE is release, the roll it on my spare machine and then use it for compiling for 15-STABLE? Should the same OS major version number (15) be enough for my task?

That should be fine.
 
best choice for me would be to wait until 15.0-RELEASE is released, then roll it on my spare machine and then use it for compiling for 15-STABLE?
You could run 16-CURRENT now (with the debugging features disabled). All packages on the build cluster are built on CURRENT with poudriere, e.g. misc/freebsd-release-manifests build for 14.3 amd64 quarterly:

Code:
Host OSVERSION: 1600000
Jail OSVERSION: 1403000
 
Back
Top