Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17279

Windows : link C runtime dynamically

    XMLWordPrintable

Details

    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
      The downside is large package size, servicing and security. In case of a security bug in CRT, users would need executables that are recompiled with the CRT versions that contain fixes (contrast with dynamic linking, where CRT security fixes would be delivered by the Windows update)

      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
      is to change our build to use dynamic C runtime linking. This means CRT needs to be installed on the target computer, but this is likely already be the case since Windows 10 already includes Universal CRT (UCRT) as part of OS, and on downlevel OSes it comes as part of popular packages

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.