build: move AVX512 check to x86 config

Message ID 20230811131024.2285366-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series build: move AVX512 check to x86 config |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS

Commit Message

David Marchand Aug. 11, 2023, 1:10 p.m. UTC
  The AVX512 check only matters to x86 compilation with gcc.
Move it where appropriate.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 buildtools/meson.build                              | 3 ---
 {buildtools => config/x86}/binutils-avx512-check.py | 0
 config/x86/meson.build                              | 3 +++
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename {buildtools => config/x86}/binutils-avx512-check.py (100%)
  

Comments

Bruce Richardson Aug. 11, 2023, 1:38 p.m. UTC | #1
On Fri, Aug 11, 2023 at 03:10:24PM +0200, David Marchand wrote:
> The AVX512 check only matters to x86 compilation with gcc.
> Move it where appropriate.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Tyler Retzlaff Aug. 11, 2023, 3:58 p.m. UTC | #2
On Fri, Aug 11, 2023 at 03:10:24PM +0200, David Marchand wrote:
> The AVX512 check only matters to x86 compilation with gcc.
> Move it where appropriate.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
Acked-by Tyler Retzlaff <roretzla@linux.microsoft.com>
  
David Marchand Aug. 25, 2023, 8:39 a.m. UTC | #3
On Fri, Aug 11, 2023 at 3:10 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> The AVX512 check only matters to x86 compilation with gcc.
> Move it where appropriate.
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by Tyler Retzlaff <roretzla@linux.microsoft.com>

Applied, thanks.
  

Patch

diff --git a/buildtools/meson.build b/buildtools/meson.build
index e1c600e40f..266e727706 100644
--- a/buildtools/meson.build
+++ b/buildtools/meson.build
@@ -4,7 +4,6 @@ 
 pkgconf = find_program('pkg-config', 'pkgconf', required: false)
 check_symbols = find_program('check-symbols.sh')
 ldflags_ibverbs_static = find_program('options-ibverbs-static.sh')
-objdump = find_program('objdump', 'llvm-objdump')
 
 python3 = import('python').find_installation(required: false)
 if python3.found()
@@ -18,8 +17,6 @@  map_to_win_cmd = py3 + files('map_to_win.py')
 sphinx_wrapper = py3 + files('call-sphinx-build.py')
 get_cpu_count_cmd = py3 + files('get-cpu-count.py')
 get_numa_count_cmd = py3 + files('get-numa-count.py')
-binutils_avx512_check = (py3 + files('binutils-avx512-check.py') +
-                        [objdump] + cc.cmd_array())
 
 # select library and object file format
 pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()]
diff --git a/buildtools/binutils-avx512-check.py b/config/x86/binutils-avx512-check.py
similarity index 100%
rename from buildtools/binutils-avx512-check.py
rename to config/x86/binutils-avx512-check.py
diff --git a/config/x86/meson.build b/config/x86/meson.build
index 54345c4da3..b2315c051f 100644
--- a/config/x86/meson.build
+++ b/config/x86/meson.build
@@ -4,6 +4,9 @@ 
 # get binutils version for the workaround of Bug 97
 binutils_ok = true
 if is_linux or cc.get_id() == 'gcc'
+    objdump = find_program('objdump', 'llvm-objdump')
+    binutils_avx512_check = (py3 + files('binutils-avx512-check.py') +
+                            [objdump] + cc.cmd_array())
     binutils_ok = run_command(binutils_avx512_check, check: false).returncode() == 0
     if not binutils_ok and cc.has_argument('-mno-avx512f')
         machine_args += '-mno-avx512f'