Skip to content

Commit 2b1650e

Browse files
committed
Auto merge of #140154 - Berrysoft:cygwin-host, r=jieyouxu
Cygwin support in rustc This PR builds host rustc targeting cygwin. - [x] rust-lang/stacker#122 - [x] nagisa/rust_libloading#173 - [x] Detegr/rust-ctrlc#131 - [x] rust-random/getrandom#654 - [x] msys2/MSYS2-packages#5350 - [x] rust-lang/rust#140886 - [x] rust-lang/rust#140921 - [x] rust-lang/rust#140973 Currently supported: * rustc * rustdoc * rustfmt * clippy Blocking: * cargo: blocked by rust-lang/socket2#568 * rust-analyzer: needs `cargo update`, fixed upstream ``` $ rustc --version --verbose rustc 1.88.0-dev binary: rustc commit-hash: unknown commit-date: unknown host: x86_64-pc-cygwin release: 1.88.0-dev LLVM version: 20.1.4 ```
2 parents 9fc7ecc + 8834ece commit 2b1650e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/shims/native_lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
117117
let mut info = std::mem::MaybeUninit::<libc::Dl_info>::uninit();
118118
unsafe {
119119
if libc::dladdr(*func.deref() as *const _, info.as_mut_ptr()) != 0 {
120-
if std::ffi::CStr::from_ptr(info.assume_init().dli_fname).to_str().unwrap()
120+
let info = info.assume_init();
121+
#[cfg(target_os = "cygwin")]
122+
let fname_ptr = info.dli_fname.as_ptr();
123+
#[cfg(not(target_os = "cygwin"))]
124+
let fname_ptr = info.dli_fname;
125+
if std::ffi::CStr::from_ptr(fname_ptr).to_str().unwrap()
121126
!= _lib_path.to_str().unwrap()
122127
{
123128
return None;

0 commit comments

Comments
 (0)