Skip to content

xim:glibc ships no locale data and its compiled locale path points outside the payload, so every program runs in the C locale #621

Closed

Description

@Sunrisepeak

Observed

The xim:glibc payload ships no compiled locale data: there is no lib/locale/ and no locale-archive. The locale path compiled into libc.so.6 points outside the payload:

payload compiled-in locale path
2.44 /home/xlings/.xlings_data/xim/xpkgs/fromsource-x-glibc/2.44/lib/locale (the build machine)
2.44.3 /nonexistent/xlings-use-rpath-not-default-search/lib/locale (the placeholder)

As a result, every program that runs under this loader gets setlocale(LC_ALL, "") returning C, whatever the host's LANG is. Qt 6 reports this at startup:

Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, but has failed to switch to one.

The program's own multibyte and wide-character conversions (mbstowcs, std::locale("")) are limited to ASCII.

Measured: the payload's own localedef -i C -f UTF-8 produces C.utf8 (416 KB). With that directory supplied through LOCPATH, Qt switches to UTF-8:

Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.

Request

  1. The glibc payload ships lib/locale/C.utf8.
  2. The locale path compiled into libc.so.6 resolves to the payload's own lib/locale, for example by rewriting the placeholder prefix at install time, in the same way the interpreter is patched.

LOCPATH is not a substitute. It does not reach a packaged program that a user starts directly.

The fix spans the glibc recipe in xim-pkgindex and, if the prefix is rewritten at install time, xlings/libxpkg.

Activity

  1. Sunrisepeak commented on Sep 27, 2026

    @Sunrisepeak
    MemberAuthor

    Resolved by glibc 2.44.3 revision 1 (openxlings/xim-pkgindex#892), which xlings 2026.9.27.1 installs over a revision 0 payload (#620), and on the mcpp side by mcpp 2026.9.27.1 (mcpp-community/mcpp#719).

    • The payload's prefix is compiled in padded to 255 bytes and relocated to the install directory at install time, so the locale and gconv paths glibc was built with name the payload itself.
    • The payload carries a compiled C.utf8 and its gconv modules.
    • A self-contained (bundle-all) mcpp pack copies the payload's lib/locale and lib/gconv into the bundle, and the bundle's entry script exports LOCPATH and GCONV_PATH (a value the user already set is kept).

    Verified after the releases inside an xlings subos sandbox (xlings subos use eco-0927 --sandbox --cmd ..., mirror CN), with an isolated XLINGS_HOME or MCPP_HOME:

    1. xlings install glibc@2.44.3 with xlings 2026.9.27.1: the payload's locale -a lists C.utf8, and UTF-8 U+4E2D converts to GBK d6 d0 through the payload's own gconv modules.
    2. A C++ program built by mcpp 2026.9.27.1 with gcc 16.1.0 and packed with mcpp pack --mode self-contained: the bundle holds lib/locale (C.utf8) and lib/gconv, run.sh exports both variables, and the unpacked program, started with neither variable set, runs setlocale(LC_ALL, "C.UTF-8") and converts U+4E2D to GBK d6d0.
    3. A Qt Widgets program built with mcpp 2026.9.27.1, mcpp:plugins 0.16.0 and xim:qt-base 6.11.1: Qt now reports has switched to "C.UTF-8" where it reported that it failed to switch to a UTF-8 locale before; the program runs and renders its Chinese translation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions