Skip to content

Commit eef22da

Browse files
authored
Rollup merge of #74416 - NieDzejkob:linker-locale-utf8, r=oli-obk
Use an UTF-8 locale for the linker. Using a `C` locale breaks unicode filenames on Guix, where the linker is wrapped by a Guile program.
2 parents 87d01d1 + 2ff13d9 commit eef22da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_codegen_ssa/back/linker.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor};
2828
pub fn disable_localization(linker: &mut Command) {
2929
// No harm in setting both env vars simultaneously.
3030
// Unix-style linkers.
31-
linker.env("LC_ALL", "C");
31+
// We use an UTF-8 locale, as the generic C locale disables support for non-ASCII
32+
// bytes in filenames on some platforms.
33+
linker.env("LC_ALL", "en_US.UTF-8");
3234
// MSVC's `link.exe`.
3335
linker.env("VSLANG", "1033");
3436
}

0 commit comments

Comments
 (0)