Skip to content

Commit

Permalink
config/ppc: workaround GCC 11.3 internal error
Browse files Browse the repository at this point in the history
Building DPDK with gcc 11.3.x for the power10 instruction set may
generate the following error:

../drivers/mempool/cnxk/cnxk_mempool_ops.c
during RTL pass: final
../drivers/mempool/cnxk/cnxk_mempool_ops.c:
  In function ‘cnxk_mempool_alloc’:
../drivers/mempool/cnxk/cnxk_mempool_ops.c:124:1:
  internal compiler error: output_operand: invalid expression as operand
  124 | }
      | ^
Please submit a full bug report,
with preprocessed source if appropriate.
...
ninja: build stopped: subcommand failed.

The same issue is not encountered when building with gcc 11.4 or
later, where the compiler automatically adds the option
"-mno-block-ops-vector-pair" when building for power10 which
is intended as a code optimization and also effectively avoids
the compiler bug displayed.

Modify the meson.build file for ppc and manually set the flag when
building for power10 with gcc less than 11.4.

Bugzilla ID: 1251

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
  • Loading branch information
drchristensen authored and tmonjalo committed Jun 27, 2023
1 parent dcef3b1 commit 9c4dd71
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/ppc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ else
endif
endif
machine_args = ['-mcpu=' + cpu_instruction_set, '-mtune=' + cpu_instruction_set]

# GCC versions < 11.4 may fail to build for power10, see https://bugs.dpdk.org/show_bug.cgi?id=1251.
# Explicitly specify a default used in GCC 11.4 and later to workaround the issue.
if (cpu_instruction_set == 'power10' and cc.get_id() == 'gcc' and
cc.version().version_compare('<=11.4'))
machine_args += '-mno-block-ops-vector-pair'
endif

dpdk_conf.set('RTE_MACHINE', cpu_instruction_set)


Expand Down

0 comments on commit 9c4dd71

Please sign in to comment.