Skip to content

perf: fix LTO build with gcc (hybrid VM) - #23602

Open
henderkes wants to merge 4 commits into
php:PHP-8.4from
henderkes:fix/gcc-lto-php84
Open

perf: fix LTO build with gcc (hybrid VM)#23602
henderkes wants to merge 4 commits into
php:PHP-8.4from
henderkes:fix/gcc-lto-php84

Conversation

@henderkes

Copy link
Copy Markdown
Contributor

#23588 but on php 8.4/8.5

Comment thread Zend/Zend.m4 Outdated
Comment thread Zend/Zend.m4
[x86_64*|amd64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-r14 -ffixed-r15"])],
[x86*|amd*|i?86*|pentium], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-esi -ffixed-edi"])],
[aarch64*|arm64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-x27 -ffixed-x28"])],
[ppc64*|powerpc64*], [AS_VAR_APPEND([LDFLAGS], [" -ffixed-r14 -ffixed-r15"])],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I m certain powerpc is correct, I was digging a bit about riscv64 and it looks correct too according to this doc, those registers are equivalent to s2/s3 confirmed with the gcc header (see REGISTER_NAMES/ADDITIONAL_REGISTER_NAMES).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I certainly hope they're correct, because otherwise php would crash, I copied them from

# if defined(__GNUC__) && ZEND_GCC_VERSION >= 4008 && defined(i386)
😄

@devnexen

devnexen commented Sep 6, 2026

Copy link
Copy Markdown
Member

What I m less sure about is if the target is appropriate, it s border line improvement/bug fix, I have no issue targetting stable branch personally but I ll leave it to @arnaud-lb

@henderkes

Copy link
Copy Markdown
Contributor Author

It's a bugfix in the sense that lto compilation previously failed with the hybrid vm. Nothing changes about existing builds, so it's safe to merge into supported branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants