Skip to content

MDEV-40750 gcc-16.1.0 on ppc64 causes innodb to fail to compile - #5546

Merged
grooverdan merged 2 commits into
MariaDB:10.11from
grooverdan:MDEV-40750
Aug 19, 2026
Merged

MDEV-40750 gcc-16.1.0 on ppc64 causes innodb to fail to compile#5546
grooverdan merged 2 commits into
MariaDB:10.11from
grooverdan:MDEV-40750

Conversation

@grooverdan

Copy link
Copy Markdown
Member

Assembler comes up with the error:
unrecognized opcode: `dcbstps'

dcbstps is a Power 10 instruction. The default target arch on most platforms is Power 8 or 9.

Added the target power10 to the function pmem_phwsync. The execution of this function is gated on the ISA 3.1 in pmem_persist_init so there's no chance of a SIGILL.

Before and after on sid container on ppc64le:

[100%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/sync/cache.cc.o
/tmp/ccTRNneR.s: Assembler messages:
/tmp/ccTRNneR.s:53: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:71: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:82: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:93: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:110: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:120: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:130: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:140: Error: unrecognized opcode: `dcbstps'
/tmp/ccTRNneR.s:153: Error: unrecognized opcode: `phwsync'
gmake[3]: *** [storage/innobase/CMakeFiles/innobase.dir/build.make:1619: storage/innobase/CMakeFiles/innobase.dir/sync/cache.cc.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/Makefile2:7016: storage/innobase/CMakeFiles/innobase.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:7023: storage/innobase/CMakeFiles/innobase.dir/rule] Error 2
gmake: *** [Makefile:1499: innobase] Error 2
buildbot@5bb9477a0460:/build$ cmake --build . --target innobase --parallel 8
[  0%] Built target uca-dump
[  0%] Built target GenUnicodeDataSource
[ 38%] Built target mysys
[ 53%] Built target strings
[ 53%] Built target dbug
[ 53%] Built target comp_err
[ 53%] Built target GenError
[ 61%] Built target tpool
[ 61%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/sync/cache.cc.o
[ 61%] Linking CXX static library libinnobase.a
[100%] Built target innobase
buildbot@5bb9477a0460:/build$ gcc --version  
gcc (Debian 16.1.0-3) 16.1.0
Copyright (C) 2026 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@grooverdan
grooverdan requested a review from dr-m August 13, 2026 07:49
Comment thread storage/innobase/sync/cache.cc
Comment thread storage/innobase/sync/cache.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my experiment, it seems that both #if predicates had better be changed to one of the following:

#  if (__GNUC__ >= 11 && __GNUC__ < 16) || (defined __clang_major__ && __clang_major__ >= 18)

We can revisit this if the build starts to fail on clang.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang 21 seems fine. I'll recheck again on the gcc define versions.

@gkodinov gkodinov added the MariaDB Foundation Pull requests created by MariaDB Foundation label Aug 13, 2026
Assembler comes up with the error:
unrecognized opcode: `dcbstps'

dcbstps is a Power 10 instruction. The default target arch on most
platforms is Power 8 or 9.

Added the target power10 to the function pmem_phwsync. The execution
of this function is gated on the ISA 3.1 in pmem_persist_init so
there's no chance of a SIGILL.

clang supports this target as arch=pwr10 and gcc as cpu=power10.
Revert back to using opcodes for old versions.
@grooverdan
grooverdan enabled auto-merge (rebase) August 19, 2026 08:24
@grooverdan
grooverdan merged commit 83c5d87 into MariaDB:10.11 Aug 19, 2026
15 of 17 checks passed
@grooverdan
grooverdan deleted the MDEV-40750 branch August 19, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MariaDB Foundation Pull requests created by MariaDB Foundation

Development

Successfully merging this pull request may close these issues.

3 participants