PHP 8.2.7 check that vcruntime140.dll is have the linker version equal to the version of the linker of the toolchain used to build itself, and refuse to start otherwise, with this error message:
`PHP Warning: 'C:\windows\system32\VCRUNTIME140.dll' 2.39 is not compatible with this PHP build linked with 14.29 in Unknown on line 0`
Setting the linker version in winebuild to 14.29 allow php to pass this check.
If there are concerns to having this change global, I could try to make this as argument to winebuild with the value setted somewhere into the build system
From: Lorenzo Ferrillo lorenzofersteam@live.it
--- tools/winebuild/spec32.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index f06c40ca9b1..17cf27467ba 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -45,6 +45,8 @@ #define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
+#define LINKER_VERSION_MAJOR 14 +#define LINKER_VERSION_MINOR 29 /*14.29 vs2019 64bit redist*/ int needs_get_pc_thunk = 0;
static const char builtin_signature[32] = "Wine builtin DLL"; @@ -798,8 +800,8 @@ void output_module( DLLSPEC *spec ) spec->characteristics ); output( "\t.short 0x%04x\n", /* Magic */ get_ptr_size() == 8 ? IMAGE_NT_OPTIONAL_HDR64_MAGIC : IMAGE_NT_OPTIONAL_HDR32_MAGIC ); - output( "\t.byte 7\n" ); /* MajorLinkerVersion */ - output( "\t.byte 10\n" ); /* MinorLinkerVersion */ + output( "\t.byte %u\n", LINKER_VERSION_MAJOR); /* MajorLinkerVersion */ + output( "\t.byte %u\n", LINKER_VERSION_MINOR ); /* MinorLinkerVersion */ output( "\t.long 0\n" ); /* SizeOfCode */ output( "\t.long 0\n" ); /* SizeOfInitializedData */ output( "\t.long 0\n" ); /* SizeOfUninitializedData */ @@ -1217,8 +1219,8 @@ static void output_pe_file( DLLSPEC *spec, const char signature[32] ) put_word( get_ptr_size() == 8 ? IMAGE_NT_OPTIONAL_HDR64_MAGIC : IMAGE_NT_OPTIONAL_HDR32_MAGIC ); /* Magic */ - put_byte( 7 ); /* MajorLinkerVersion */ - put_byte( 10 ); /* MinorLinkerVersion */ + put_byte( LINKER_VERSION_MAJOR ); /* MajorLinkerVersion */ + put_byte( LINKER_VERSION_MINOR ); /* MinorLinkerVersion */ put_dword( code_size ); /* SizeOfCode */ put_dword( data_size ); /* SizeOfInitializedData */ put_dword( 0 ); /* SizeOfUninitializedData */ @@ -1473,6 +1475,7 @@ void output_def_file( DLLSPEC *spec, struct exports *exports, int import_only ) void make_builtin_files( struct strarray files ) { int i, fd; + char linker_version[2] = {LINKER_VERSION_MAJOR, LINKER_VERSION_MINOR}; struct { unsigned short e_magic; @@ -1490,6 +1493,10 @@ void make_builtin_files( struct strarray files ) fatal_error( "%s: Not enough space (%x) for Wine signature\n", files.str[i], header.e_lfanew ); write( fd, builtin_signature, sizeof(builtin_signature) );
+ unsigned int pos_linker = header.e_lfanew + 0x1a; + lseek( fd, pos_linker, SEEK_SET ); + write(fd,linker_version, sizeof(linker_version)); + if (prefer_native) { unsigned int pos = header.e_lfanew + 0x5e; /* OptionalHeader.DllCharacteristics */