Commit 5fe2823
authored
Fix Windows ZTS shared-build LNK2001 on _tsrm_ls_cache (#1674)
Drop /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 from the sqlsrv and pdo_sqlsrv
EXTENSION() calls in config.w32.
On thread-safe (ZTS) shared builds this define made init.cpp / pdo_init.cpp
define _tsrm_ls_cache with C linkage (php_sqlsrv.h / php_pdo_sqlsrv.h are
included inside an extern "C" block), while the shared core_*.cpp translation
units reference it with C++ linkage (core_sqlsrv.h includes php.h outside
extern "C"). The linkage mismatch produced:
core_stmt.obj : error LNK2001: unresolved external symbol
"void * _tsrm_ls_cache" (?_tsrm_ls_cache@@3PEAXEA)
fatal error LNK1120: 1 unresolved externals
Removing the define makes the Windows shared build resolve the TSRM cache
through the engine (tsrm_get_ls_cache()), matching the Linux/macOS config.m4
builds and the Windows static build. NTS builds are unaffected.1 parent c0edf0c commit 5fe2823
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
0 commit comments