[php-src] Issue #14970: Unknown addr size on arm64 at MSVC 19.41.34115.96
| From: | brianGriifin114 | Date: | Tue, 16 Jul 2024 09:54:14 +0000 |
| Subject: | [php-src] Issue #14970: Unknown addr size on arm64 at MSVC 19.41.34115.96 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247300@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14970
Author: brianGriifin114
### Description
The Microsoft MSVC team uses PHP and other open source projects as part of the compiler testing. We
found that PHP will report an error when building on the arm64 architecture.
```
| | |
-------------------------------------------------------
| Build type | Release |
| Thread Safety | Yes |
| Compiler | MSVC 19.41.34115.96, untested |
| Target Architecture | arm64 |
| Host Architecture | x64 |
| Optimization | PGO disabled |
| Native intrinsics | NEON |
| Static analyzer | disabled |
-------------------------------------------------------
Type 'nmake' to build PHP
##[debug] Command #4 exited with code [0].
##[command] Command #5 (Output in "Build.log"): nmake 2>&1
Microsoft (R) Program Maintenance Utility Version 14.41.34115.96
Copyright (C) Microsoft Corporation. All rights reserved.
Recreating build dirs
bison.exe -Wall --output=Zend/zend_ini_parser.c -v -d Zend/zend_ini_parser.y
bison.exe -Wall --output=Zend/zend_language_parser.c -v -d Zend/zend_language_parser.y
"re2c.exe" --no-generation-date --case-inverted -cbdFt Zend/zend_ini_scanner_defs.h
-oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l
"re2c.exe" --no-generation-date --case-inverted -cbdFt Zend/zend_language_scanner_defs.h
-oZend/zend_language_scanner.c Zend/zend_language_scanner..l
bison.exe -Wall --output=sapi/phpdbg/phpdbg_parser.c -v -d sapi/phpdbg/phpdbg_parser.y
"re2c.exe" --no-generation-date -cbdFo sapi/phpdbg/phpdbg_lexer.c
sapi/phpdbg/phpdbg_lexer.l
type ext\pcre\php_pcre.def > C:\gitP\php\php-src\arm64\Release_TS\php8ts..dll.def
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\x64\mc.exe" -h win32\ -r
C:\gitP\php\php-src\arm64\Release_TS\ -x C:\gitP\php\php-src\arm64\Release_TS\
win32\build\wsyslog.mc
MC: Compiling win32\build\wsyslog.mc
"cl.exe" /D ZEND_COMPILE_DL_EXT=1 /D COMPILE_DL_OPCACHE /D OPCACHE_EXPORTS=1
/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "ext\opcache\jit" /DHAVE_IR_IR_H=1 /I
"ext\opcache\jit\ir" /D IR_TARGET_X64 /D IR_PHP /DHAVE_CAPSTONE_CAPSTONE_H=0 /I
ext\opcache /nologo /I . /I main /I Zend /I TSRM /I ext /D _WINDOWS /D WINDOWS=1 /D ZEND_WIN32=1 /D
PHP_WIN32=1 /D WIN32 /D _MBCS /D _USE_MATH_DEFINES /FD /wd4996 /Qspectre /guard:cf /Zc:inline
/Zc:__cplusplus /d2FuncCache1 /Zc:wchar_t /MP8 /LD /MD /Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0
/D ZTS=1 /I "C:\gitP\php\php-src\no\include" /D FD_SETSIZE=256
/FoC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\
/FpC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\
/FRC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\
/FdC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\ /c ext\opcache\ZendAccelerator.c
ext\opcache\shared_alloc_win32.c ext\opcache\zend_accelerator_blacklist.c
ext\opcache\zend_accelerator_debug.c ext\opcache\zend_accelerator_hash.c
ext\opcache\zend_accelerator_module.c ext\opcache\zend_accelerator_util_funcs.c
ext\opcache\zend_file_cache.c ext\opcache\zend_persist.c ext\opcache\zend_persist_calc.c
ext\opcache\zend_shared_alloc.c
ZendAccelerator.c
shared_alloc_win32.c
zend_accelerator_blacklist.c
zend_accelerator_debug.c
zend_accelerator_hash.c
zend_accelerator_module.c
zend_accelerator_util_funcs.c
zend_file_cache.c
zend_persist.c
zend_persist_calc.c
zend_shared_alloc.c
"cl.exe" /D ZEND_COMPILE_DL_EXT=1 /D COMPILE_DL_OPCACHE /D OPCACHE_EXPORTS=1
/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "ext\opcache\jit" /DHAVE_IR_IR_H=1 /I
"ext\opcache\jit\ir" /D IR_TARGET_X64 /D IR_PHP /DHAVE_CAPSTONE_CAPSTONE_H=0 /I
ext\opcache /nologo /I . /I main /I Zend /I TSRM /I ext /D _WINDOWS /D WINDOWS=1 /D ZEND_WIN32=1 /D
PHP_WIN32=1 /D WIN32 /D _MBCS /D _USE_MATH_DEFINES /FD /wd4996 /Qspectre /guard:cf /Zc:inline
/Zc:__cplusplus /d2FuncCache1 /Zc:wchar_t /MP8 /LD /MD /Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0
/D ZTS=1 /I "C:\gitP\php\php-src\no\include" /D FD_SETSIZE=256
/FoC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\
/FpC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\
/FRC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\
/FdC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\ /c ext\opcache\jit\zend_jit.c
ext\opcache\jit\zend_jit_vm_helpers.c
zend_jit.c
zend_jit_vm_helpers.c
ext\opcache\jit/ir/ir.h(75): fatal error C1189: #error: "Unknown addr size" (compiling
source file ext\opcache\jit\zend_jit.c)
warning C1511: creating
'C:\a\_work\_temp\rwc_project_logs\PHP7\preprocessed_repro_build\zend_jit.rsp' for
capture_repro
ext\opcache\jit/ir/ir.h(75): fatal error C1189: #error: "Unknown addr size" (compiling
source file ext\opcache\jit\zend_jit.c)
NMAKE : fatal error U1077: '"cl.exe" /D ZEND_COMPILE_DL_EXT=1 /D COMPILE_DL_OPCACHE
/D OPCACHE_EXPORTS=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /I "ext\opcache\jit"
/DHAVE_IR_IR_H=1 /I "ext\opcache\jit\ir" /D IR_TARGET_X64 /D IR_PHP
/DHAVE_CAPSTONE_CAPSTONE_H=0 /I ext\opcache /nologo /I . /I main /I Zend /I TSRM /I ext /D _WINDOWS
/D WINDOWS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /D _USE_MATH_DEFINES /FD /wd4996
/Qspectre /guard:cf /Zc:inline /Zc:__cplusplus /d2FuncCache1 /Zc:wchar_t /MP8 /LD /MD /Ox /D NDebug
/D NDEBUG /GF /D ZEND_DEBUG=0 /D ZTS=1 /I "C:\gitP\php\php-src\no\include" /D
FD_SETSIZE=256 /FoC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\
/FpC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\
/FRC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\
/FdC:\gitP\php\php-src\arm64\Release_TS\ext\opcache\jit\ /c ext\opcache\jit\zend_jit.c
ext\opcache\jit\zend_jit_vm_helpers.c' : return code '0x2'
Stop.
```
We found the error in ext\opcache\jit/ir/ir.h(75), which seems to be because the pointer size of the
arm64 platform is not defined at the beginning.
```
#ifdef _WIN32
/* TODO Handle ARM, too. */
# if defined(_M_X64)
# define __SIZEOF_SIZE_T__ 8
# elif defined(_M_IX86)
# define __SIZEOF_SIZE_T__ 4
# endif
```
maybe we should change it to this?
```
#if defined(_M_X64) || defined(__x86_64__) || defined(__aarch64__) || defined(_M_ARM64)
#define __SIZEOF_SIZE_T__ 8
```
For more information, I attach build.log and setup.log for reference.If you need more information
please leave a message.
[Build (1).log](https://github.com/user-attachments/files/16246812/Build.1.log)
[Setup (2).log](https://github.com/user-attachments/files/16246813/Setup.2.log)
### PHP Version
8.4.0-dev
### Operating System
Windows