Skip to content

Support PHP 8.1 #92

@adamziel

Description

@adamziel

PHP patches no longer cleanly apply to PHP 8.1. Adjusting the patches leads to the following error in the emmake make -j8 step:

> PHP_VERSION=8.1.13 npm run build:php
...
#21 205.5 /bin/bash /root/php-src/libtool --silent --preserve-dup-deps --tag CC --mode=compile /emsdk/upstream/emscripten/emcc -Imain/ -I/root/php-src/main/ -I/root/php-src/include -I/root/php-src/main -I/root/php-src -I/root/php-src/ext/date/lib -I/root/php-src/TSRM -I/root/php-src/Zend    -fno-common -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /root/php-src/main/fopen_wrappers.c -o main/fopen_wrappers.lo  -MMD -MF main/fopen_wrappers.dep -MT main/fopen_wrappers.lo
#21 206.4 /root/php-src/Zend/asm/make_x86_64_sysv_elf_gas.S:40:10: error: Unexpected token in operand: %
#21 206.4     movq %rdi, %rax
#21 206.4          ^
#21 206.4 /root/php-src/Zend/asm/make_x86_64_sysv_elf_gas.S:43:10: error: Unexpected token in operand: $
#21 206.4     andq $-16, %rax

...

#21 206.6 make: *** [Makefile:863: Zend/asm/make_x86_64_sysv_elf_gas.lo] Error 1
#21 206.6 make: *** Waiting for unfinished jobs....
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:39:15: error: Expected ,, instead got: (
#21 207.3     leaq -0x38(%rsp), %rsp
#21 207.3               ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:42:13: error: Unexpected token in operand: (
#21 207.3     stmxcsr (%rsp)
#21 207.3             ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:43:15: error: Expected ,, instead got: (
#21 207.3     fnstcw 0x4(%rsp)
#21 207.3               ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:46:10: error: Unexpected token in operand: %
#21 207.3     movq %r12, 0x8(%rsp)
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:47:10: error: Unexpected token in operand: %
#21 207.3     movq %r13, 0x10(%rsp)
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:48:10: error: Unexpected token in operand: %
#21 207.3     movq %r14, 0x18(%rsp)
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:49:10: error: Unexpected token in operand: %
#21 207.3     movq %r15, 0x20(%rsp)
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:50:10: error: Unexpected token in operand: %
#21 207.3     movq %rbx, 0x28(%rsp)
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:51:10: error: Unexpected token in operand: %
#21 207.3     movq %rbp, 0x30(%rsp)
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:54:10: error: Unexpected token in operand: %
#21 207.3     movq %rsp, %rax
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:57:10: error: Unexpected token in operand: %
#21 207.3     movq %rdi, %rsp
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:59:14: error: Expected ,, instead got: (
#21 207.3     movq 0x38(%rsp), %r8
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:62:13: error: Unexpected token in operand: (
#21 207.3     ldmxcsr (%rsp)
#21 207.3             ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:63:14: error: Expected ,, instead got: (
#21 207.3     fldcw 0x4(%rsp)
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:66:13: error: Expected ,, instead got: (
#21 207.3     movq 0x8(%rsp), %r12
#21 207.3             ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:67:14: error: Expected ,, instead got: (
#21 207.3     movq 0x10(%rsp), %r13
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:68:14: error: Expected ,, instead got: (
#21 207.3     movq 0x18(%rsp), %r14
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:69:14: error: Expected ,, instead got: (
#21 207.3     movq 0x20(%rsp), %r15
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:70:14: error: Expected ,, instead got: (
#21 207.3     movq 0x28(%rsp), %rbx
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:71:14: error: Expected ,, instead got: (
#21 207.3     movq 0x30(%rsp), %rbp
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:73:14: error: Expected ,, instead got: (
#21 207.3     leaq 0x40(%rsp), %rsp
#21 207.3              ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:81:10: error: Unexpected token in operand: $
#21 207.3     salq $32, %rsi
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:82:9: error: Unexpected token in operand: %
#21 207.3     orq %rsi, %rax
#21 207.3         ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:90:10: error: Unexpected token in operand: %
#21 207.3     movq %rax, %rdi
#21 207.3          ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:93:9: error: Unexpected token in operand: *
#21 207.3     jmp *%r8
#21 207.3         ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:94:1: warning: .size directive ignored for function symbols
#21 207.3 .size jump_fcontext,.-jump_fcontext
#21 207.3 ^
#21 207.3 /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S:97:19: error: Expected ,, instead got: -
#21 207.3 .section .note.GNU-stack,"",%progbits
#21 207.3                   ^
#21 207.4 emcc: error: '/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -I/emsdk/upstream/emscripten/cache/sysroot/include/SDL --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -IZend/asm/ -I/root/php-src/Zend/asm/ -I/root/php-src/include -I/root/php-src/main -I/root/php-src -I/root/php-src/ext/date/lib -I/root/php-src/TSRM -I/root/php-src/Zend -fno-common -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g3 -O2 -fvisibility=hidden -DZEND_SIGNALS -c -MMD -MF Zend/asm/jump_x86_64_sysv_elf_gas.dep -MT Zend/asm/jump_x86_64_sysv_elf_gas.lo /root/php-src/Zend/asm/jump_x86_64_sysv_elf_gas.S -o Zend/asm/jump_x86_64_sysv_elf_gas.o' failed (returned 1)

This resembles a gist I found that's labeled Compiling error of PHP 8.1.0 on 32 bit architecture. WASM is inherently 32-bit, and yet make tries to use the 640bit jump_x86_64_sysv_elf_gas – perhaps some flag that must be set to enforce using 32 files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions