Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-platform conflict while linking #68599

Closed
aristarh2704 opened this issue Jan 28, 2020 · 6 comments
Closed

Cross-platform conflict while linking #68599

aristarh2704 opened this issue Jan 28, 2020 · 6 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries O-windows Operating system: Windows

Comments

@aristarh2704
Copy link

Now I try use nightly rustc on cygwin. While compiling libbacktrase-sys, mingw-gcc uses cygwin headers, for example, it take errno value as "__errno()", and after compiling, symbol dumping shows that library has undefined reference to "___errno" (with 3 underscores). While libmsvcrt adds this function named __errno (with 2 underscores). This makes it impossible to compile on the cygwin platform. I think the mingw compiler shipped with rustc must have its own headers.

$ rustc -vV
rustc 1.42.0-nightly (8a79d08fa 2020-01-27)
binary: rustc
commit-hash: 8a79d08fa57e1c257d647c9848e35defcb379c07
commit-date: 2020-01-27
host: i686-pc-windows-gnu
release: 1.42.0-nightly
LLVM version: 9.0

I can use the hack with editing errno.h, but it's not good solution.

@aristarh2704 aristarh2704 changed the title Cross-platform conflict Cross-platform conflict while linking Jan 28, 2020
@retep998
Copy link
Member

Rust does not support Cygwin.

@aristarh2704
Copy link
Author

Why does mingw come with the compiler? Indeed, in theory, the system should have its own mingw compiler, if in some situations headers are used

@retep998
Copy link
Member

The pc-windows-gnu targets come with a minimal subset of MinGW sufficient to link pure Rust binaries. That currently causes some issues such as #47048 when you also have a full external MinGW toolchain, but #67429 is supposed to fix that so it'll favor your external MinGW toolchain over the bundled MinGW. That said, Rust still does not support Cygwin.

@aristarh2704
Copy link
Author

Ok, it's possible define i686-pc-cygwin-gnu?

@Elinvynia Elinvynia added A-linkage Area: linking into static, shared libraries and binaries O-windows Operating system: Windows labels May 21, 2020
@mati865
Copy link
Contributor

mati865 commented Sep 8, 2020

pc-windows-gnu nightly builds now use system MinGW if available with bundled one as a fallback.

@aristarh2704 do you want to crate binaries for Cygwin or native Windows?

@workingjubilee
Copy link
Member

Any hypothetical new target would follow the target tier policy for how to add it, and you are welcome to do so if you also want to do the work of maintaining it. Judging by how often the existing pc-windows-gnu target gets flakey, it would be a LOT of work if you ever wanted it above tier 3. Not for the fainthearted. But if sufficient maintenance comes for it, I suppose we might.

Otherwise, I do not think the windows-gnu target includes cygwin, so closing this.

@workingjubilee workingjubilee closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

5 participants