Correct target_family mess
This commit is contained in:
parent
474eb6223b
commit
c59bb4979c
14 changed files with 19 additions and 13 deletions
|
@ -943,26 +943,20 @@ pub fn default_configuration(sess: &Session) -> ast::CrateConfig {
|
|||
let vendor = &sess.target.target.target_vendor;
|
||||
let max_atomic_width = sess.target.target.max_atomic_width();
|
||||
|
||||
let fam = if let Some(ref fam) = sess.target.target.options.target_family {
|
||||
Symbol::intern(fam)
|
||||
} else if sess.target.target.options.is_like_windows {
|
||||
Symbol::intern("windows")
|
||||
} else {
|
||||
Symbol::intern("unix")
|
||||
};
|
||||
|
||||
let mut ret = HashSet::new();
|
||||
// Target bindings.
|
||||
ret.insert((Symbol::intern("target_os"), Some(Symbol::intern(os))));
|
||||
if let Some(fam) = sess.target.target.options.target_family {
|
||||
ret.insert((Symbol::intern("target_family"), Some(fam)));
|
||||
if fam == "windows" || fam == "unix" {
|
||||
ret.insert((fam, None));
|
||||
}
|
||||
}
|
||||
ret.insert((Symbol::intern("target_arch"), Some(Symbol::intern(arch))));
|
||||
ret.insert((Symbol::intern("target_endian"), Some(Symbol::intern(end))));
|
||||
ret.insert((Symbol::intern("target_pointer_width"), Some(Symbol::intern(wordsz))));
|
||||
ret.insert((Symbol::intern("target_env"), Some(Symbol::intern(env))));
|
||||
ret.insert((Symbol::intern("target_vendor"), Some(Symbol::intern(vendor))));
|
||||
if fam == "windows" || fam == "unix" {
|
||||
ret.insert((fam, None));
|
||||
}
|
||||
if sess.target.target.options.has_elf_tls {
|
||||
ret.insert((Symbol::intern("target_thread_local"), None));
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ pub fn opts() -> TargetOptions {
|
|||
function_sections: false,
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
is_like_osx: true,
|
||||
has_rpath: true,
|
||||
dll_prefix: "lib".to_string(),
|
||||
|
|
|
@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
|
|||
TargetOptions {
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
has_rpath: true,
|
||||
position_independent_executables: true,
|
||||
|
|
|
@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
|
|||
TargetOptions {
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
has_rpath: true,
|
||||
pre_link_args: vec![
|
||||
|
|
|
@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
|
|||
TargetOptions {
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
has_rpath: true,
|
||||
pre_link_args: vec![
|
||||
|
|
|
@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
|
|||
TargetOptions {
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
has_rpath: true,
|
||||
pre_link_args: vec![
|
||||
|
|
|
@ -17,6 +17,7 @@ pub fn opts() -> TargetOptions {
|
|||
dynamic_linking: true,
|
||||
executables: true,
|
||||
has_rpath: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
.. Default::default()
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
|
|||
TargetOptions {
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
has_rpath: true,
|
||||
pre_link_args: vec![
|
||||
|
|
|
@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
|
|||
TargetOptions {
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
has_rpath: true,
|
||||
pre_link_args: vec![
|
||||
|
|
|
@ -15,6 +15,7 @@ pub fn opts() -> TargetOptions {
|
|||
TargetOptions {
|
||||
dynamic_linking: true,
|
||||
executables: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
linker_is_gnu: true,
|
||||
has_rpath: true,
|
||||
is_like_openbsd: true,
|
||||
|
|
|
@ -38,7 +38,7 @@ pub fn opts() -> TargetOptions {
|
|||
relocation_model: "static".to_string(),
|
||||
disable_redzone: true,
|
||||
eliminate_frame_pointer: false,
|
||||
target_family: Some("redox".to_string()),
|
||||
target_family: None,
|
||||
linker_is_gnu: true,
|
||||
no_default_libraries: true,
|
||||
lib_allocation_crate: "alloc_system".to_string(),
|
||||
|
|
|
@ -16,6 +16,7 @@ pub fn opts() -> TargetOptions {
|
|||
dynamic_linking: true,
|
||||
executables: true,
|
||||
has_rpath: true,
|
||||
target_family: Some("unix".to_string()),
|
||||
is_like_solaris: true,
|
||||
exe_allocation_crate: super::maybe_jemalloc(),
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ pub fn opts() -> TargetOptions {
|
|||
staticlib_prefix: "".to_string(),
|
||||
staticlib_suffix: ".lib".to_string(),
|
||||
no_default_libraries: true,
|
||||
target_family: Some("windows".to_string()),
|
||||
is_like_windows: true,
|
||||
allows_weak_linkage: false,
|
||||
pre_link_args: vec![
|
||||
|
|
|
@ -53,6 +53,7 @@ pub fn opts() -> TargetOptions {
|
|||
exe_suffix: ".exe".to_string(),
|
||||
staticlib_prefix: "".to_string(),
|
||||
staticlib_suffix: ".lib".to_string(),
|
||||
target_family: Some("windows".to_string()),
|
||||
is_like_windows: true,
|
||||
is_like_msvc: true,
|
||||
pre_link_args: vec![
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue