From 96cc48fba28a32f0dd46b0fe38e04e6aff74456f Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Wed, 4 Jun 2014 09:12:11 +1000 Subject: [PATCH] libc: only provide an rlib. There's absolutely no reason for `libc` to be offered as a dynamic library. --- mk/crates.mk | 1 + src/liblibc/lib.rs | 4 +++- src/libstd/lib.rs | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mk/crates.mk b/mk/crates.mk index a683528c847..011aaf3fee0 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -102,6 +102,7 @@ TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs TOOL_SOURCE_rustc := $(S)src/driver/driver.rs ONLY_RLIB_core := 1 +ONLY_RLIB_libc := 1 ONLY_RLIB_rlibc := 1 ONLY_RLIB_alloc := 1 ONLY_RLIB_rand := 1 diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 3a9f8bc863b..5b7f58fcb81 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -14,7 +14,6 @@ #![no_std] // we don't need std, and we can't have std, since it doesn't exist // yet. std depends on us. #![crate_type = "rlib"] -#![crate_type = "dylib"] /*! * Bindings for the C standard library and other platform libraries @@ -4436,4 +4435,7 @@ pub mod funcs { } } +#[doc(hidden)] +pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen correctly + #[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index a67ed1c0b79..cde1a7335a5 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -254,6 +254,11 @@ mod unicode; #[unstable] pub mod rt; +#[doc(hidden)] +pub fn issue_14344_workaround() { // FIXME #14344 force linkage to happen correctly + libc::issue_14344_workaround(); +} + // A curious inner-module that's not exported that contains the binding // 'std' so that macro-expanded references to std::error and such // can be resolved within libstd.