Is building world+kernel on target machine required?

quick question, when doing a make buildworld and make kernel is it necessary to do that on the specific machine that will be running that kernel/world?

I have a beefy amd64 machine and a anemic one that both run freebsd. It would be great if I can just build src on the beefy one then zfs send /usr/obj to the weak one.

I’m worried though that the build makes certain optimizations depending on the machine it’s built on. is this the case? or is my plan a good one?

alternatively, is there a better way to do this, assuming I want to keep building from source?
 
If you don't customize CFLAGS in make.conf then building world for same architecture should work on multiple hosts with that same architecture.
I had one PC which built custom kernel and custom world with optimizations for another and it worked - both were same architecture.
 
Works. Obviousely, if you want cpu optimizations, and the targets are different, you should configure the proper cpu during the build (and run multiple builds, appropriately). You should also be able to build for a downward compatible architecture, if the building host can run these executables.
 
It would be great if I can just build src on the beefy one then zfs send /usr/obj to the weak one.
I use NFS for this. I just export /usr/src/ and /usr/obj (can be read-only). Then mount it on the "destination" host and run install{world,kernel} there.
 
Works. Obviousely, if you want cpu optimizations, and the targets are different, you should configure the proper cpu during the build (and run multiple builds, appropriately). You should also be able to build for a downward compatible architecture, if the building host can run these executables.

I have to correct myself: You can build on any architecture for any architecture (that is supported). Just set TARGET and TARGET_ARCH when calling make.
 
Back
Top