build: check AVX512 rather than binutils version
authorBruce Richardson <bruce.richardson@intel.com>
Sat, 4 Jul 2020 11:48:01 +0000 (12:48 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 5 Jul 2020 19:32:40 +0000 (21:32 +0200)
commit68b1f1cda5b46ab826aa83d39d9e5b473c5bdcce
treebf4b2ea61f9ef2b1d25f9602c50ad37326fcd33a
parentb29ac33ffccf856825c42dc11185b112f569ba57
build: check AVX512 rather than binutils version

Rather than checking the binutils version number, which can lead to
unnecessary disabling of AVX512 if fixes have been backported to distro
versions, we can instead check the output of "as" from binutils to see if
it is correct.

The check in the script uses the minimal assembly reproduction code posted
to the public bug tracker for gcc/binutils for those issues [1]. If the
binutils bug is present, the instruction parameters - specifically the
displacement parameter - will be different in the disassembled output
compared to the input. Therefore the check involves assembling a single
instruction and disassembling it again, checking that the two match.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
MAINTAINERS
buildtools/binutils-avx512-check.sh [new file with mode: 0755]
buildtools/meson.build
config/x86/meson.build
meson.build