<div dir="ltr"><div><div>A small thought: the problem setting ARCH=native is that the final package will be called something like foo-1.1-native-1_SBo, while it should have a name dependant on the minimum CPU where it will run (like Stuart is doing on arm).<br>
<br></div>To get the CFLAGS selected by -march=native, for a possible use like XGizzmo suggest, I use here this dirty trick<br><br>$ gcc -### -e -v -march=native /usr/include/stdlib.h 2>&1 | tail -1 | sed "s|.*\"-march=|\"-march=|" | sed "s|\ -quiet\ .*||"<br>
"-march=corei7-avx" -mcx16 -msahf -mno-movbe -mno-aes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param "l1-cache-size=32" --param "l1-cache-line-size=64" --param "l2-cache-size=3072" "-mtune=corei7-avx"<br>
<br></div>In theory, the resulting package built specifying these CFLAGS should be called foo-1.1-corei7_avx-1_SBo (note the use of underscore in the ARCH to avoid confusing pkgtool).<br></div>