Repository navigation
Link on any Linux layout: host libraries from the loader, runtime beside the compiler, and four fixes found running WIPE on a Steam Deck - #2361
Merged
Conversation
added 5 commits
October 12, 2026 00:37
…s the machine `with run` on SteamOS failed to link raylib's -lGL/-lX11 though both were installed: the native link searched only Debian's multiarch directories, and Arch keeps them in /usr/lib (Fedora in /usr/lib64). Three places each guessed a Debian layout: the own-sysroot link's -L dirs, the gcc path's -L dirs with its hand-listed z/zstd/xml2 sonames and Debian-only crt/gcc lookup, and `with get`'s system-package resolution. compiler.HostLibs now owns the answer. The directories are the host's: LIBRARY_PATH, the loader's trusted directories that exist, and everything /etc/ld.so.conf names (includes followed). ld.so.conf names other machines' libraries too (SteamOS lists /usr/lib32), and lld refuses an incompatible library rather than skipping it as GNU ld does, so each candidate's ELF header (an archive's first object) is checked against the target. A runtime-only soname still links by path when the dev symlink is absent. A library in a directory the link names (a package's own, the sysroot's) keeps -l<name>: a package's archive never gives way to a same-named host library. `with get` records names only; the link resolves them on the machine that links. test/internals/host_libs_test.w replaces conan_host_lib_test.w: sonames, other-machine .so and .a, linker scripts, -l:file, ld.so.conf parsing.
… PATH
link_stage_compiler_runtime_dir and link_stage_resolve_runtime_root took
dirname(argv[0]) as the compiler's directory. Run from PATH, argv[0] is a
bare `with`, whose dirname is the cwd, so a compiler whose runtime sits
beside it (a stage1 copied with its lib/) looked in ./runtime and ./../lib
and refused every link ("no runtime objects of this compiler's
generation"). Both now read with_self_exe(), which the Linux link already
uses to run its own linker.
…s stale
`.executable("spiral", "src/main.w")` declares no output and makes
out/bin/spiral. The cache collected only target.output, so it tracked no
output for any executable: a deleted binary stayed "fresh", `with build`
did nothing, and `with run` reported the target "did not produce
executable output".
build_graph_target_output_path (BuildGraphSupport) is now the one answer
for a target's file by kind; the output-ownership check and the cache read
it, as `with run` reads build_graph_output_path.
behav_build_cache_executable_output.w fails at e4861e1 ("fresh" after
the binary is removed) and passes here.
On x86-64 and AArch64 Linux, `long double` is x87 extended or binary128,
c_longdouble is not defined (ci_c_type_aliases), and a declaration that
needs it is to be omitted. ClangBridge translated it to c_longdouble
unconditionally, so `use c_import("SDL3/SDL.h", ...)` failed with
"unknown type 'c_longdouble'" on glibc's wcstold.
- ClangBridge: long double is c_longdouble where clang sizes it as a
double (8 bytes: Apple arm64, Windows), else __UNSUPPORTED with the
reason, which omits an extern as any untranslatable type does.
- CImport: an inline function's signature is checked for __UNSUPPORTED as
an extern's is; before, the reason text was printed as a type.
- CImport: an `L` float macro is omitted on such a target.
behav_2176_long_double_omitted.w covers an extern, an inline function, a
pointer return, an `L` literal and a cast macro.
…ence
glibc's assert(e) is `((void) sizeof ((e) ? 1 : 0), ({ if (e) ; else
__assert_fail (...); }))`. The NULL-test walk read the `?:` under the
sizeof as a test whose NULL branch continues (its `0`), so on Linux
`assert(cb != NULL)` made `cb` Option and c-migrator-basic-tests failed:
"contract param 0: Option: body tests it for NULL and continues". The
call-evidence walk had the same hole: `sizeof(f(NULL))` read as a NULL
caller. Both walks, and the aborts check, stop at CXK_UNARY_EXPR (sizeof,
_Alignof), whose operand is a type's, never a value.
The fixture's `sized` fails on every host before this, not only on glibc.
added 2 commits
October 12, 2026 11:26
Four compiler sites each derived it (TMPDIR or /tmp; TMP, then TEMP, on
Windows in two of them; a trailing slash trimmed in one), and five
internals tests used `runtime_getenv("TMPDIR") ++ "/with-…"` with no
fallback. TMPDIR is set by a macOS login, not by a Linux one: under ssh on
eric-5090 the battery's internals-tests failed in archive_formats_test,
tar_extract_test and link_elf_undefined_symbols_test with "could not
create /with-archive-formats-93916/pkg-1.0.tar.xz", at the filesystem
root. compiler.Runtime's runtime_temp_dir is the one derivation; every site
and test reads it.
…ver's build-w-workspace-message-complete appends a flag to the PreLink command in that linker's syntax, and chose `-Wl,--gc-sections` on Linux, a C driver's spelling. Every native Linux link has been the compiler's own ELF lld since #1915 (D81), which refused it on eric-5090: "ld.lld: error: unknown argument '-Wl,--gc-sections'". The flag is `--gc-sections`.
added 2 commits
October 12, 2026 14:26
pcre2test prints a freed block's size only when the block's address is in its malloc list. check_match_limit (pcre2test_inc.h:3070) frees the cached heap frames on every find_limits retry while show_memory is off, so the list keeps a stale entry, and a later free prints its size only if malloc returned that same address again. Upstream's RunTest says this test's output "may vary in different environments" and runs it only on request. Evidence on eric-5090 (glibc 2.43): - the C pcre2test built by gcc fails upstream's testoutputheap-8 too (pattern 2: "free unremembered block" where we expected "free 20480"); - under gdb, the C pcre2test and the migrated one make the same 146 my_malloc/my_free calls, with the same sizes, in the same order; only the addresses glibc returns differ. The normalizer had rewritten upstream's expected output into the Mac's address reuse (pattern 2 "free 20480"), so Linux was red. The heap test now runs on its own and compares every free as "free": allocation sizes, frame sizes, heapframes sizes and the order and count of frees still compare. The match-data size (128 -> 152) stays a plain size rewrite.
…ot walked check_live_views_for_origin runs for every binding leaving scope and asks every live binding in the function about it. It computed type_owns_user_drop(view_ty), an uncached recursive walk over the type's fields, variants and arguments, before asking whether that binding depends on the departing origin at all, and almost none do. The dependency predicates are read-only, so asking them first decides the same programs. perf on eric-5090, release `with check src/main.w` (109 s, 106 s user): pop_scope 49% inclusive, check_live_views_for_origin 42.5%, type_owns_user_drop 37%, half of it SipHash in hm_find_slot. With the change, type_owns_user_drop drops out of the profile. issue61-regression runs this check under a 180 s limit and timed out at 182.6 s in the battery (#2362). test/compile_errors under the fixed stage1 fails the same 22 files as the release compiler without the change.
This was referenced Oct 12, 2026
Contributor
Author
|
Battery GREEN at 2b4a12e on linux-x86_64 (eric-5090), driven by the pinned seed: gate rc=0 (734 s), uat rc=0 (34 s), battery-checks rc=0 (1443 s). The two reds from the previous run are fixed:
|
ehartford
marked this pull request as ready for review
October 12, 2026 23:36
ehartford
added a commit
that referenced
this pull request
Oct 15, 2026
…ded go (D111: a str is a value, a push copies it; a consuming List parameter never needs a call-site `move`). Main's ceremony census was red after #2361 merged under #2422: clone-call in src 537 -> 543, move-arg 847 -> 854; this brings both under the bar. (#2423) Co-authored-by: Eric Hartford <[email protected]>
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.
On SteamOS (Arch),
with runin a raylib project (~/with/spiral) failed to link withunable to find library -lGL/-lX11. The library search knew Debian's multiarch layout and nothing else, so other distributions failed one by one. This PR makes the link ask the host where its libraries are, so it works on any glibc Linux layout without a list of distributions. Four more fixes came up on the way to building and running WIPE on a Steam Deck.Commits
src/compiler/HostLibs.w, new). One resolver for the link and forwith get.LIBRARY_PATH, the dynamic loader's trusted directories, and every directory/etc/ld.so.confnames (includes and globs read as ldconfig reads them).-l<name>resolves to:lib<name>.so, then.a, else the highestlib<name>.so.N. A runtime package installs only the soname;-l:<file>is also honored.e_machine(or an archive's first member) is checked against the target. SteamOS lists/usr/lib32, and lld refuses an incompatible library where GNU ld skips it.test/internals/host_libs_test.w, renamed fromconan_host_lib_test.w.with_self_exe), notargv[0]. So awithfound through PATH (~/.local/bin/with) finds its runtime.with runsaidrun target 'spiral' did not produce executable output. Test:test/behavior/behav_build_cache_executable_output.wfails at the old HEAD and passes here.long double. It maps toc_longdoubleonly where clang sizes it at 8 bytes. On x86_64 Linux it is 16 bytes, and an extern, an inline function, a pointer slot or anLfloat macro that needs it is omitted and recorded, never mistyped. Test:test/behavior/behav_2176_long_double_omitted.w.sizeofruns, so nothing under it is evidence.assert(e)wrapsein(void) sizeof ((e) ? 1 : 0). The migrator read that?:as a NULL test whose NULL branch continues, soc-migrator-basic-testswas red on Linux (contract param 0: Option). The same hole madesizeof(f(NULL))count as a NULL caller.nightly-20261011binary gives the same wrong verdict.sizedcase fails on every host before the fix, not only on glibc.Evidence
src/main build :gateis green on eric-5090 (linux-x86_64), driven by the pinned seednightly-20261011-local-2-e4861e1d6997. It ran at this branch's head (8e449af), based on c97a008. A fresh worktree has no battery measurements, so the gate ran the fixed list only.with runin the spiral project links and runs on a Steam Deck. WIPE (raylib + SDL3 + Steam) builds and runs there too.Filed along the way
#2353 (LLVM_PREFIX worktree), #2354 (one-liners adopt the enclosing project), #2360 (a stale seed cannot fetch the pinned seed).