fix(compile): bump libsui to 0.16.1 to survive eu-strip in flatpak - #35699
Merged
littledivy merged 3 commits intoJul 2, 2026
Conversation
Standalone binaries produced by `deno compile` segfaulted (exit 139) after `eu-strip` ran over them — which flatpak-builder does automatically during a flatpak build. libsui's in-place `Elf::append` (new in 0.16.0) relocates the program header table into a file gap before the appended note; eu-strip lays the stripped output out itself and zero-fills that gap unless an allocated section covers it, leaving an all-zero program header table. libsui 0.16.1 covers the relocated program header table with a dedicated allocated section so eu-strip preserves it. Adds a spec test that eu-strips a compiled binary and asserts it still runs. Fixes denoland#35633
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35633
Problem
Standalone binaries produced by
deno compilesegfault (exit 139) aftereu-stripruns over them — whichflatpak-builderdoes automatically during a flatpak build. Regression in Deno 2.9, bisected to the libsui 0.16.0 bump (#35467).Root cause
libsui's in-place
Elf::append(new in 0.16.0) relocates the program header table past the original EOF, into the file gap just before the appended note.eu-strip(elfutils, as run by flatpak-builder) lays the stripped output out itself withELF_F_LAYOUTand zero-fills every file gap that falls between two allocated sections. With only a note-sized.note.suisection past that gap, eu-strip treats the relocated program header table as dead space and zeroes it → all-NULL program headers → segfault on exec.Fix
libsui 0.16.1 (denoland/sui#75) covers the relocated program header table with a dedicated allocated
.sui.phdrssection so section-based strip tools preserve it. This bumps the dependency and adds a spec test thateu-strips a compiled binary and asserts it still runs (skips gracefully whereeu-stripisn't installed).Verification
Reproduced and fixed against the exact flatpak toolchain (elfutils 0.193, built from source) on Linux x86_64:
deno 2.9.0compiled binary + eu-strip 0.193 (flatpak flags) → segfault 139; with 0.16.1 → runs.bss, section-header-stripped, fully stripped) × eu-strip 0.193 & 0.190 → runs, program headers intactstripnote-survival preserved (unchanged from 0.16.0)