MINGW-packages icon indicating copy to clipboard operation
MINGW-packages copied to clipboard

GLib2 fails to configure when all dependencies are static

Open brisingraerowing opened this issue 3 years ago • 4 comments

Description

What I'm doing is probably not an intended use of the system, but I'm building a number of programs as statically linked for use in the build process of another program I'm working on. When trying to compile GLib2 (for shared-mime-info), Meson fails to find libintl, and from the logs it's looking for a method called __builtin_ngettext. This might be a Meson bug (or quirk).

Meson Output Log

Verification

  • [X] I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)

Windows Version

Microsoft Windows [Version 10.0.22000.978]

MINGW environments affected

  • [X] MINGW64
  • [ ] MINGW32
  • [ ] UCRT64
  • [ ] CLANG64
  • [ ] CLANG32
  • [ ] CLANGARM64

Expected behavior

GLib configures for build

Actual behavior

Configure process fails

Repro steps

  1. Attempt to build Glib2 as static with all static dependencies
  2. Observe configure failure

Are you willing to submit a PR?

I have no idea what's broken, so no.

brisingraerowing avatar Sep 28 '22 00:09 brisingraerowing

-Dc_links_args="-lintl -liconv" -Dcpp_links_args="-lintl -liconv" should get the build working. The problem is libintl doesn't have a pkg-config file. I encountered something similar when building Mesa3D statically.

pal1000 avatar Sep 28 '22 22:09 pal1000

Would adding a pkgconfig file mitigate the issue? If yes can you provide any sample pkgconfig file that would fix the issue? I can try to ask upstream.

Biswa96 avatar Sep 29 '22 03:09 Biswa96

The bug is with gettext not providing a pkgconfig file. Same problem as here.

Though it also worth looking how glib2 lookup gettext dependency to make sure it's doing the right thing.

Update: I checked glib2 source at 2.74.0 and it's using dependency() call to find intl as it should which leaves gettext missing pc file as the only problem

To workaround this issue your Meson build setup command must contain this: --prefer-static -Dc_links_args="-static -lintl -liconv" -Dcpp_links_args="-static -lintl -liconv"

pal1000 avatar Sep 29 '22 08:09 pal1000

I'll try that later. Currently fighting with the Curseforge App while working on a Minecraft modpack.

brisingraerowing avatar Sep 30 '22 22:09 brisingraerowing