Skip to content

Commit 91ebac3

Browse files
authored
Rollup merge of rust-lang#41456 - jessicah:haiku-support, r=alexcrichton
Haiku: fix initial platform support
2 parents fd7f3f4 + 0d63f13 commit 91ebac3

File tree

7 files changed

+14
-1
lines changed

7 files changed

+14
-1
lines changed

src/bootstrap/bootstrap.py

+3
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ def build_bootstrap(self):
367367
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
368368
(os.pathsep + env["DYLD_LIBRARY_PATH"]) \
369369
if "DYLD_LIBRARY_PATH" in env else ""
370+
env["LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib") + \
371+
(os.pathsep + env["LIBRARY_PATH"]) \
372+
if "LIBRARY_PATH" in env else ""
370373
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
371374
os.pathsep + env["PATH"]
372375
if not os.path.isfile(self.cargo()):

src/bootstrap/util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ pub fn dylib_path_var() -> &'static str {
139139
"PATH"
140140
} else if cfg!(target_os = "macos") {
141141
"DYLD_LIBRARY_PATH"
142+
} else if cfg!(target_os = "haiku") {
143+
"LIBRARY_PATH"
142144
} else {
143145
"LD_LIBRARY_PATH"
144146
}

src/librustc_back/dynamic_lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ impl DynamicLibrary {
6868
"PATH"
6969
} else if cfg!(target_os = "macos") {
7070
"DYLD_LIBRARY_PATH"
71+
} else if cfg!(target_os = "haiku") {
72+
"LIBRARY_PATH"
7173
} else {
7274
"LD_LIBRARY_PATH"
7375
}

src/librustc_back/target/haiku_base.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ pub fn opts() -> TargetOptions {
1616
linker: "cc".to_string(),
1717
dynamic_linking: true,
1818
executables: true,
19-
has_rpath: true,
19+
has_rpath: false,
2020
target_family: Some("unix".to_string()),
2121
linker_is_gnu: true,
22+
no_integrated_as: true,
2223
.. Default::default()
2324
}
2425
}

src/librustc_data_structures/flock.rs

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ mod imp {
113113
pub l_sysid: libc::c_int,
114114
}
115115

116+
pub const F_RDLCK: libc::c_short = 0x0040;
116117
pub const F_UNLCK: libc::c_short = 0x0200;
117118
pub const F_WRLCK: libc::c_short = 0x0400;
118119
pub const F_SETLK: libc::c_int = 0x0080;

src/libunwind/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@ fn main() {
3939
println!("cargo:rustc-link-lib=static-nobundle=pthread");
4040
} else if target.contains("fuchsia") {
4141
println!("cargo:rustc-link-lib=unwind");
42+
} else if target.contains("haiku") {
43+
println!("cargo:rustc-link-lib=gcc_s");
4244
}
4345
}

src/tools/compiletest/src/procsrv.rs

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ pub fn dylib_env_var() -> &'static str {
2020
"PATH"
2121
} else if cfg!(target_os = "macos") {
2222
"DYLD_LIBRARY_PATH"
23+
} else if cfg!(target_os = "haiku") {
24+
"LIBRARY_PATH"
2325
} else {
2426
"LD_LIBRARY_PATH"
2527
}

0 commit comments

Comments
 (0)