From f9457fb8097f583c470192181deb28f66d64abf5 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 20 Sep 2020 21:13:04 -0700 Subject: [PATCH] Remove duplicated library links between std and libc The libc crate is already responsible for linking in the appropriate libraries, and std doing the same thing results in duplicated library names on the linker command line. Removing this duplication slightly reduces linker time, and makes it simpler to adjust the set or order of linked libraries in one place (such as to add static linking support). --- library/std/build.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/library/std/build.rs b/library/std/build.rs index a787e6d43fc..f2ed7552afb 100644 --- a/library/std/build.rs +++ b/library/std/build.rs @@ -8,10 +8,6 @@ fn main() { println!("cargo:rustc-link-lib=dl"); println!("cargo:rustc-link-lib=log"); println!("cargo:rustc-link-lib=gcc"); - } else if !target.contains("musl") { - println!("cargo:rustc-link-lib=dl"); - println!("cargo:rustc-link-lib=rt"); - println!("cargo:rustc-link-lib=pthread"); } } else if target.contains("freebsd") { println!("cargo:rustc-link-lib=execinfo");