You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: crt* Objects not found in library search path after #158823 #160446
I faced a regression in building rust for l4re introduced by #158823. The core of the problem seems to be that FileSearch (from compilter/rustc_session/src/filesearch.rs) is used both to locate C runtime objects (crt*) and native libraries. However, #158823 introduces a prefix-filtering of the files found in the search paths (given by "-L" or "-Lnative") and this prefix only selects libraries and discards crt objects:
let prefixes = ["lib",&target.staticlib_prefix,&target.dll_prefix];
...if !prefixes.iter().any(|prefix| filename.starts_with(prefix)){returnNone;}
A bit more detailled: My target config uses pre_link_objects to define the file names of the crt* files. These files are searched for in rustc_codegen_ssa/src/back/link.rs in link_natively(...) via get_object_file_path(..) which after the change uses get_file_candidates(...) which due to the filtering explained above only includes libraries.
Bah, I knew that I should skip this micro-optimization and only use get_file_candidates for the rlib lookup. Thanks for the report! #160449 should hopefully fix this.
Activity
lqd commentedon Aug 3, 2026
cc @Kobzol
Kobzol commentedon Aug 3, 2026
Bah, I knew that I should skip this micro-optimization and only use
get_file_candidatesfor the rlib lookup. Thanks for the report! #160449 should hopefully fix this.Rollup merge of rust-lang#160449 - Kobzol:filesearch-lookup-fix, r=pe…
Rollup merge of rust-lang#160449 - Kobzol:filesearch-lookup-fix, r=pe…
Rollup merge of rust-lang#160449 - Kobzol:filesearch-lookup-fix, r=pe…
Rollup merge of rust-lang#160449 - Kobzol:filesearch-lookup-fix, r=pe…
Unrolled build for #160449
Rollup merge of #160449 - Kobzol:filesearch-lookup-fix, r=petrochenkov