Nothing Special   »   [go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on building Opcache JIT for Windows ARM64 #16839

Closed
macintoshplus opened this issue Nov 17, 2024 · 5 comments
Closed

Error on building Opcache JIT for Windows ARM64 #16839

macintoshplus opened this issue Nov 17, 2024 · 5 comments

Comments

@macintoshplus
Copy link

Description

When I try to build the version 8.0.4RC4 on Windows 11 with ARM64 processors, I have this error.

The build work if I add the —disable-opcache-jit.

Resulted in this output:

zend_jit.obj : error LNK2019: unresolved external symbol __readgsqword referenced in function zend_jit_setup
C:\Users\builder\AppData\Local\Temp\994b80f3-d8b1-427d-9ba3-a7bb4df75943\config\vs17\arm64\obj\Release_TS\php_opcache.dll : fatal error LNK1120: 1 unresolved externals

PHP Version

PHP 8.4.0RC4

Operating System

Windows 11 ARM64

@nielsdos
Copy link
Member

Right, this makes sense because the gs register is x86(-64) specific. In fact, I don't think that the JIT works for Windows+ARM64, so it should probably be disabled by the configure script.

@cmb69
Copy link
Member
cmb69 commented Nov 17, 2024

I agree that we should --disable-opcache-jit for Windows ARM64 builds (for now).

And when cross-compiling, if you don't use /WX (same as -Werror), you hit:

        C:\php-sdk\phpdev\vs17\arm64\php-src\arm64\Release_TS\\gen_ir_fold_hash.exe < ext\opcache\jit\ir\ir_fold.h > ext\opcache\jit\ir\ir_fold_hash.h
Die Version von C:\php-sdk\phpdev\vs17\arm64\php-src\arm64\Release_TS\gen_ir_fold_hash.exe ist mit der ausgeführten Windows-Version nicht kompatibel. Überprüfen Sie die Systeminformationen des Computers, und wenden Sie sich anschließend an den Herausgeber der Software.

(cf. #15610 (comment))

@cmb69 cmb69 self-assigned this Nov 17, 2024
cmb69 added a commit to cmb69/php-src that referenced this issue Nov 17, 2024
OPcache JIT does not support Windows ARM64, so we should not allow
`--enable-opcache-jit` in the first place.

Due to the way `ARG_ENABLE()` is handled on Windows, we do not attempt
to suppress the configure option, but just do not enable JIT when the
user attempts to, and adapt the help text.
cmb69 added a commit to cmb69/php-src that referenced this issue Nov 17, 2024
OPcache JIT does not support Windows ARM64, so we should not allow
`--enable-opcache-jit` in the first place.

Due to the way `ARG_ENABLE()` is handled on Windows, we do not attempt
to suppress the configure option, but just do not enable JIT when the
user attempts to, and adapt the help text.
cmb69 added a commit to cmb69/php-src that referenced this issue Nov 17, 2024
OPcache JIT does not support Windows ARM64, so we should not allow
`--enable-opcache-jit` in the first place.

Due to the way `ARG_ENABLE()` is handled on Windows, we do not attempt
to suppress the configure option, but just do not enable JIT when the
user attempts to, and adapt the help text.
@cmb69 cmb69 changed the title Error on building PHP 8.4.0RC4 on Opcache JIT for Windows ARM64 Error on building Opcache JIT for Windows ARM64 Nov 17, 2024
@cmb69 cmb69 linked a pull request Nov 17, 2024 that will close this issue
@cmb69
Copy link
Member
cmb69 commented Nov 17, 2024

Right, this makes sense because the gs register is x86(-64) specific. In fact, I don't think that the JIT works for Windows+ARM64, […]

There is aarch64 support for POSIX systems, but I believe this is still different to what would be needed for Windows ARM64. Plus, cross-compilation may pose more difficult issues than with an autotools build-chain. And from what I can tell, we do not yet support native compilation on Windows ARM64 (although Visual Studio 17.4 is supposed to support that).

@nielsdos
Copy link
Member

but I believe this is still different to what would be needed for Windows ARM64

Definitely, the ABI and how TLS (for ZTS) is handled is different.

@cmb69 cmb69 closed this as completed in e44b762 Nov 18, 2024
cmb69 added a commit that referenced this issue Nov 18, 2024
* PHP-8.4:
  Fix GH-16839: Error on building Opcache JIT for Windows ARM64
@macintoshplus
Copy link
Author

Thanks you @cmb69

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

Successfully merging a pull request may close this issue.

3 participants