!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

565 Members
118 Servers

Load older messages


SenderMessageTime
26 Feb 2026
@dramforever:matrix.orgdramforever so what it makes me think is that all libraries are broken 20:08:44
@rosssmyth:matrix.orgrosssmythIt tells it where to find it20:08:45
@rosssmyth:matrix.orgrosssmythhttps://github.com/rust-lang/rust/blob/25396cf54981afd1fa5a7406658b45033106a0d3/compiler/rustc_target/src/spec/base/windows_gnu.rs#L7020:08:56
@rosssmyth:matrix.orgrosssmythI believe this is the offending code20:09:02
@rosssmyth:matrix.orgrosssmythWhere it says "pls link pthreads" But since it's not anywhere normal on Nix, it cannot find it20:09:23
@emilazy:matrix.orgemily surely stdenv should just set up that path 20:09:36
@emilazy:matrix.orgemily isn't this why -pthread exists though (it's even POSIX IIRC?) 20:09:48
@rosssmyth:matrix.orgrosssmythWell it always must be set manually in my experience! So surely it doesn't. 20:10:02
@emilazy:matrix.orgemilyI mean should as in, that's the place we should fix it20:10:21
@emilazy:matrix.orgemilyI guess the counterargument is that pthreads aren't natively supported on Windows?20:10:33
@rosssmyth:matrix.orgrosssmythYeah it's a compat layer20:10:43
@emilazy:matrix.orgemilybut then how do Rust distributions ensure the pthreads implementation is shipped and available20:10:44
@emilazy:matrix.orgemilylike rustu20:10:48
@emilazy:matrix.orgemily* like rustup20:10:50
@rosssmyth:matrix.orgrosssmythUnsure, but my guess is it is in the rust gnu distribution bundle20:11:32
@rosssmyth:matrix.orgrosssmythWhich I never use cause mingw mostly sucks 20:11:49
@rosssmyth:matrix.orgrosssmythUnless you love your builds breaking all the time 20:12:04
@rosssmyth:matrix.orgrosssmyth* Which I never use (on Windows) cause mingw mostly sucks 20:12:18
@rosssmyth:matrix.orgrosssmythI will give it a look though20:12:38
@dramforever:matrix.orgdramforever
[nix-shell:~]$ x86_64-w64-mingw32-gcc -l:libpthread.a -o test x.c

[nix-shell:~]$ file test.exe 
test.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows, 10 sections
20:13:14
@dramforever:matrix.orgdramforeverit sure looks like it should work20:13:23
@dramforever:matrix.orgdramforeverwithout additional arguments to the linker20:13:31
@rosssmyth:matrix.orgrosssmythDo we use gcc as the linker driver with rustc, or ld directly? 20:14:08
@emilazy:matrix.orgemilytbf I assume the MSVC target doesn't use a pthreads emulation library.20:14:35
@emilazy:matrix.orgemilyI hope?20:14:36
@dramforever:matrix.orgdramforeverboth work20:14:40
@dramforever:matrix.orgdramforever* both ld and gcc work20:14:49
@dramforever:matrix.orgdramforeveri think we should be using gcc20:14:52
@rosssmyth:matrix.orgrosssmythYes20:15:03
@dramforever:matrix.orgdramforeverso like obviously my worry is not that it's not sending pthreads into rustc20:15:32

Show newer messages


Back to Room ListRoom Version: 6