You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incompatibility in Inline TLS Assembly on Alpine 3.22 with zend_jit_ir.c #18743
When building PHP on Alpine Linux 3.22 with musl and targeting 32-bit or 64-bit x86 platforms, a regression is observed related to inline assembly in ext/opcache/jit/zend_jit_ir.c, specifically:
This error does not occur on Alpine 3.21 using the same compilation toolchain. The issue stems from the @TLSGD usage which implicitly expects %rdi on x86_64 or %eax on i386, depending on the TLS model.
ext/opcache/jit/zend_jit_ir.c:3459: Error: @TLSGD operator requires %rdi' as dest register`
@arnaud-lb But this can be fixed on lower branches, and I think we should.
For this particular issue the following suffices (on PHP-8.3) (but would need to generalise to other platforms too ofc as we would need to change other code paths with the same assembly too):
@nielsdos I agree, and it's great that there is a simpler fix, as ba04798 felt a bit risky for release branches.
The change you propose looks good to me. We don't need to use the entire code sequence as in ba04798, because gas is only checking a single instruction, and ld will only check the entire sequence when building opcache statically, which is not allowed in release branches.
If you click on b3c8afe (the commit which closed this), you can see where GitHub tells you tags it's in (and you can see 8.4.9RC1 in there, so it's the former).
If you click on b3c8afe (the commit which closed this), you can see where GitHub tells you tags it's in (and you can see 8.4.9RC1 in there, so it's the former).
Activity
arnaud-lb commentedon Jun 3, 2025
Thank you for reporting this. This is the same root cause as #15074 (see #15074 (comment)), and will be fixed by #18660 (specifically ba04798).
ndossche commentedon Jun 3, 2025
@arnaud-lb But this can be fixed on lower branches, and I think we should.
For this particular issue the following suffices (on PHP-8.3) (but would need to generalise to other platforms too ofc as we would need to change other code paths with the same assembly too):
arnaud-lb commentedon Jun 5, 2025
@nielsdos I agree, and it's great that there is a simpler fix, as ba04798 felt a bit risky for release branches.
The change you propose looks good to me. We don't need to use the entire code sequence as in ba04798, because
gasis only checking a single instruction, andldwill only check the entire sequence when buildingopcachestatically, which is not allowed in release branches.Glibc seems unaffected as we use
@gottpoff, for whichgasdoesn't check the destination register: https://github.com/bminor/binutils-gdb/blob/ec181e1710e37007a8d95c284609bfaa5868d086/gas/config/tc-i386.c#L6869Do you want to take care of this or shall I?
ndossche commentedon Jun 5, 2025
Thanks for the link, I'm on it.
Fix phpGH-18743: Incompatibility in Inline TLS Assembly on Alpine 3.22
Fix GH-18743: Incompatibility in Inline TLS Assembly on Alpine 3.22
Merge branch 'PHP-8.3' into PHP-8.4
Merge branch 'PHP-8.4'
andares commentedon Jul 1, 2025
Hello, could you kindly clarify whether this bug fix is scheduled for inclusion in PHP 8.4.9, or if it was already resolved in the 8.4.8 release?
tianon commentedon Jul 1, 2025
If you click on b3c8afe (the commit which closed this), you can see where GitHub tells you tags it's in (and you can see 8.4.9RC1 in there, so it's the former).
andares commentedon Jul 1, 2025
Thanks, I got it.