How to build rustc for windows using mingw linker?

I want to build rustc for windows from wsl.

I have set mingw in wsl, in config.toml set:

[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc".

linker exists:

which x86_64-w64-mingw32-gcc
/usr/bin/x86_64-w64-mingw32-gcc

I run ./x build --target x86_64-pc-windows-gnu. and all I get is:

build/x86_64-pc-windows-gnu
└─── native
    └─── rtstartup
        ├─── rsbegin.o
        └─── rsend.o

If you want rustc itself to be available for Windows too, you additionally need --host x86_64-pc-windows-gnu as argument. And may need --stage 2 too.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.