Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Dec 2017 10:26:23 +0000
From:      Oliver Schonrock <oliver@schonrocks.com>
To:        "Matthew D. Fuller" <fullermd@over-yonder.net>
Cc:        ports <ports@FreeBSD.org>, tz@FreeBSD.org
Subject:   Re: FreeBSD Port: php72-7.2.0 : trouble with lang/php72 & libargon2
Message-ID:  <d77a1139-7482-8686-bc3f-33ab76244bec@schonrocks.com>
In-Reply-To: <1b69f03c-fe9f-ad9f-a314-395c713d2329@schonrocks.com>
References:  <6a2752ce-ee15-84a4-bd2b-150f614cf1a2@schonrocks.com> <20171211232847.GO1783@over-yonder.net> <9b51f4f4-8380-9bd3-37ee-e166939c16c4@schonrocks.com> <20171211234106.GP1783@over-yonder.net> <1b69f03c-fe9f-ad9f-a314-395c713d2329@schonrocks.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--HTiBvXkJLRC2i9Jubcm6405IPohit3fRh
Content-Type: multipart/mixed; boundary="mq6r9XI0TFM2h2QLKCTsqcnls7cpKiAoD";
 protected-headers="v1"
From: Oliver Schonrock <oliver@schonrocks.com>
To: "Matthew D. Fuller" <fullermd@over-yonder.net>
Cc: ports <ports@FreeBSD.org>, tz@FreeBSD.org
Message-ID: <d77a1139-7482-8686-bc3f-33ab76244bec@schonrocks.com>
Subject: Re: FreeBSD Port: php72-7.2.0 : trouble with lang/php72 & libargon2
References: <6a2752ce-ee15-84a4-bd2b-150f614cf1a2@schonrocks.com>
 <20171211232847.GO1783@over-yonder.net>
 <9b51f4f4-8380-9bd3-37ee-e166939c16c4@schonrocks.com>
 <20171211234106.GP1783@over-yonder.net>
 <1b69f03c-fe9f-ad9f-a314-395c713d2329@schonrocks.com>
In-Reply-To: <1b69f03c-fe9f-ad9f-a314-395c713d2329@schonrocks.com>

--mq6r9XI0TFM2h2QLKCTsqcnls7cpKiAoD
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: quoted-printable

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.
>=20
> The Poudriere machine has a:
>=20
> Intel(R) Core(TM) i3-4130T: Haswell (4th gen)
>=20
> 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)
>=20
> Our production machines are all:
> CPU: AMD Opteron(tm) Processor 4386: "Seoul" (32 nm)
>=20
> Ideally I would like to be able to use the packages built by the i3-413=
0
> machine to run without hitches across all 3 CPU types, while still
> taking advantage of their features for openssl/TLS, etc.
>=20
> What would be a good CPUTYPE line for make.conf?
>=20
> 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=3Dnative.
I found that

clang -E - -march=3Dnative -###

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=3D... actually does. It seems that this file has th=
e
answer:

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

Here are the relevant lines, for my 3 architectures:

(..under amd64 ..near L247 )

=2E  elif ${CPUTYPE} =3D=3D "ivybridge" || ${CPUTYPE} =3D=3D "sandybridge=
"
MACHINE_CPU =3D avx sse42 sse41 ssse3 sse3

=2E  elif ${CPUTYPE} =3D=3D "broadwell" || ${CPUTYPE} =3D=3D "haswell"
MACHINE_CPU =3D avx2 avx sse42 sse41 ssse3 sse3

=2E  elif ${CPUTYPE} =3D=3D "bdver3" || ${CPUTYPE} =3D=3D "bdver2" || ${C=
PUTYPE}
=3D=3D "bdver1"
MACHINE_CPU =3D 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=3Dsandybridge 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....



--=20
Oliver Sch=C3=B6nrock
email    : oliver@schonrocks.com


--mq6r9XI0TFM2h2QLKCTsqcnls7cpKiAoD--

--HTiBvXkJLRC2i9Jubcm6405IPohit3fRh
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJaL67PAAoJEF6SumULDx4PtqoH+QFX2+97tSQlIvLWSjZBPpI8
FzFddOL1GbCGeIyJt/H4NbX3aAC2VasrXVLncJaczfoFyRmhMthO4QYUCuYV5pDz
jz3usUYF1UytSIXs19PJ+IUNQueyKUUzZG4dmrQYYcrLlJIF4NLQMVSmGrN2gW6d
hzUDyDPpdYl26cmFAaMQnFRY/+yQuBTEWM+AY8I+ByLdwqzqJ34z7OOY8xGNmF3z
YpOF0VOz9SoykmoIPT1jNaZUbUKrb45UV1B/U2KbvWSIFpa3X4n/J15bBwDkN7kE
QjcHurqWtoJCrH9Qf4P1h1EmI5gUw2VL9bvxdfNstHkR0T3H/j8f1yXSh1MeZaQ=
=DqCi
-----END PGP SIGNATURE-----

--HTiBvXkJLRC2i9Jubcm6405IPohit3fRh--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d77a1139-7482-8686-bc3f-33ab76244bec>