diff options
| author | Sébastien Marie <semarie@users.noreply.github.com> | 2016-12-03 18:58:21 +0100 |
|---|---|---|
| committer | Sébastien Marie <semarie@users.noreply.github.com> | 2016-12-04 07:18:56 +0100 |
| commit | 6774e7aa92f5866657f778f08261c0fe219f01a8 (patch) | |
| tree | e72778745b73b836044becffcec466fa16bc9b11 | |
| parent | 53ebf5a0a7b08886d99c31bed7cf989f9af6c442 (diff) | |
| download | rust-6774e7aa92f5866657f778f08261c0fe219f01a8.tar.gz rust-6774e7aa92f5866657f778f08261c0fe219f01a8.zip | |
OpenBSD under x86 has particular ABI for returning a struct.
It is like OSX or Windows: small structs are returned as integers.
| -rw-r--r-- | src/librustc_back/target/mod.rs | 6 | ||||
| -rw-r--r-- | src/librustc_back/target/openbsd_base.rs | 1 | ||||
| -rw-r--r-- | src/librustc_trans/cabi_x86.rs | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index 496ba6cba18..351d469ea28 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -302,6 +302,9 @@ pub struct TargetOptions { pub staticlib_suffix: String, /// OS family to use for conditional compilation. Valid options: "unix", "windows". pub target_family: Option<String>, + /// Whether the target toolchain is like OpenBSD's. + /// Only useful for compiling against OpenBSD, for configuring abi when returning a struct. + pub is_like_openbsd: bool, /// Whether the target toolchain is like OSX's. Only useful for compiling against iOS/OS X, in /// particular running dsymutil and some other stuff like `-dead_strip`. Defaults to false. pub is_like_osx: bool, @@ -406,6 +409,7 @@ impl Default for TargetOptions { staticlib_prefix: "lib".to_string(), staticlib_suffix: ".a".to_string(), target_family: None, + is_like_openbsd: false, is_like_osx: false, is_like_solaris: false, is_like_windows: false, @@ -572,6 +576,7 @@ impl Target { key!(staticlib_prefix); key!(staticlib_suffix); key!(target_family, optional); + key!(is_like_openbsd, bool); key!(is_like_osx, bool); key!(is_like_solaris, bool); key!(is_like_windows, bool); @@ -733,6 +738,7 @@ impl ToJson for Target { target_option_val!(staticlib_prefix); target_option_val!(staticlib_suffix); target_option_val!(target_family); + target_option_val!(is_like_openbsd); target_option_val!(is_like_osx); target_option_val!(is_like_solaris); target_option_val!(is_like_windows); diff --git a/src/librustc_back/target/openbsd_base.rs b/src/librustc_back/target/openbsd_base.rs index 90e6631841b..1f74170e399 100644 --- a/src/librustc_back/target/openbsd_base.rs +++ b/src/librustc_back/target/openbsd_base.rs @@ -17,6 +17,7 @@ pub fn opts() -> TargetOptions { executables: true, linker_is_gnu: true, has_rpath: true, + is_like_openbsd: true, pre_link_args: vec