Skip to content

Commit e530e4e

Browse files
committed
---
yaml --- r: 111975 b: refs/heads/auto c: eea4909 h: refs/heads/master i: 111973: 0b6e923 111971: 7151125 111967: 9156db5 v: v3
1 parent 270108f commit e530e4e

File tree

5 files changed

+161
-190
lines changed

5 files changed

+161
-190
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 7269bc77e1d1f1babfd159db97024cbd535c47a7
16+
refs/heads/auto: eea4909a8713a54b3c47e871a70baf6c722999a3
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/back/link.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use lib::llvm::llvm;
1818
use lib::llvm::ModuleRef;
1919
use lib;
2020
use metadata::common::LinkMeta;
21-
use metadata::{encoder, cstore, filesearch, csearch};
21+
use metadata::{encoder, cstore, filesearch, csearch, loader};
2222
use middle::trans::context::CrateContext;
2323
use middle::trans::common::gensym_name;
2424
use middle::ty;
@@ -30,7 +30,6 @@ use std::c_str::{ToCStr, CString};
3030
use std::char;
3131
use std::io::{fs, TempDir, Process};
3232
use std::io;
33-
use std::os::consts::{macos, freebsd, linux, android, win32};
3433
use std::ptr;
3534
use std::str;
3635
use std::strbuf::StrBuf;
@@ -825,11 +824,11 @@ pub fn filename_for_input(sess: &Session, crate_type: session::CrateType,
825824
}
826825
session::CrateTypeDylib => {
827826
let (prefix, suffix) = match sess.targ_cfg.os {
828-
abi::OsWin32 => (win32::DLL_PREFIX, win32::DLL_SUFFIX),
829-
abi::OsMacos => (macos::DLL_PREFIX, macos::DLL_SUFFIX),
830-
abi::OsLinux => (linux::DLL_PREFIX, linux::DLL_SUFFIX),
831-
abi::OsAndroid => (android::DLL_PREFIX, android::DLL_SUFFIX),
832-
abi::OsFreebsd => (freebsd::DLL_PREFIX, freebsd::DLL_SUFFIX),
827+
abi::OsWin32 => (loader::WIN32_DLL_PREFIX, loader::WIN32_DLL_SUFFIX),
828+
abi::OsMacos => (loader::MACOS_DLL_PREFIX, loader::MACOS_DLL_SUFFIX),
829+
abi::OsLinux => (loader::LINUX_DLL_PREFIX, loader::LINUX_DLL_SUFFIX),
830+
abi::OsAndroid => (loader::ANDROID_DLL_PREFIX, loader::ANDROID_DLL_SUFFIX),
831+
abi::OsFreebsd => (loader::FREEBSD_DLL_PREFIX, loader::FREEBSD_DLL_SUFFIX),
833832
};
834833
out_filename.with_filename(format!("{}{}{}", prefix, libname, suffix))
835834
}

branches/auto/src/librustc/metadata/loader.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use std::c_str::ToCStr;
2727
use std::cast;
2828
use std::cmp;
2929
use std::io;
30-
use std::os::consts::{macos, freebsd, linux, android, win32};
3130
use std::ptr;
3231
use std::slice;
3332
use std::str;
@@ -36,6 +35,21 @@ use collections::{HashMap, HashSet};
3635
use flate;
3736
use time;
3837

38+
pub static MACOS_DLL_PREFIX: &'static str = "lib";
39+
pub static MACOS_DLL_SUFFIX: &'static str = ".dylib";
40+
41+
pub static WIN32_DLL_PREFIX: &'static str = "";
42+
pub static WIN32_DLL_SUFFIX: &'static str = ".dll";
43+
44+
pub static LINUX_DLL_PREFIX: &'static str = "lib";
45+
pub static LINUX_DLL_SUFFIX: &'static str = ".so";
46+
47+
pub static FREEBSD_DLL_PREFIX: &'static str = "lib";
48+
pub static FREEBSD_DLL_SUFFIX: &'static str = ".so";
49+
50+
pub static ANDROID_DLL_PREFIX: &'static str = "lib";
51+
pub static ANDROID_DLL_SUFFIX: &'static str = ".so";
52+
3953
pub enum Os {
4054
OsMacos,
4155
OsWin32,
@@ -433,11 +447,11 @@ impl<'a> Context<'a> {
433447
// dynamic libraries
434448
fn dylibname(&self) -> (&'static str, &'static str) {
435449
match self.os {
436-
OsWin32 => (win32::DLL_PREFIX, win32::DLL_SUFFIX),
437-
OsMacos => (macos::DLL_PREFIX, macos::DLL_SUFFIX),
438-
OsLinux => (linux::DLL_PREFIX, linux::DLL_SUFFIX),
439-
OsAndroid => (android::DLL_PREFIX, android::DLL_SUFFIX),
440-
OsFreebsd => (freebsd::DLL_PREFIX, freebsd::DLL_SUFFIX),
450+
OsWin32 => (WIN32_DLL_PREFIX, WIN32_DLL_SUFFIX),
451+
OsMacos => (MACOS_DLL_PREFIX, MACOS_DLL_SUFFIX),
452+
OsLinux => (LINUX_DLL_PREFIX, LINUX_DLL_SUFFIX),
453+
OsAndroid => (ANDROID_DLL_PREFIX, ANDROID_DLL_SUFFIX),
454+
OsFreebsd => (FREEBSD_DLL_PREFIX, FREEBSD_DLL_SUFFIX),
441455
}
442456
}
443457

0 commit comments

Comments
 (0)