From 01e723015b74a14cb3bec87e10f6aa8b580e2154 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Tue, 13 Nov 2018 09:50:00 -0800 Subject: [PATCH] Added linker flag too --- source/pdo_sqlsrv/config.w32 | 2 ++ source/sqlsrv/config.w32 | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/pdo_sqlsrv/config.w32 b/source/pdo_sqlsrv/config.w32 index 6ab43ebfd..8b8e4f29a 100644 --- a/source/pdo_sqlsrv/config.w32 +++ b/source/pdo_sqlsrv/config.w32 @@ -37,10 +37,12 @@ if( PHP_PDO_SQLSRV != "no" ) { if (PHP_DEBUG != "yes") ADD_FLAG( "CFLAGS_PDO_SQLSRV", "/guard:cf /O2" ); ADD_FLAG( "CFLAGS_PDO_SQLSRV", "/D ZEND_WIN32_FORCE_INLINE" ); if (VCVERS >= 1913) { + ADD_FLAG("LDFLAGS_PDO_SQLSRV", "/d2:-guardspecload"); ADD_FLAG("CFLAGS_PDO_SQLSRV", "/Qspectre"); } else if (VCVERS == 1900) { var subver1900 = probe_binary(PHP_CL).substr(6); if (subver1900 >= 24241) { + ADD_FLAG("LDFLAGS_PDO_SQLSRV", "/d2:-guardspecload"); ADD_FLAG('CFLAGS_PDO_SQLSRV', "/Qspectre"); } } diff --git a/source/sqlsrv/config.w32 b/source/sqlsrv/config.w32 index 33203f448..e4cd19d01 100644 --- a/source/sqlsrv/config.w32 +++ b/source/sqlsrv/config.w32 @@ -36,10 +36,12 @@ if( PHP_SQLSRV != "no" ) { ADD_FLAG( "CFLAGS_SQLSRV", "/GS" ); ADD_FLAG( "CFLAGS_SQLSRV", "/Zi" ); if (VCVERS >= 1913) { + ADD_FLAG("LDFLAGS_SQLSRV", "/d2:-guardspecload"); ADD_FLAG("CFLAGS_SQLSRV", "/Qspectre"); } else if (VCVERS == 1900) { var subver1900 = probe_binary(PHP_CL).substr(6); if (subver1900 >= 24241) { + ADD_FLAG("LDFLAGS_SQLSRV", "/d2:-guardspecload"); ADD_FLAG('CFLAGS_SQLSRV', "/Qspectre"); } } @@ -47,5 +49,5 @@ if( PHP_SQLSRV != "no" ) { EXTENSION("sqlsrv", sqlsrv_src_class , PHP_SQLSRV_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); } else { WARNING("sqlsrv not enabled; libraries and headers not found"); - } + } }