FreeBSD Port: php72-7.2.0 : trouble with lang/php72 & libargon2

Oliver Schonrock oliver at schonrocks.com
Tue Dec 12 10:26:34 UTC 2017


On 12/12/17 00:29, Oliver Schonrock wrote:
>> Well, maybe.  From your mail, though, it looks like you did that
>> testing by rebuilding/installing the ports _on the local machine_,
>> rather than rebuilding in poudriere.  If the poudriere box was
>> building binaries with instructions not in your local machine, that
>> local build would bypass that issue, so it may still be there.
>> "Illegal instruction" seems like an odd presentation for "missing
>> file".
> It's a good point, I get ya. You're right, I did not retest the
> poudriere build.
> 
> The Poudriere machine has a:
> 
> Intel(R) Core(TM) i3-4130T: Haswell (4th gen)
> 
> The machine that is throwing the "Illegal instruction" error, is a
> VirtualBox VM running on an:
> Intel(R) Core(TM) i7-2600 CPU: Sandy Bridge (2nd gen)
> 
> Our production machines are all:
> CPU: AMD Opteron(tm) Processor 4386: "Seoul" (32 nm)
> 
> Ideally I would like to be able to use the packages built by the i3-4130
> machine to run without hitches across all 3 CPU types, while still
> taking advantage of their features for openssl/TLS, etc.
> 
> What would be a good CPUTYPE line for make.conf?
> 
> I am non-the-wiser from the docs in /usr/share/examples/etc/make.conf

Right, nothing like scouring source code:

I noticed that while compiling libargon2 it was showing -march=native.
I found that

clang -E - -march=native -###

can give you list of features which the compiler will use for that arch.
I ran that on the haswell and the sandybridge machines and cleaned it up
and diff'd it. Yes there are features missing on sandybridge as far as
clang is concerned. Haswell has these (and sandybridge not):

"+avx2"
"+bmi"
"+bmi2"
"+f16c"
"+fma"
"+fsgsbase"
"+invpcid"
"+lzcnt"
"+movbe"
"+rdrnd"
"+xsaveopt"

Out of those avx2 seems like a likely candidate (see below!), but lets
find out what CPUTYPE=... actually does. It seems that this file has the
answer:

/usr/src/share/mk/bsd.cpu.mk

Here are the relevant lines, for my 3 architectures:

(..under amd64 ..near L247 )

.  elif ${CPUTYPE} == "ivybridge" || ${CPUTYPE} == "sandybridge"
MACHINE_CPU = avx sse42 sse41 ssse3 sse3

.  elif ${CPUTYPE} == "broadwell" || ${CPUTYPE} == "haswell"
MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3

.  elif ${CPUTYPE} == "bdver3" || ${CPUTYPE} == "bdver2" || ${CPUTYPE}
== "bdver1"
MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3

I wasn't sure what bdverX translates into, but I know my 4386 opteron
does not have avx2, so it must be bdver3 on this scale.

so for those 3 CPU types, I find the highest common denominator as:

avx sse42 sse41 ssse3 sse3

which is exactly the setting for "sandybridge"

So I should be able to put CPUTYPE=sandybridge into /etc/make.conf
and...happy days? No more nasty surprises?

I will wait for that libargon2 patch to be committed to svn.ports and
then retest on the "haswell" poudriere server to see if I can get it to
build "sandybridge" (and bdver3) compat binaries....



-- 
Oliver Schönrock
email    : oliver at schonrocks.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20171212/db0337e8/attachment.sig>


More information about the freebsd-ports mailing list