@@ -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;
@@ -877,13 +878,13 @@ pub fn mangle_internal_name_by_path(ccx: &mut CrateContext, path: path) -> ~str
877
878
}
878
879
879
880
880
- pub fn output_dll_filename ( os : session :: Os , lm : LinkMeta ) -> ~str {
881
+ pub fn output_dll_filename ( os : abi :: Os , lm : LinkMeta ) -> ~str {
881
882
let ( dll_prefix, dll_suffix) = match os {
882
- session :: OsWin32 => ( win32:: DLL_PREFIX , win32:: DLL_SUFFIX ) ,
883
- session :: OsMacos => ( macos:: DLL_PREFIX , macos:: DLL_SUFFIX ) ,
884
- session :: OsLinux => ( linux:: DLL_PREFIX , linux:: DLL_SUFFIX ) ,
885
- session :: OsAndroid => ( android:: DLL_PREFIX , android:: DLL_SUFFIX ) ,
886
- session :: OsFreebsd => ( freebsd:: DLL_PREFIX , freebsd:: DLL_SUFFIX ) ,
883
+ abi :: OsWin32 => ( win32:: DLL_PREFIX , win32:: DLL_SUFFIX ) ,
884
+ abi :: OsMacos => ( macos:: DLL_PREFIX , macos:: DLL_SUFFIX ) ,
885
+ abi :: OsLinux => ( linux:: DLL_PREFIX , linux:: DLL_SUFFIX ) ,
886
+ abi :: OsAndroid => ( android:: DLL_PREFIX , android:: DLL_SUFFIX ) ,
887
+ abi :: OsFreebsd => ( freebsd:: DLL_PREFIX , freebsd:: DLL_SUFFIX ) ,
887
888
} ;
888
889
format ! ( "{}{}-{}-{}{}" , dll_prefix, lm. name, lm. extras_hash, lm. vers, dll_suffix)
889
890
}
@@ -898,7 +899,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
898
899
match sess. opts . linker {
899
900
Some ( ref linker) => linker. to_str ( ) ,
900
901
None => match sess. targ_cfg . os {
901
- session :: OsAndroid =>
902
+ abi :: OsAndroid =>
902
903
match & sess. opts . android_cross_path {
903
904
& Some ( ref path) => {
904
905
format ! ( "{}/bin/arm-linux-androideabi-gcc" , * path)
@@ -908,7 +909,7 @@ pub fn get_cc_prog(sess: Session) -> ~str {
908
909
(--android-cross-path)")
909
910
}
910
911
} ,
911
- session :: OsWin32 => ~"g++",
912
+ abi :: OsWin32 => ~"g++",
912
913
_ => ~" cc"
913
914
}
914
915
}
@@ -956,7 +957,7 @@ pub fn link_binary(sess: Session,
956
957
}
957
958
958
959
// Clean up on Darwin
959
- if sess. targ_cfg . os == session :: OsMacos {
960
+ if sess. targ_cfg . os == abi :: OsMacos {
960
961
// FIXME (#9639): This needs to handle non-utf8 paths
961
962
run:: process_status ( "dsymutil" , [ output. as_str ( ) . unwrap ( ) . to_owned ( ) ] ) ;
962
963
}
@@ -985,7 +986,7 @@ pub fn link_args(sess: Session,
985
986
// Converts a library file-stem into a cc -l argument
986
987
fn unlib ( config : @session:: config , stem : ~str ) -> ~str {
987
988
if stem. starts_with ( "lib" ) &&
988
- config. os != session :: OsWin32 {
989
+ config. os != abi :: OsWin32 {
989
990
stem. slice ( 3 , stem. len ( ) ) . to_owned ( )
990
991
} else {
991
992
stem
@@ -1029,7 +1030,7 @@ pub fn link_args(sess: Session,
1029
1030
obj_filename. as_str ( ) . unwrap ( ) . to_owned ( ) ] ) ;
1030
1031
1031
1032
let lib_cmd = match sess. targ_cfg . os {
1032
- session :: OsMacos => ~"-dynamiclib",
1033
+ abi :: OsMacos => ~"-dynamiclib",
1033
1034
_ => ~"-shared"
1034
1035
} ;
1035
1036
@@ -1080,7 +1081,7 @@ pub fn link_args(sess: Session,
1080
1081
1081
1082
// On mac we need to tell the linker to let this library
1082
1083
// be rpathed
1083
- if sess. targ_cfg . os == session :: OsMacos {
1084
+ if sess. targ_cfg . os == abi :: OsMacos {
1084
1085
// FIXME (#9639): This needs to handle non-utf8 paths
1085
1086
args. push ( "-Wl,-install_name,@rpath/"
1086
1087
+ output. filename_str ( ) . unwrap ( ) ) ;
@@ -1089,20 +1090,20 @@ pub fn link_args(sess: Session,
1089
1090
1090
1091
// On linux librt and libdl are an indirect dependencies via rustrt,
1091
1092
// and binutils 2.22+ won't add them automatically
1092
- if sess. targ_cfg . os == session :: OsLinux {
1093
+ if sess. targ_cfg . os == abi :: OsLinux {
1093
1094
args. push_all ( [ ~"-lrt", ~"-ldl"] ) ;
1094
1095
1095
1096
// LLVM implements the `frem` instruction as a call to `fmod`,
1096
1097
// which lives in libm. Similar to above, on some linuxes we
1097
1098
// have to be explicit about linking to it. See #2510
1098
1099
args. push ( ~"-lm") ;
1099
1100
}
1100
- else if sess. targ_cfg . os == session :: OsAndroid {
1101
+ else if sess. targ_cfg . os == abi :: OsAndroid {
1101
1102
args. push_all ( [ ~"-ldl", ~"-llog", ~"-lsupc++", ~" -lgnustl_shared"] ) ;
1102
1103
args. push ( ~"-lm") ;
1103
1104
}
1104
1105
1105
- if sess. targ_cfg . os == session :: OsFreebsd {
1106
+ if sess. targ_cfg . os == abi :: OsFreebsd {
1106
1107
args. push_all ( [ ~"-pthread", ~"-lrt",
1107
1108
~"-L /usr/local/lib", ~"-lexecinfo",
1108
1109
~"-L /usr/local/lib/gcc46",
0 commit comments