@@ -32,6 +32,7 @@ use std::run;
32
32
use std:: str;
33
33
use std:: vec;
34
34
use std:: rt:: io:: fs;
35
+ use syntax:: abi;
35
36
use syntax:: ast;
36
37
use syntax:: ast_map:: { path, path_mod, path_name, path_pretty_name} ;
37
38
use syntax:: attr;
@@ -864,13 +865,13 @@ pub fn mangle_internal_name_by_path(ccx: &mut CrateContext, path: path) -> ~str
864
865
}
865
866
866
867
867
- pub fn output_dll_filename ( os : session :: Os , lm : LinkMeta ) -> ~str {
868
+ pub fn output_dll_filename ( os : abi :: Os , lm : LinkMeta ) -> ~str {
868
869
let ( dll_prefix, dll_suffix) = match os {
869
- session :: OsWin32 => ( win32:: DLL_PREFIX , win32:: DLL_SUFFIX ) ,
870
- session :: OsMacos => ( macos:: DLL_PREFIX , macos:: DLL_SUFFIX ) ,
871
- session :: OsLinux => ( linux:: DLL_PREFIX , linux:: DLL_SUFFIX ) ,
872
- session :: OsAndroid => ( android:: DLL_PREFIX , android:: DLL_SUFFIX ) ,
873
- session :: OsFreebsd => ( freebsd:: DLL_PREFIX , freebsd:: DLL_SUFFIX ) ,
870
+ abi :: OsWin32 => ( win32:: DLL_PREFIX , win32:: DLL_SUFFIX ) ,
871
+ abi :: OsMacos => ( macos:: DLL_PREFIX , macos:: DLL_SUFFIX ) ,
872
+ abi :: OsLinux => ( linux:: DLL_PREFIX , linux:: DLL_SUFFIX ) ,
873
+ abi :: OsAndroid => ( android:: DLL_PREFIX , android:: DLL_SUFFIX ) ,
874
+ abi :: OsFreebsd => ( freebsd:: DLL_PREFIX , freebsd:: DLL_SUFFIX ) ,
874
875
} ;
875
876
format ! ( "{}{}-{}-{}{}" , dll_prefix, lm. name, lm. extras_hash, lm. vers, dll_suffix)
876
877
}
@@ -885,7 +886,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
885
886
match sess. opts . linker {
886
887
Some ( ref linker) => linker. to_str ( ) ,
887
888
None => match sess. targ_cfg . os {
888
- session :: OsAndroid =>
889
+ abi :: OsAndroid =>
889
890
match & sess. opts . android_cross_path {
890
891
& Some ( ref path) => {
891
892
format ! ( "{}/bin/arm-linux-androideabi-gcc" , * path)
@@ -895,7 +896,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
895
896
(--android-cross-path)")
896
897
}
897
898
} ,
898
- session :: OsWin32 => ~"g++",
899
+ abi :: OsWin32 => ~"g++",
899
900
_ => ~" cc"
900
901
}
901
902
}
@@ -943,7 +944,7 @@ pub fn link_binary(sess: Session,
943
944
}
944
945
945
946
// Clean up on Darwin
946
- if sess. targ_cfg . os == session :: OsMacos {
947
+ if sess. targ_cfg . os == abi :: OsMacos {
947
948
// FIXME (#9639): This needs to handle non-utf8 paths
948
949
run:: process_status ( "dsymutil" , [ output. as_str ( ) . unwrap ( ) . to_owned ( ) ] ) ;
949
950
}
@@ -972,7 +973,7 @@ pub fn link_args(sess: Session,
972
973
// Converts a library file-stem into a cc -l argument
973
974
fn unlib ( config : @session:: config , stem : ~str ) -> ~str {
974
975
if stem. starts_with ( "lib" ) &&
975
- config. os != session :: OsWin32 {
976
+ config. os != abi :: OsWin32 {
976
977
stem. slice ( 3 , stem. len ( ) ) . to_owned ( )
977
978
} else {
978
979
stem
@@ -1016,7 +1017,7 @@ pub fn link_args(sess: Session,
1016
1017
obj_filename. as_str ( ) . unwrap ( ) . to_owned ( ) ] ) ;
1017
1018
1018
1019
let lib_cmd = match sess. targ_cfg . os {
1019
- session :: OsMacos => ~"-dynamiclib",
1020
+ abi :: OsMacos => ~"-dynamiclib",
1020
1021
_ => ~"-shared"
1021
1022
} ;
1022
1023
@@ -1067,7 +1068,7 @@ pub fn link_args(sess: Session,
1067
1068
1068
1069
// On mac we need to tell the linker to let this library
1069
1070
// be rpathed
1070
- if sess. targ_cfg . os == session :: OsMacos {
1071
+ if sess. targ_cfg . os == abi :: OsMacos {
1071
1072
// FIXME (#9639): This needs to handle non-utf8 paths
1072
1073
args. push ( "-Wl,-install_name,@rpath/"
1073
1074
+ output. filename_str ( ) . unwrap ( ) ) ;
@@ -1076,20 +1077,20 @@ pub fn link_args(sess: Session,
1076
1077
1077
1078
// On linux librt and libdl are an indirect dependencies via rustrt,
1078
1079
// and binutils 2.22+ won't add them automatically
1079
- if sess. targ_cfg . os == session :: OsLinux {
1080
+ if sess. targ_cfg . os == abi :: OsLinux {
1080
1081
args. push_all ( [ ~"-lrt", ~"-ldl"] ) ;
1081
1082
1082
1083
// LLVM implements the `frem` instruction as a call to `fmod`,
1083
1084
// which lives in libm. Similar to above, on some linuxes we
1084
1085
// have to be explicit about linking to it. See #2510
1085
1086
args. push ( ~"-lm") ;
1086
1087
}
1087
- else if sess. targ_cfg . os == session :: OsAndroid {
1088
+ else if sess. targ_cfg . os == abi :: OsAndroid {
1088
1089
args. push_all ( [ ~"-ldl", ~"-llog", ~"-lsupc++", ~" -lgnustl_shared"] ) ;
1089
1090
args. push ( ~"-lm") ;
1090
1091
}
1091
1092
1092
- if sess. targ_cfg . os == session :: OsFreebsd {
1093
+ if sess. targ_cfg . os == abi :: OsFreebsd {
1093
1094
args. push_all ( [ ~"-pthread", ~"-lrt",
1094
1095
~"-L /usr/local/lib", ~"-lexecinfo",
1095
1096
~"-L /usr/local/lib/gcc46",
0 commit comments