Skip to content

Commit bca76a5

Browse files
committed
---
yaml --- r: 151115 b: refs/heads/try2 c: eea4909 h: refs/heads/master i: 151113: 77af7e5 151111: 8fa3274 v: v3
1 parent 836692c commit bca76a5

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 7269bc77e1d1f1babfd159db97024cbd535c47a7
8+
refs/heads/try2: eea4909a8713a54b3c47e871a70baf6c722999a3
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/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)