DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 53K5STKB130924 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 53K5STKB130924 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=SkxzdKCh X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F35CA3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1745126907; bh=xQjzHmS0NNXTb68YQOqm3H3hd6lVN3/MIS0aZPvx1Uo=; h=Date:To:cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=SkxzdKChSPSPN85muZuY0z+PaS4I27a7SUxyFZRDLaeTJothEGINF9iXBBGm5e8Eh +ZIhCxSsrKHKhBaw9hGP4Bt64ItpT6CjD1/m2KpL82nLlrZNm5P9iqTsXsUAWlonU5 BFyhTjRwDQbVLQAZcUnBB4nq+Vr9eg4SaKPyTsng= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E92413858D37 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E92413858D37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745126839; cv=none; b=uSgyNoavCiAWmakUhhn6H8Fsos4ODRUY54rmlGXN+2C9TxmzXBxgZ6aiXpe3sjRlQaggTUBf3IYsdLFMn68GQ+/xO6zV1f3LQW/QscOUZBZwMTfP66l2q5s8XChJd+/RPAebujaEZHFPataSVaBYxiBR3FFbE/iZ0C3AToLhLSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1745126839; c=relaxed/simple; bh=qI0UOi80lx3pheQ6Gi89cUQb+JKljIDzq+CXf7uZSKY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=FDZhJ5iS+r0y2uICLoZGgV/T7RBvKHhX8sB3crrYe+feBr2PUYcSSZeumwTpwvij4Ihr73PpTV6rpWllKoILx95oyRc1oOkSrXqgJEwRZBvCqdMGYdCdDPeS3ssgFBsFknEJLnvXACdX8QMDX33zvpmadYdP5abzZrgx/gicZs4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E92413858D37 Date: Sat, 19 Apr 2025 22:27:18 -0700 (PDT) X-X-Sender: jeremyd AT resin DOT csoft DOT net To: Takashi Yano cc: cygwin AT cygwin DOT com, Yuyi Wang , oss AT mateuszmikula DOT dev Subject: Re: Rust for cygwin (was Re: Deadlock when calling pthread_key_create in the destructor of a pthread_key) In-Reply-To: <20250420132359.bfd51ddf860f3faaf518b378@nifty.ne.jp> Message-ID: References: <20250324145221 DOT 25188bbb53d8ee7a8160e3ab AT nifty DOT ne DOT jp> <20250420132359 DOT bfd51ddf860f3faaf518b378 AT nifty DOT ne DOT jp> MIME-Version: 1.0 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jeremy Drake via Cygwin Reply-To: Jeremy Drake Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On Sun, 20 Apr 2025, Takashi Yano via Cygwin wrote: > On Mon, 24 Mar 2025 14:41:19 +0800 > Yuyi Wang wrote: > > > I mean it is some kind of cross compiler. > > > > Yes. Rustc is a cross compiler powered by LLVM. > > > > > ...is it possible to build Rust compiler itself by the cross-compiler? > > > > Theoretically yes. Actually once a GitHub user @Ookiineko succeeded before, but > > now the account has been deleted. I think the largest blocker is LLVM itself. > > The latest version of LLVM provided by cygwin is 8.0, and 11.0 by MSYS2, while > > rustc needs LLVM 17.0 at least. @Ookiineko added some patches to LLVM to make it > > work, but they were not committed to upstream, but I haven't understand all of > > them yet. > > Thanks to MSYS2 guys' work, I have successfully built LLVM package with Polly, > Clang, compiler-rt, and libunwind packages version 20.1.2. > I still trying built libc++ and libc++abi, but it is not going smoothly. > > Is there any other blocker to build Rust for cygwin? The next thing you need is to build rust on a system that already has a working rust and a working Cygwin (cross-)compiler (gcc) environment, with support for the Cygwin target enabled. This could be Linux, or technically could be a cross-compile from Windows to Cygwin (in which case the "Cygwin cross-compiler" is really the normal Cygwin GCC being run by Windows processes). Once you've got that built, you would use that rust to build a rust whose host *and* target are Cygwin. I don't expect that to go without issues, trying to get {i686,aarch64}-pc-windows-gnullvm bootstrapped was a bit of a hassle of patching vendored crates because it's surprising how many of them knew about targets, and it's rather a nightmare how many different versions of crates are involved sometimes, and how long you have to wait for fixes to percolate through the ecosystem. Rust also will default to trying to build its own vendored version of LLVM, so you might end up having to patch that too (or tell Rust to use the system LLVM instead and save that step). -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple