!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

464 Members
Rust111 Servers

Load older messages


SenderMessageTime
23 Aug 2024
@creepinson:matrix.orgTheo ParisSo building a rust crate for mingw with llvm ends up trying to cross compile rustc and cargo for mingw instead of just the rust crate... What would be the correct fix for this? Additionally, building x86_64-w64-mingw32-rustc fails due to dlltool04:09:22
@creepinson:matrix.orgTheo Paris * So building a rust crate for mingw with llvm ends up trying to cross compile rustc and cargo for mingw instead of just the rust crate... What would be the correct fix for this? Additionally, building x86_64-w64-mingw32-rustc fails due to dlltool with pkgsLLVM 04:09:28
@k900:0upti.meK900How are you doing that? Also, why LLVM? 04:10:19
@creepinson:matrix.orgTheo Paris
(import nixpkgs {
          system = "x86_64-linux";
          crossSystem = {
            system = "x86_64-windows";
            rust = {
              rustcTarget = "x86_64-pc-windows-gnu";
            };
          };
        }).pkgsLLVM.pkgsCross.mingwW64
04:10:58
@creepinson:matrix.orgTheo ParisIf I set useLLVM and linker to lld in crossSystem instead of outside crossSystem, it fails to build compiler-rt-libc. 04:11:32
@creepinson:matrix.orgTheo Paris * If I set useLLVM and linker to lld in crossSystem instead of outside crossSystem, it fails to build compiler-rt-libc, probably because it tries to use lld flags with lld-link04:12:12
@k900:0upti.meK900Yeah this is very wrong for a variety of reasons 04:14:21
@k900:0upti.meK900What are you trying to achieve here 04:14:28
@k900:0upti.meK900Do you want MinGW or MSVC04:14:37
@creepinson:matrix.orgTheo ParisI am trying to cross compile a rust crate with mingw and LLVM.04:14:55
@k900:0upti.meK900This makes no sense because MinGW is GNU04:15:30
@k900:0upti.meK900So do you want MinGW or LLVM 04:15:37
@creepinson:matrix.orgTheo ParisI wanted mingw because its posix04:15:46
@k900:0upti.meK900Then why is LLVM even there 04:16:00
@creepinson:matrix.orgTheo ParisBecause I want to use llvm tools and clang instead of gcc04:16:19
@k900:0upti.meK900Why? 04:16:45
@creepinson:matrix.orgTheo ParisIf there is a way to uses clang/lld-link to cross compile without mingw then I have no idea what that way would be.04:16:55
@k900:0upti.meK900MinGW is generally only tested with the GNU toolchain 04:17:00
@k900:0upti.meK900There is a way, yes04:17:12
@k900:0upti.meK900The way is to use the native MSVC ABI targets 04:17:20
@k900:0upti.meK900 See e.g. https://gitlab.com/K900/rust-cross-windows 04:17:37
@creepinson:matrix.orgTheo ParisThat requires the proprietary msvc libraries, but it's certainly something I can try. I'd like to be able to get llvm and mingw to work with nix in the future if that is possible to achieve.04:19:44
@k900:0upti.meK900It is probably possible, but it's going to be a sizable amount of work, and honestly, MinGW is a gigantic hack anyway 04:20:15
@k900:0upti.meK900I personally would much prefer to see better support for MSVC targets 04:20:28
@k900:0upti.meK900But that's way harder 04:20:32
@creepinson:matrix.orgTheo Paris I did get closer outside of nix/nixpkgs by using rust-lld with x86_64-pc-windows-gnullvm but ran into the fact that rustc hard codes the --nxcompat flag for windows targets, which fails to work with lld-link.
So I think the crossSystem and compiler-rt issues are specific to nixpkgs
04:21:47
@creepinson:matrix.orgTheo Paris * I did get closer outside of nix/nixpkgs by using lld with x86_64-pc-windows-gnullvm but ran into the fact that rustc hard codes the --nxcompat flag for windows targets, which fails to work with lld-link.
So I think the crossSystem and compiler-rt issues are specific to nixpkgs
04:22:09
@creepinson:matrix.orgTheo Paris * I did get closer outside of nix/nixpkgs by using lld-link with x86_64-pc-windows-gnullvm but ran into the fact that rustc hard codes the --nxcompat flag for windows targets, which fails to work with lld-link.
So I think the crossSystem and compiler-rt issues are specific to nixpkgs
04:22:24
@aktaboot:tchncs.deaktabootwhat do you usually do to get rust-nightly packages in your system ?17:53:32
@k900:0upti.meK900rust-overlay or fenix17:56:46

Show newer messages


Back to Room ListRoom Version: 6