# Building ports for older arch



## abishai (Mar 12, 2019)

Hello, I compile ports on i7-2600 box for Xeon X5680 CPU, however I noticed 1 port that aborts with SIG4 (illegal instruction). Compiling on X5680 produces correct build material, so I wonder, what is the best way to overcome this issue? It's so strange to see the difference between (almost) the same CPUs


----------



## SirDice (Mar 13, 2019)

abishai said:


> Compiling on X5680 produces correct build material, so I wonder, what is the best way to overcome this issue?


Make sure you don't have any "optimizations" in /etc/make.conf.


----------



## abishai (Mar 13, 2019)

Sure. My optimizations are port options only.
But looks like I need one: architectures are not the same, i7-2600 is Sandy Bridge and X5680 is Westmere. New instruction set was introduced in Sandy Bridge: https://en.wikipedia.org/wiki/Advanced_Vector_Extensions
Tricky!
I wonder now, how FreeBSD ports are compiled to avoid issues on different CPUs.


----------



## Sevendogsbsd (Mar 13, 2019)

I don't understand - they are both x86_64. I thought that was all that mattered. I build on a Xeon X5550 for an i7 7700, that works, never tried the other way around.


----------



## abishai (Mar 13, 2019)

And here we are https://github.com/freebsd/freebsd/blob/master/share/mk/bsd.cpu.mk#L271
Look like I need to set "westmere" explicitly. This will disable avx instructions. I thought this stuff is detected in runtime.


----------

