summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/build/config.w322
-rw-r--r--win32/build/confutils.js35
-rw-r--r--win32/readdir.c4
-rw-r--r--win32/signal.c6
4 files changed, 33 insertions, 14 deletions
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index a7d60812bd..64053cc056 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -238,6 +238,7 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \
zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c zend_weakrefs.c \
zend_float.c zend_string.c zend_generators.c zend_virtual_cwd.c zend_ast.c \
zend_inheritance.c zend_smart_str.c zend_cpuinfo.c zend_observer.c zend_system_id.c");
+ADD_SOURCES("Zend\\Optimizer", "zend_optimizer.c pass1.c pass3.c optimize_func_calls.c block_pass.c optimize_temp_vars_5.c nop_removal.c compact_literals.c zend_cfg.c zend_dfg.c dfa_pass.c zend_ssa.c zend_inference.c zend_func_info.c zend_call_graph.c zend_dump.c escape_analysis.c compact_vars.c dce.c sccp.c scdf.c");
ADD_FLAG("CFLAGS_BD_ZEND", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
if (VS_TOOLSET && VCVERS >= 1914) {
@@ -277,6 +278,7 @@ if (VS_TOOLSET && VCVERS >= 1914) {
}
PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/ win32/");
+PHP_INSTALL_HEADERS("Zend/Optimizer", "zend_call_graph.h zend_cfg.h zend_dump.h zend_func_info.h zend_inference.h zend_optimizer.h zend_ssa.h");
STDOUT.WriteBlankLines(1);
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index bf88cdae44..38a5fb75aa 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -95,10 +95,10 @@ if (typeof(CWD) == "undefined") {
if (!MODE_PHPIZE) {
/* defaults; we pick up the precise versions from configure.ac */
var PHP_VERSION = 8;
- var PHP_MINOR_VERSION = 0;
+ var PHP_MINOR_VERSION = 1;
var PHP_RELEASE_VERSION = 0;
var PHP_EXTRA_VERSION = "";
- var PHP_VERSION_STRING = "8.0.0";
+ var PHP_VERSION_STRING = "8.1.0";
}
/* Get version numbers and DEFINE as a string */
@@ -1544,7 +1544,6 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
var _tmp = FSO.CreateTextFile(PHP_DIR + "/include/main/config.pickle.h", true);
_tmp.Close();
}
- cflags = "/FI main/config.pickle.h " + cflags;
}
ADD_FLAG("CFLAGS_" + EXT, cflags);
@@ -2209,7 +2208,7 @@ function generate_config_pickle_h()
var ln = outfile.ReadLine();
for (var i in keys) {
- var reg = new RegExp("#define[\s ]+" + keys[i] + "[\s ]*.*", "g");
+ var reg = new RegExp("#define[\s ]+" + keys[i] + "[\s ]*.*|#undef[\s ]+" + keys[i], "g");
if (ln.match(reg)) {
found = true;
@@ -2235,6 +2234,7 @@ function generate_config_pickle_h()
continue;
}*/
+ lines.push("#undef " + keys[i]);
lines.push("#define " + keys[i] + " " + item[0]);
}
@@ -2311,6 +2311,11 @@ function generate_config_h()
outfile.WriteLine("#define " + keys[i] + " " + pieces);
}
+ outfile.WriteBlankLines(1);
+ outfile.WriteLine("#if __has_include(\"main/config.pickle.h\")");
+ outfile.WriteLine("#include \"main/config.pickle.h\"");
+ outfile.WriteLine("#endif");
+
outfile.Close();
}
@@ -2939,25 +2944,25 @@ function toolset_setup_compiler()
WARNING("Using unknown MSVC version " + tmp);
- AC_DEFINE('COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
+ AC_DEFINE('PHP_BUILD_COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
DEFINE("PHP_COMPILER_SHORT", tmp);
AC_DEFINE('PHP_COMPILER_ID', tmp, "Compiler compatibility ID");
} else {
- AC_DEFINE('COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
+ AC_DEFINE('PHP_BUILD_COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
DEFINE("PHP_COMPILER_SHORT", COMPILER_NAME_SHORT.toLowerCase());
AC_DEFINE('PHP_COMPILER_ID', COMPILER_NAME_SHORT.toUpperCase(), "Compiler compatibility ID");
}
} else if (CLANG_TOOLSET) {
CLANGVERS = COMPILER_NUMERIC_VERSION;
- AC_DEFINE('COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
+ AC_DEFINE('PHP_BUILD_COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
DEFINE("PHP_COMPILER_SHORT", "clang");
AC_DEFINE('PHP_COMPILER_ID', "clang"); /* XXX something better were to write here */
} else if (ICC_TOOLSET) {
INTELVERS = COMPILER_NUMERIC_VERSION;
- AC_DEFINE('COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
+ AC_DEFINE('PHP_BUILD_COMPILER', COMPILER_NAME_LONG, "Detected compiler version");
DEFINE("PHP_COMPILER_SHORT", "icc");
AC_DEFINE('PHP_COMPILER_ID', "icc"); /* XXX something better were to write here */
}
@@ -3157,7 +3162,7 @@ function toolset_setup_arch()
} else {
STDOUT.WriteLine(" Detected 32-bit compiler");
}
- AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");
+ AC_DEFINE('PHP_BUILD_ARCH', X64 ? 'x64' : 'x86', "Detected compiler architecture");
DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86');
}
@@ -3399,6 +3404,12 @@ function toolset_setup_common_ldlags()
ADD_FLAG('LDFLAGS', "/GUARD:CF");
}
}
+ if (PHP_VS_LINK_COMPAT != "no") {
+ // Allow compatible IL versions, do not require an exact match.
+ // Prevents build failures where different libs were built with different (but compatible) IL versions.
+ // See fatal error C1047.
+ ADD_FLAG("LDFLAGS", "/d2:-AllowCompatibleILVersions ");
+ }
}
}
@@ -3748,3 +3759,9 @@ function setup_verbosity()
CMD_MOD2 = "@";
}
}
+
+try {
+ ARG_ENABLE('vs-link-compat', 'Allow linking of libraries built with compatible versions of VS toolset', 'yes');
+} catch (e) {
+ STDOUT.WriteLine("problem: " + e);
+}
diff --git a/win32/readdir.c b/win32/readdir.c
index efa7bd5966..8f24416b12 100644
--- a/win32/readdir.c
+++ b/win32/readdir.c
@@ -32,7 +32,7 @@ DIR *opendir(const char *dir)
HANDLE handle;
char resolved_path_buff[MAXPATHLEN];
size_t resolvedw_len, filespecw_len, index;
- zend_bool might_need_prefix;
+ bool might_need_prefix;
if (!VCWD_REALPATH(dir, resolved_path_buff)) {
return NULL;
@@ -151,7 +151,7 @@ int rewinddir(DIR *dp)
wchar_t *filespecw;
HANDLE handle;
size_t dirw_len, filespecw_len, index;
- zend_bool might_need_prefix;
+ bool might_need_prefix;
FindClose(dp->handle);
diff --git a/win32/signal.c b/win32/signal.c
index 23a5acbff9..7604a3aac9 100644
--- a/win32/signal.c
+++ b/win32/signal.c
@@ -22,7 +22,7 @@
/* true globals; only used from main thread and from kernel callback */
static zval ctrl_handler;
static DWORD ctrl_evt = (DWORD)-1;
-static zend_bool *vm_interrupt_flag = NULL;
+static bool *vm_interrupt_flag = NULL;
static void (*orig_interrupt_function)(zend_execute_data *execute_data);
@@ -89,7 +89,7 @@ PHP_FUNCTION(sapi_windows_set_ctrl_handler)
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
- zend_bool add = 1;
+ bool add = 1;
/* callable argument corresponds to the CTRL handler */
@@ -134,7 +134,7 @@ PHP_FUNCTION(sapi_windows_set_ctrl_handler)
PHP_FUNCTION(sapi_windows_generate_ctrl_event)
{/*{{{*/
zend_long evt, pid = 0;
- zend_bool ret = 0;
+ bool ret = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &evt, &pid) == FAILURE) {
RETURN_THROWS();