[MDEV-17279] Windows : link C runtime dynamically Created: 2018-09-24 Updated: 2021-11-11 Resolved: 2018-10-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Packaging, Platform Windows |
| Fix Version/s: | 10.4.0 |
| Type: | Task | Priority: | Major |
| Reporter: | Vladislav Vaintroub | Assignee: | Vladislav Vaintroub |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Traditionally, MariaDB links C and C++ runtimes statically , with /MT compiler option. The upside of it is that mariadb server linked this way can run anywhere, and does not need C runtime to be installed on the box . The problem with static linking Another downside is that static linking requires careful considerations when programming, e.g 2 different DLLs cannot use each other's CRT objects. Which means, file descriptors or FILE* cannot be passed around between mysqld.exe and plugins, memory allocated with malloc() from one DLL can only be free()d in the same dll and so on. The task |
| Comments |
| Comment by Vladislav Vaintroub [ 2018-10-09 ] |
|
probably interesting how Microsoft itself handles this for dotnet core https://github.com/dotnet/coreclr/pull/4381/commits/7902a3a3eee17378a61ef6817af5e73dc3050cfc the avoid dependency of compiler runtime (link with /MT), but force shared UCRT dependency. (/NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib) |