Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • fasterthanlime
  • GLib
  • Merge requests
  • !1

Draft: Patch gobject & glib for static linking

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open fasterthanlime requested to merge amos/win-msvc-static-linking into main Dec 04, 2021
  • Overview 32
  • Commits 21
  • Pipelines 21
  • Changes 11

These changes enable producing a static build of glib on Windows with MSVC.

See GNOME/glib!1655 for prior art.

(This MR is intentionally opened against fasterthanlime/glib rather than GNOME/glib, because it is not meant to be merged, I just want a convenient view of what my current changeset is.)

General approach

From @lb90 in their MR:

  1. Use CreateProcess directly instead of CRT _wspanw* functions where applicable.
  2. Switch to using FLS in the GPrivate implementation on Windows.
  3. Move the code that now resides in DllMain and handles DLL_PROCESS_ATTACH into a PE constructor.
  4. Modify the build definitions to allow static builds on Windows.

Dependencies

This MR needs these to land first:

  • libffi: set FFI_STATIC_BUILD
  • proxy-libintl: set G_INTL_STATIC_COMPILATION

CI pipelines

This adds two CI pipelines. Both msys2-mingw32 and vs2017-x64 got -static and -shared variants.

Tests

Not all tests are expected to run on MSVC builds anyway (even dynamic ones), here's a list of expected failures (taken from a recent main run):

https://gist.github.com/fasterthanlime/89b740e9eef045c8d33759c0693174b5

Edited Dec 06, 2021 by fasterthanlime
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: amos/win-msvc-static-linking