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)) {
return None;
}
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.
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:
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.rsinlink_natively(...)viaget_object_file_path(..)which after the change usesget_file_candidates(...)which due to the filtering explained above only includes libraries.