Skip to content

Fix missing __gnu_strerror_r on glibc hosts - #59

Open
Darfeikus wants to merge 1 commit into
minecraft-linux:masterfrom
Darfeikus:fix/gnu-strerror-r
Open

Darfeikus wants to merge 1 commit into
minecraft-linux:masterfrom
Darfeikus:fix/gnu-strerror-r

Conversation

@Darfeikus

Copy link
Copy Markdown

Problem

Minecraft 1.26.60.4 fails to load libpairipcore.so because the Android libc shim does not expose __gnu_strerror_r. The client then exits with signal 11.

Change

Register __gnu_strerror_r on glibc hosts using the native GNU strerror_r implementation and the existing Android-to-host errno translation. Preserve its char* return value: the existing shim::strerror_r has a POSIX int return value and cannot be used as an alias. Non-glibc builds and the existing strerror_r registration are unchanged.

Validation

  • Rebuilt and installed the native Arch launcher package with this patch.
  • Launched Minecraft 1.26.60.4 with client 7890498 / manifest ef9ceb8: the log reports both "Loaded libpairipcore" and "Loaded Minecraft library", and the process remains running past the original startup failure. This does not claim complete gameplay compatibility or validation of the beta version.
  • Ran a standalone C++ harness against the built libc-shim library: symbol registration and 12 comparisons against native GNU strerror_r passed, covering zero, known and unknown error codes with zero-length, one-byte and normal buffers.
  • git diff --check passes.

Related: minecraft-linux/mcpelauncher-manifest#2092, minecraft-linux/mcpelauncher-manifest#2095, minecraft-linux/mcpelauncher-manifest#2084.

The launcher manifest will also need to update its libc-shim submodule after this is merged.

Provide the char-pointer-returning __gnu_strerror_r symbol required by newer Android libraries without changing the existing POSIX strerror_r mapping.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 95f0e7b4-09d5-46e2-94d4-26475809d4c2
@ejalxndr

Copy link
Copy Markdown

Beat me to it.

I've tested my own solution which is functionally equivalent, so this should be good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants