From fcc0f7857cb17244dfa1deb6f5caf57bcc2230ad Mon Sep 17 00:00:00 2001 From: messense Date: Mon, 23 Dec 2024 13:42:08 +0800 Subject: [PATCH] Link to `oldnames` by default when using `clang` (#139) Closes #138 --- src/compiler/clang.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/compiler/clang.rs b/src/compiler/clang.rs index 5e02fcf..b804be1 100644 --- a/src/compiler/clang.rs +++ b/src/compiler/clang.rs @@ -83,9 +83,12 @@ impl Clang { ); let mut rustflags = get_rustflags(&workdir, target)?.unwrap_or_default(); - rustflags - .flags - .extend(["-C".to_string(), "linker-flavor=lld-link".to_string()]); + rustflags.flags.extend([ + "-C".to_string(), + "linker-flavor=lld-link".to_string(), + "-C".to_string(), + "link-arg=-defaultlib:oldnames".to_string(), + ]); rustflags.push(format!( "-Lnative={dir}/lib/{target_unknown_vendor}", dir = sysroot_dir,