From: David Christensen Date: Wed, 14 Aug 2019 18:36:40 +0000 (-0500) Subject: config: fix build on RHEL 7.6 for Power9 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b681965dbe67794353c11c9085e3daeeeaf69bcf;p=dpdk.git config: fix build on RHEL 7.6 for Power9 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 --- diff --git a/config/ppc_64/meson.build b/config/ppc_64/meson.build index 0e65f9d444..aa7d73d114 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') +endif + # overrides specific to ppc64 dpdk_conf.set('RTE_MAX_LCORE', 1536) dpdk_conf.set('RTE_MAX_NUMA_NODES', 32)