experimental toolchain downloadable from (note u will need cross gcc from msys2-cygwin (unoffical) to use it): https://github.com/ookiineko-cygport/rust/releases
Get cross compiler at https://copr.fedorainfracloud.org/coprs/yselkowitz/cygwin/
build deps from src or steal sysroot from an existing cygwin install
To cross-compile Rust programs (for example magiskboot) u need these in your ~/.cargo/config.toml
[patch.crates-io]
libc_0_2_135 = { git = 'https://github.com/ookiineko-cygport/libc.git', package = 'libc', branch = '0.2.135' }
libc_0_2_148 = { git = 'https://github.com/ookiineko-cygport/libc.git', package = 'libc', branch = '0.2.148' }
libc_0_2_152 = { git = 'https://github.com/ookiineko-cygport/libc.git', package = 'libc', branch = '0.2.152' }
libc_0_2_153 = { git = 'https://github.com/ookiineko-cygport/libc.git', package = 'libc', branch = '0.2.153' }
cc_1_0_77 = { git = 'https://github.com/ookiineko-cygport/cc-rs.git', package = 'cc', branch = '1.0.77' }
cc_1_0_83 = { git = 'https://github.com/ookiineko-cygport/cc-rs.git', package = 'cc', branch = '1.0.83' }
compiler_builtins = { git = 'https://github.com/ookiineko-cygport/compiler-builtins.git' }
getrandom0_2_0 = { git = 'https://github.com/ookiineko-cygport/getrandom.git', package = 'getrandom', branch = '0.2.0' }
getrandom0_2_10 = { git = 'https://github.com/ookiineko-cygport/getrandom.git', package = 'getrandom', branch = '0.2.10' }
getrandom0_2_12 = { git = 'https://github.com/ookiineko-cygport/getrandom.git', package = 'getrandom', branch = '0.2.12' }
socket2 = { git = 'https://github.com/ookiineko-cygport/socket2.git' }
psm = { git = 'https://github.com/ookiineko-cygport/stacker.git' }
mio = { git = 'https://github.com/ookiineko-cygport/mio.git' }
tokio = { git = 'https://github.com/ookiineko-cygport/tokio.git' }
libloading_0_7_1 = { git = 'https://github.com/ookiineko-cygport/rust_libloading.git', package = 'libloading', branch = '0.7.1' }
libloading_0_7_3 = { git = 'https://github.com/ookiineko-cygport/rust_libloading.git', package = 'libloading', branch = '0.7.3' }
openssl-src = { git = 'https://github.com/ookiineko-cygport/openssl-src-rs.git' }
os_info = { git = 'https://github.com/ookiineko-cygport/os_info.git' }
cmake = { git = 'https://github.com/ookiineko-cygport/cmake-rs.git' }
ctest2 = { git = 'https://github.com/ookiineko-cygport/ctest2.git' }
this is needed bcs most crates doesn't support Cygwin and we have to patch them.
download magiskboot source from https://github.com/ookiineko/magiskboot_build, checkout to de80176321a4ed7086e6dcfb0127f8f28c1a23e3
remember to downgrade a few crates that require newer rustc version
Problem: LLVM unable to initialize in native rustc
- panic (stacktrace) sometimes not working