Skip to content

Commit

Permalink
Rollup merge of rust-lang#74416 - NieDzejkob:linker-locale-utf8, r=ol…
Browse files Browse the repository at this point in the history
…i-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.
  • Loading branch information
Manishearth committed Jul 17, 2020
2 parents cab04ec + 2ff13d9 commit 1117375
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/librustc_codegen_ssa/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor};
pub fn disable_localization(linker: &mut Command) {
// No harm in setting both env vars simultaneously.
// Unix-style linkers.
linker.env("LC_ALL", "C");
// We use an UTF-8 locale, as the generic C locale disables support for non-ASCII
// bytes in filenames on some platforms.
linker.env("LC_ALL", "en_US.UTF-8");
// MSVC's `link.exe`.
linker.env("VSLANG", "1033");
}
Expand Down

0 comments on commit 1117375

Please sign in to comment.