[1/2] config: fix RHEL7.6 build errors on Power 9 systems

Message ID 1565807801-72546-2-git-send-email-drc@linux.vnet.ibm.com
State New
Delegated to: Thomas Monjalon
Headers show
  • fixes to resolve meson build issues on Power systems
Related show


Context Check Description
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/iol-Compile-Testing success Compile Testing PASS
ci/checkpatch success coding style OK

Commit Message

David Christensen Aug. 14, 2019, 6:36 p.m.
gcc 4.8.5 used on RHEL 7.6 can identify a Power 9 CPU but cannot generate
Power 9 code when the "-mcpu=native" command line argument is used. Test
whether the compiler can generate Power 9 code and adjust the machine
setting appropriately.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
 config/ppc_64/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)


diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build
index 0e65f9d..495ef6f 100644
--- a/config/ppc_64/meson.build
+++ b/config/ppc_64/meson.build
@@ -7,6 +7,16 @@  endif
 dpdk_conf.set('RTE_ARCH', 'ppc_64')
 dpdk_conf.set('RTE_ARCH_PPC_64', 1)
+# RHEL 7.x uses gcc 4.8.X which doesn't generate code for Power 9 CPUs,
+# though it will detect a Power 9 CPU when the "-mcpu=native" argument
+# is used, resulting in a build failure.
+power9_supported = cc.has_argument('-mcpu=power9')
+if not power9_supported
+	machine = 'power8'
+	machine_args = ['-mcpu=power8', '-mtune=power8']
+  dpdk_conf.set('RTE_MACHINE','power8')
 # overrides specific to ppc64
 dpdk_conf.set('RTE_MAX_LCORE', 1536)
 dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)