Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: update to 1.77.1 #20397

Merged
merged 8 commits into from
Apr 3, 2024
Merged

rust: update to 1.77.1 #20397

merged 8 commits into from
Apr 3, 2024

Conversation

filnet
Copy link
Contributor

@filnet filnet commented Mar 20, 2024

@filnet filnet marked this pull request as draft March 20, 2024 23:02
@filnet
Copy link
Contributor Author

filnet commented Mar 21, 2024

CLANG32 is the loner...

error: linking with `clang` failed: exit code: 1
    |
    = note: "clang" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-Wl,--large-address-aware" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsbegin.o" "D:\\M\\msys64\\tmp\\rustcErS6Yq\\symbols.o" "C:/_/B/src/CLANG32/build/bootstrap\\debug\\build\\windows_i686_gnu-aa3f329de6df47e2\\build_script_build-aa3f329de6df47e2.build_script_build.f37e2ead72758152-cgu.0.rcgu.o" "C:/_/B/src/CLANG32/build/bootstrap\\debug\\build\\windows_i686_gnu-aa3f329de6df47e2\\build_script_build-aa3f329de6df47e2.5bswo3llfzo1dgb7.rcgu.o" "-L" "C:/_/B/src/CLANG32/build/bootstrap\\debug\\deps" "-L" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-Wl,-Bstatic" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libstd-61edd68fedab197a.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libpanic_unwind-a8caf3c2c86a2299.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libobject-e4a3ac143fc85171.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libmemchr-4a6c1366628bf690.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libaddr2line-11616d53bf36b427.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libgimli-9d232a32a81a257c.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_demangle-53578b8b398c4889.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libstd_detect-b6134ac458d24d93.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libhashbrown-7c07d8a0d8f49bfd.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-9a85460e4da4c847.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libminiz_oxide-16b28f7c4fc1caf7.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libadler-35690024bcc3846b.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libunwind-60df09bfb9e011f8.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcfg_if-c6a69194907dbdac.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\liblibc-69a57e92260b3214.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\liballoc-4aee5b77527e80db.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_std_workspace_core-ebf80429459d0158.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcore-a7834f0c1fa91c64.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcompiler_builtins-3ad82a9707b3fe3a.rlib" "-Wl,-Bdynamic" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lntdll" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-o" "C:/_/B/src/CLANG32/build/bootstrap\\debug\\build\\windows_i686_gnu-aa3f329de6df47e2\\build_script_build-aa3f329de6df47e2.exe" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "-LC:/_/B/src/CLANG32/build/missing-libs-hack" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsend.o"
    = note: clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
            ld.lld: error: undefined symbol: ___register_frame_info
            >>> referenced by C:\_\B\src\CLANG32\build\i686-pc-windows-gnu\stage0\lib\rustlib\i686-pc-windows-gnu\lib\rsbegin.o:(rsbegin::eh_frames::init::h2357c9895245ac8f)
            
            ld.lld: error: undefined symbol: ___deregister_frame_info
            >>> referenced by C:\_\B\src\CLANG32\build\i686-pc-windows-gnu\stage0\lib\rustlib\i686-pc-windows-gnu\lib\rsbegin.o:(rsbegin::eh_frames::uninit::he7caf1a310466a98)
            clang: error: linker command failed with exit code 1 (use -v to see invocation)

@filnet
Copy link
Contributor Author

filnet commented Mar 21, 2024

Some remarks/questions:

@mati865, @jeremyd2019 any hunch as to what is going on ?

@filnet filnet changed the title rust: update to 1.77.0 pre-release rust: update to 1.77.0 Mar 21, 2024
@filnet
Copy link
Contributor Author

filnet commented Mar 21, 2024

Interestingly, the CLANG32 build that uses "our" previous Rust (i.e. with bootstrapping=no) passes the bootstrap stage but fails at the next stage (stage 0).

Building stage0 library artifacts (i686-pc-windows-gnu)

[...]

 error: linking with `clang` failed: exit code: 1
    |
    = note: "clang" "-Wl,D:\\M\\msys64\\tmp\\rustcn07LXS\\list.def" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-Wl,--large-address-aware" "D:\\M\\msys64\\tmp\\rustcn07LXS\\symbols.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.00.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.01.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.02.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.03.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.04.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.05.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.06.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.07.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.08.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.09.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.10.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.11.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.12.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.13.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.14.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.std.ac5cca2121068465-cgu.15.rcgu.o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.czu560qbndlpjvu.rcgu.rmeta" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.1ifi826uq14nltjv.rcgu.o" "-L" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps" "-L" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\release\\deps" "-L" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\build\\compiler_builtins-6121261783a3d90a\\out" "-L" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-Wl,-Bdynamic" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lntdll" "-Wl,-Bstatic" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libpanic_unwind-b13b2b9b16e7e825.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libobject-c7bd465b60cb8745.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libmemchr-8214d8dc9f271966.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libaddr2line-ee29260ab2620bef.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libgimli-a4ab3d37d3e4a5a7.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\librustc_demangle-921016c96804eb87.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libstd_detect-44fa462c0fa9fd86.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libhashbrown-ed77706a3fc74d39.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\librustc_std_workspace_alloc-c2504b5c6f5e7ef0.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libminiz_oxide-28e72b2111d8dd19.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libadler-43ad79ec50a1cbf7.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libunwind-021424ab701b7084.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libcfg_if-64c436d6e82868dc.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\liblibc-b63fb1a1e4253844.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\liballoc-7942dee9fbecb7a4.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\librustc_std_workspace_core-207e7f197307db63.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libcore-1dbd9489092ce756.rlib" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libcompiler_builtins-b4f82aaea392a565.rlib" "-Wl,-Bdynamic" "-l:libunwind.dll.a" "-Wl,--nxcompat" "-L" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-sysroot\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-o" "C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\std-a8e49522c5820595.dll" "-shared" "-Wl,--out-implib=C:\\_\\B\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0-std\\i686-pc-windows-gnu\\release\\deps\\libstd-a8e49522c5820595.dll.a" "-Wl,-O1"
    = note: ld.lld: error: undefined symbol: ___chkstk
  
            >>> referenced by libcompiler_builtins-b4f82aaea392a565.rlib(compiler_builtins-b4f82aaea392a565.compiler_builtins.7e56135fdaf6b426-cgu.127.rcgu.o):(___alloca)
  
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
  
            
  
  error: could not compile `std` (lib) due to 1 previous error

@filnet filnet mentioned this pull request Mar 22, 2024
@ognevny
Copy link
Collaborator

ognevny commented Mar 22, 2024

forgot to say. we've upgraded to llvm 18, but rust will support it only at 1.78.0. try backporting relevant PR

update: rust-lang/rust#120055

@mati865
Copy link
Collaborator

mati865 commented Mar 22, 2024

Chstk issue is basically lack of this PR: rust-lang/compiler-builtins#575

Rsbegin and rsend crates should not be built in clang envs, probably we have to disable them somewhere in bootstrap crate.

@filnet
Copy link
Contributor Author

filnet commented Mar 22, 2024

forgot to say. we've upgraded to llvm 18, but rust will support it only at 1.78.0. try backporting relevant PR

update: rust-lang/rust#120055

The patch fails to apply (same as here #20337)

EDIT: that patch seems to be mostly concerned about building LLVM 18.

@mati865
Copy link
Collaborator

mati865 commented Mar 24, 2024

Rsbegin and rsend crates should not be built in clang envs, probably we have to disable them somewhere in bootstrap crate.

Since our targets still identify as windws-gnu rather than windows-gnullvm this check doesn't return early: https://github.com/rust-lang/rust/blob/4a52e9cc2acf102da113d1b6c712afc5fcf4db13/src/bootstrap/src/core/build_steps/compile.rs#L766
The easiest fix would be to create patch (applied only for Clang envs) that makes it always return, e.g. by removing the negation ! (this way we avoid warnings about unreachable code that are denied by bootstrap by the default).

@filnet
Copy link
Contributor Author

filnet commented Mar 24, 2024

The easiest fix would be to create patch (applied only for Clang envs) that makes it always return, e.g. by removing the negation ! (this way we avoid warnings about unreachable code that are denied by bootstrap by the default).

Just tried that and it did not make a difference.

@filnet
Copy link
Contributor Author

filnet commented Mar 24, 2024

The problematic rsbuild.o and rsend.o are not the result of bootstrap compilation but are installed from the previous rust version.

...
  extracting rust-std-1.76.0-i686-pc-windows-gnu/rust-std-i686-pc-windows-gnu/lib/rustlib/i686-pc-windows-gnu/lib/self-contained/crt2.o
  extracting rust-std-1.76.0-i686-pc-windows-gnu/rust-std-i686-pc-windows-gnu/lib/rustlib/i686-pc-windows-gnu/lib/self-contained/dllcrt2.o
  extracting rust-std-1.76.0-i686-pc-windows-gnu/rust-std-i686-pc-windows-gnu/lib/rustlib/i686-pc-windows-gnu/lib/rsend.o
  extracting rust-std-1.76.0-i686-pc-windows-gnu/rust-std-i686-pc-windows-gnu/lib/rustlib/i686-pc-windows-gnu/lib/rsbegin.o
...

@filnet
Copy link
Contributor Author

filnet commented Mar 24, 2024

Here is a verbose build up to the first linking error:

Building bootstrap
running: C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/cargo.exe build --manifest-path C:/M/mingw-w64-rust/src/rustc-1.77.0-src/src/bootstrap/Car
go.toml --verbose
   Compiling winapi-i686-pc-windows-gnu v0.4.0
   Compiling windows_i686_gnu v0.52.0
   Compiling proc-macro2 v1.0.76
   Compiling winapi v0.3.9
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.4
   Compiling typenum v1.17.0
   Compiling memchr v2.7.1
   Compiling serde v1.0.195
   Compiling cc v1.0.73
   Compiling crossbeam-utils v0.8.18
   Compiling libc v0.2.151
   Compiling pkg-config v0.3.28
   Compiling anstyle v1.0.4
   Compiling regex-syntax v0.8.2
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build 'C:\Users\Philippe\.cargo\registry\src\inde
x.crates.io-1cd66030c949c28d\winapi-i686-pc-windows-gnu-0.4.0\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width
=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C metadata=fc4712a389a91b4c -C extra-filename=-fc4712a389a91b4c --out-dir 'C:/M/mingw-w64-rust/src/CLANG
32/build/bootstrap\debug\build\winapi-i686-pc-windows-gnu-fc4712a389a91b4c' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -
-cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2021 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\proc-macro2-1.0.76\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-widt
h=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=791b2d1e1d688c5d -C extra-filename=-7
91b2d1e1d688c5d --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\proc-macro2-791b2d1e1d688c5d' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/
src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-
libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2021 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\windows_i686_gnu-0.52.0\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic
-width=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C metadata=aa3f329de6df47e2 -C extra-filename=-aa3f329de6df47e2 --out-dir 'C:/M/mingw-w64-rust/src
/CLANG32/build/bootstrap\debug\build\windows_i686_gnu-aa3f329de6df47e2' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap
-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name unicode_ident --edition=2018 'C:\Users\Philippe\.cargo\registr
y\src\index.crates.io-1cd66030c949c28d\unicode-ident-1.0.12\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width
=167 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=6a199b5d1cc1ece5 -C extra-filename=-6a199b5d1cc1ece5 --out-dir 'C:/M/mingw-w64-rust/
src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms
-Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build 'C:\Users\Philippe\.cargo\registry\src\inde
x.crates.io-1cd66030c949c28d\winapi-0.3.9\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type bi
n --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="consoleapi"' --cfg 'feature="errhandlingapi"' --cfg 'feature="fileapi"' --cfg 'feature="guiddef"' --cfg 'feat
ure="handleapi"' --cfg 'feature="ioapiset"' --cfg 'feature="minwindef"' --cfg 'feature="processenv"' --cfg 'feature="processthreadsapi"' --cfg 'feature="securitybaseapi
"' --cfg 'feature="shellapi"' --cfg 'feature="std"' --cfg 'feature="sysinfoapi"' --cfg 'feature="winbase"' --cfg 'feature="wincon"' --cfg 'feature="winerror"' --cfg 'fe
ature="winioctl"' --cfg 'feature="winnt"' -C metadata=ac76d0172874e204 -C extra-filename=-ac76d0172874e204 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\de
bug\build\winapi-ac76d0172874e204' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunu
sed_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name cfg_if --edition=2018 'C:\Users\Philippe\.cargo\registry\src\i
ndex.crates.io-1cd66030c949c28d\cfg-if-1.0.0\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-ty
pe lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=cbb67a30795eb835 -C extra-filename=-cbb67a30795eb835 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/bui
ld/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifeti
mes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name version_check 'C:\Users\Philippe\.cargo\registry\src\index.cra
tes.io-1cd66030c949c28d\version_check-0.9.4\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-typ
e lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=c7c9b4055b07f45e -C extra-filename=-c7c9b4055b07f45e --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/buil
d/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetim
es -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_main --edition=2018 'C:\Users\Philippe\.cargo\reg
istry\src\index.crates.io-1cd66030c949c28d\typenum-1.17.0\build/main.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-widt
h=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C metadata=471eda2561d3c145 -C extra-filename=-471eda2561d3c145 --out-dir 'C:/M/mingw-w64-rust/src/CLAN
G32/build/bootstrap\debug\build\typenum-471eda2561d3c145' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -
Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name memchr --edition=2021 'C:\Users\Philippe\.cargo\registry\src\i
ndex.crates.io-1cd66030c949c28d\memchr-2.7.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-ty
pe lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=200c8864693695f1 -C extra-f
ilename=-200c8864693695f1 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bo
otstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2018 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\serde-1.0.195\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167
 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=b181b597c51ab414 -C extra-filename=-b181b597c51ab
414 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\serde-b181b597c51ab414' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/
bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name cc --edition=2018 'C:\Users\Philippe\.cargo\registry\src\index
.crates.io-1cd66030c949c28d\cc-1.0.73\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type lib
--emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=3eb128d958ea6a34 -C extra-filename=-3eb128d958ea6a34 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/boot
strap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dw
arnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2021 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\crossbeam-utils-0.8.18\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-
width=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="std"' -C metadata=3acc544c852773c8 -C extra-filename=-3acc544c852773c8 --out-dir 'C:
/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\crossbeam-utils-3acc544c852773c8' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstr
ap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build 'C:\Users\Philippe\.cargo\registry\src\inde
x.crates.io-1cd66030c949c28d\libc-0.2.151\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type bi
n --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=583242c032593e80 -C extra-filename=-583242c032593e80 --out-dir 'C
:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\libc-583242c032593e80' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\d
eps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name pkg_config 'C:\Users\Philippe\.cargo\registry\src\index.crates
.io-1cd66030c949c28d\pkg-config-0.3.28\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type lib
 --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=3ca8dbd1a2a6c2d6 -C extra-filename=-3ca8dbd1a2a6c2d6 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/boo
tstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -D
warnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name regex_syntax --edition=2021 'C:\Users\Philippe\.cargo\registry
\src\index.crates.io-1cd66030c949c28d\regex-syntax-0.8.2\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=16
7 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="std"' -C metadata=f48d517662ab1012 -C extra-filename=-f48d517662ab1012 --out-dir 'C
:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow
-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name anstyle --edition=2021 'C:\Users\Philippe\.cargo\registry\src\
index.crates.io-1cd66030c949c28d\anstyle-1.0.4\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-
type lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=9de60c98bd411b59 -C extra-filename=-9de60c98bd411
b59 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --
cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling heck v0.4.1
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name heck --edition=2018 'C:\Users\Philippe\.cargo\registry\src\ind
ex.crates.io-1cd66030c949c28d\heck-0.4.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type l
ib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="default"' -C metadata=d261238b4b5a0e4b -C extra-filename=-d261238b4b5a0e4b --out-dir 'C:/M/mingw-w6
4-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_
idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling clap_lex v0.6.0
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name clap_lex --edition=2021 'C:\Users\Philippe\.cargo\registry\src
\index.crates.io-1cd66030c949c28d\clap_lex-0.6.0\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crat
e-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=b37396cfd1a0f3b1 -C extra-filename=-b37396cfd1a0f3b1 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32
/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_li
fetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling clap_builder v4.4.12
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name clap_builder --edition=2021 'C:\Users\Philippe\.cargo\registry
\src\index.crates.io-1cd66030c949c28d\clap_builder-4.4.12\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=1
67 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="error-context"' --cfg 'feature="help"' --cfg 'feature="std"' --cfg 'feature="usage
"' -C metadata=458a3ccbb906cfb9 -C extra-filename=-458a3ccbb906cfb9 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependenc
y=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --extern 'anstyle=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps\libanstyle-9de60c98bd411b59.r
meta' --extern 'clap_lex=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps\libclap_lex-b37396cfd1a0f3b1.rmeta' --cap-lints allow -Wrust_2018_idioms -Wunused_li
fetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling semver v1.0.21
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2018 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\semver-1.0.21\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167
 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=ebfb352012508e07 -C extra-filename=-ebfb352012508
e07 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\semver-ebfb352012508e07' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build
/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
error: linking with `clang` failed: exit code: 1
  |
  = note: "clang" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-Wl,--large-address-aware" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\
i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsbegin.o" "C:\\msys64\\tmp\\rustcHqDpUJ\\symbols.o" "C:/M/mingw-w64-rust/src/CLANG32/build/bootstr
ap\\debug\\build\\winapi-i686-pc-windows-gnu-fc4712a389a91b4c\\build_script_build-fc4712a389a91b4c.build_script_build.574eb7372081009b-cgu.0.rcgu.o" "C:/M/mingw-w64-rus
t/src/CLANG32/build/bootstrap\\debug\\build\\winapi-i686-pc-windows-gnu-fc4712a389a91b4c\\build_script_build-fc4712a389a91b4c.4qdyv5qzvnzbi4a4.rcgu.o" "-L" "C:/M/mingw-
w64-rust/src/CLANG32/build/bootstrap\\debug\\deps" "-L" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib
" "-Wl,-Bstatic" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libstd-61edd68fedab197a.rlib" "C:\\M\
\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libpanic_unwind-a8caf3c2c86a2299.rlib" "C:\\M\\mingw-w64-rust
\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libobject-e4a3ac143fc85171.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build
\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libmemchr-4a6c1366628bf690.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu
\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libaddr2line-11616d53bf36b427.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rus
tlib\\i686-pc-windows-gnu\\lib\\libgimli-9d232a32a81a257c.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-
gnu\\lib\\librustc_demangle-53578b8b398c4889.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\lib
std_detect-b6134ac458d24d93.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libhashbrown-7c07d8a
0d8f49bfd.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-9a85460e4
da4c847.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libminiz_oxide-16b28f7c4fc1caf7.rlib" "C
:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libadler-35690024bcc3846b.rlib" "C:\\M\\mingw-w64-rust\\
src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libunwind-60df09bfb9e011f8.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\
i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcfg_if-c6a69194907dbdac.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\
stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\liblibc-69a57e92260b3214.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i
686-pc-windows-gnu\\lib\\liballoc-4aee5b77527e80db.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\li
b\\librustc_std_workspace_core-ebf80429459d0158.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\
libcore-a7834f0c1fa91c64.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcompiler_builtins-3a
d82a9707b3fe3a.rlib" "-Wl,-Bdynamic" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lntdll" "
-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\bu
ild\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-o" "C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\\debug\\build\\winapi-i686-pc-windows-gn
u-fc4712a389a91b4c\\build_script_build-fc4712a389a91b4c.exe" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack"
"C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsend.o"
  = note: clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
          ld.lld: error: undefined symbol: ___register_frame_info
          >>> referenced by C:\M\mingw-w64-rust\src\CLANG32\build\i686-pc-windows-gnu\stage0\lib\rustlib\i686-pc-windows-gnu\lib\rsbegin.o:(rsbegin::eh_frames::init::h2
357c9895245ac8f)

          ld.lld: error: undefined symbol: ___deregister_frame_info
          >>> referenced by C:\M\mingw-w64-rust\src\CLANG32\build\i686-pc-windows-gnu\stage0\lib\rustlib\i686-pc-windows-gnu\lib\rsbegin.o:(rsbegin::eh_frames::uninit::
he7caf1a310466a98)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: linking with `clang` failed: exit code: 1

My understanding is that the missing symbols (___register_frame_info and ___deregister_frame_info) are supposed to be provided by glibc. Is that correct ? And if yes, where have they gone ?

@mati865
Copy link
Collaborator

mati865 commented Mar 24, 2024

@MehdiChinoune it will not since it's 64-bit target and both the issues (rt{begin,end} and chsktk) affect only 32-bit platforms and since we have no 32-bit ARM target it affects only i686.

@mati865
Copy link
Collaborator

mati865 commented Mar 24, 2024

Here is a verbose build up to the first linking error:

Building bootstrap
running: C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/cargo.exe build --manifest-path C:/M/mingw-w64-rust/src/rustc-1.77.0-src/src/bootstrap/Car
go.toml --verbose
   Compiling winapi-i686-pc-windows-gnu v0.4.0
   Compiling windows_i686_gnu v0.52.0
   Compiling proc-macro2 v1.0.76
   Compiling winapi v0.3.9
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling version_check v0.9.4
   Compiling typenum v1.17.0
   Compiling memchr v2.7.1
   Compiling serde v1.0.195
   Compiling cc v1.0.73
   Compiling crossbeam-utils v0.8.18
   Compiling libc v0.2.151
   Compiling pkg-config v0.3.28
   Compiling anstyle v1.0.4
   Compiling regex-syntax v0.8.2
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build 'C:\Users\Philippe\.cargo\registry\src\inde
x.crates.io-1cd66030c949c28d\winapi-i686-pc-windows-gnu-0.4.0\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width
=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C metadata=fc4712a389a91b4c -C extra-filename=-fc4712a389a91b4c --out-dir 'C:/M/mingw-w64-rust/src/CLANG
32/build/bootstrap\debug\build\winapi-i686-pc-windows-gnu-fc4712a389a91b4c' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -
-cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2021 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\proc-macro2-1.0.76\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-widt
h=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=791b2d1e1d688c5d -C extra-filename=-7
91b2d1e1d688c5d --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\proc-macro2-791b2d1e1d688c5d' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/
src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-
libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2021 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\windows_i686_gnu-0.52.0\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic
-width=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C metadata=aa3f329de6df47e2 -C extra-filename=-aa3f329de6df47e2 --out-dir 'C:/M/mingw-w64-rust/src
/CLANG32/build/bootstrap\debug\build\windows_i686_gnu-aa3f329de6df47e2' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap
-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name unicode_ident --edition=2018 'C:\Users\Philippe\.cargo\registr
y\src\index.crates.io-1cd66030c949c28d\unicode-ident-1.0.12\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width
=167 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=6a199b5d1cc1ece5 -C extra-filename=-6a199b5d1cc1ece5 --out-dir 'C:/M/mingw-w64-rust/
src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms
-Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build 'C:\Users\Philippe\.cargo\registry\src\inde
x.crates.io-1cd66030c949c28d\winapi-0.3.9\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type bi
n --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="consoleapi"' --cfg 'feature="errhandlingapi"' --cfg 'feature="fileapi"' --cfg 'feature="guiddef"' --cfg 'feat
ure="handleapi"' --cfg 'feature="ioapiset"' --cfg 'feature="minwindef"' --cfg 'feature="processenv"' --cfg 'feature="processthreadsapi"' --cfg 'feature="securitybaseapi
"' --cfg 'feature="shellapi"' --cfg 'feature="std"' --cfg 'feature="sysinfoapi"' --cfg 'feature="winbase"' --cfg 'feature="wincon"' --cfg 'feature="winerror"' --cfg 'fe
ature="winioctl"' --cfg 'feature="winnt"' -C metadata=ac76d0172874e204 -C extra-filename=-ac76d0172874e204 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\de
bug\build\winapi-ac76d0172874e204' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunu
sed_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name cfg_if --edition=2018 'C:\Users\Philippe\.cargo\registry\src\i
ndex.crates.io-1cd66030c949c28d\cfg-if-1.0.0\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-ty
pe lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=cbb67a30795eb835 -C extra-filename=-cbb67a30795eb835 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/bui
ld/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifeti
mes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name version_check 'C:\Users\Philippe\.cargo\registry\src\index.cra
tes.io-1cd66030c949c28d\version_check-0.9.4\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-typ
e lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=c7c9b4055b07f45e -C extra-filename=-c7c9b4055b07f45e --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/buil
d/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetim
es -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_main --edition=2018 'C:\Users\Philippe\.cargo\reg
istry\src\index.crates.io-1cd66030c949c28d\typenum-1.17.0\build/main.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-widt
h=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C metadata=471eda2561d3c145 -C extra-filename=-471eda2561d3c145 --out-dir 'C:/M/mingw-w64-rust/src/CLAN
G32/build/bootstrap\debug\build\typenum-471eda2561d3c145' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -
Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name memchr --edition=2021 'C:\Users\Philippe\.cargo\registry\src\i
ndex.crates.io-1cd66030c949c28d\memchr-2.7.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-ty
pe lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="alloc"' --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=200c8864693695f1 -C extra-f
ilename=-200c8864693695f1 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bo
otstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2018 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\serde-1.0.195\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167
 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=b181b597c51ab414 -C extra-filename=-b181b597c51ab
414 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\serde-b181b597c51ab414' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/
bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name cc --edition=2018 'C:\Users\Philippe\.cargo\registry\src\index
.crates.io-1cd66030c949c28d\cc-1.0.73\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type lib
--emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=3eb128d958ea6a34 -C extra-filename=-3eb128d958ea6a34 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/boot
strap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dw
arnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2021 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\crossbeam-utils-0.8.18\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-
width=167 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="std"' -C metadata=3acc544c852773c8 -C extra-filename=-3acc544c852773c8 --out-dir 'C:
/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\crossbeam-utils-3acc544c852773c8' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstr
ap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build 'C:\Users\Philippe\.cargo\registry\src\inde
x.crates.io-1cd66030c949c28d\libc-0.2.151\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type bi
n --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=583242c032593e80 -C extra-filename=-583242c032593e80 --out-dir 'C
:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\libc-583242c032593e80' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\d
eps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name pkg_config 'C:\Users\Philippe\.cargo\registry\src\index.crates
.io-1cd66030c949c28d\pkg-config-0.3.28\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type lib
 --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=3ca8dbd1a2a6c2d6 -C extra-filename=-3ca8dbd1a2a6c2d6 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/boo
tstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -D
warnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name regex_syntax --edition=2021 'C:\Users\Philippe\.cargo\registry
\src\index.crates.io-1cd66030c949c28d\regex-syntax-0.8.2\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=16
7 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="std"' -C metadata=f48d517662ab1012 -C extra-filename=-f48d517662ab1012 --out-dir 'C
:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow
-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name anstyle --edition=2021 'C:\Users\Philippe\.cargo\registry\src\
index.crates.io-1cd66030c949c28d\anstyle-1.0.4\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-
type lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=9de60c98bd411b59 -C extra-filename=-9de60c98bd411
b59 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --
cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling heck v0.4.1
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name heck --edition=2018 'C:\Users\Philippe\.cargo\registry\src\ind
ex.crates.io-1cd66030c949c28d\heck-0.4.1\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crate-type l
ib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="default"' -C metadata=d261238b4b5a0e4b -C extra-filename=-d261238b4b5a0e4b --out-dir 'C:/M/mingw-w6
4-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_
idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling clap_lex v0.6.0
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name clap_lex --edition=2021 'C:\Users\Philippe\.cargo\registry\src
\index.crates.io-1cd66030c949c28d\clap_lex-0.6.0\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167 --crat
e-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C metadata=b37396cfd1a0f3b1 -C extra-filename=-b37396cfd1a0f3b1 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32
/build/bootstrap\debug\deps' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_li
fetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling clap_builder v4.4.12
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name clap_builder --edition=2021 'C:\Users\Philippe\.cargo\registry
\src\index.crates.io-1cd66030c949c28d\clap_builder-4.4.12\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=1
67 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no --cfg 'feature="error-context"' --cfg 'feature="help"' --cfg 'feature="std"' --cfg 'feature="usage
"' -C metadata=458a3ccbb906cfb9 -C extra-filename=-458a3ccbb906cfb9 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' -C linker=clang -L 'dependenc
y=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps' --extern 'anstyle=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps\libanstyle-9de60c98bd411b59.r
meta' --extern 'clap_lex=C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\deps\libclap_lex-b37396cfd1a0f3b1.rmeta' --cap-lints allow -Wrust_2018_idioms -Wunused_li
fetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
   Compiling semver v1.0.21
     Running `C:/M/mingw-w64-rust/src/CLANG32/build/i686-pc-windows-gnu/stage0/bin/rustc.exe --crate-name build_script_build --edition=2018 'C:\Users\Philippe\.cargo\re
gistry\src\index.crates.io-1cd66030c949c28d\semver-1.0.21\build.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=167
 --crate-type bin --emit=dep-info,link -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=ebfb352012508e07 -C extra-filename=-ebfb352012508
e07 --out-dir 'C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\debug\build\semver-ebfb352012508e07' -C linker=clang -L 'dependency=C:/M/mingw-w64-rust/src/CLANG32/build
/bootstrap\debug\deps' --cap-lints allow -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -C 'link-arg=-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack'`
error: linking with `clang` failed: exit code: 1
  |
  = note: "clang" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-Wl,--large-address-aware" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\
i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsbegin.o" "C:\\msys64\\tmp\\rustcHqDpUJ\\symbols.o" "C:/M/mingw-w64-rust/src/CLANG32/build/bootstr
ap\\debug\\build\\winapi-i686-pc-windows-gnu-fc4712a389a91b4c\\build_script_build-fc4712a389a91b4c.build_script_build.574eb7372081009b-cgu.0.rcgu.o" "C:/M/mingw-w64-rus
t/src/CLANG32/build/bootstrap\\debug\\build\\winapi-i686-pc-windows-gnu-fc4712a389a91b4c\\build_script_build-fc4712a389a91b4c.4qdyv5qzvnzbi4a4.rcgu.o" "-L" "C:/M/mingw-
w64-rust/src/CLANG32/build/bootstrap\\debug\\deps" "-L" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib
" "-Wl,-Bstatic" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libstd-61edd68fedab197a.rlib" "C:\\M\
\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libpanic_unwind-a8caf3c2c86a2299.rlib" "C:\\M\\mingw-w64-rust
\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libobject-e4a3ac143fc85171.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build
\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libmemchr-4a6c1366628bf690.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu
\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libaddr2line-11616d53bf36b427.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rus
tlib\\i686-pc-windows-gnu\\lib\\libgimli-9d232a32a81a257c.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-
gnu\\lib\\librustc_demangle-53578b8b398c4889.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\lib
std_detect-b6134ac458d24d93.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libhashbrown-7c07d8a
0d8f49bfd.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-9a85460e4
da4c847.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libminiz_oxide-16b28f7c4fc1caf7.rlib" "C
:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libadler-35690024bcc3846b.rlib" "C:\\M\\mingw-w64-rust\\
src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libunwind-60df09bfb9e011f8.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\
i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcfg_if-c6a69194907dbdac.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\
stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\liblibc-69a57e92260b3214.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i
686-pc-windows-gnu\\lib\\liballoc-4aee5b77527e80db.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\li
b\\librustc_std_workspace_core-ebf80429459d0158.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\
libcore-a7834f0c1fa91c64.rlib" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcompiler_builtins-3a
d82a9707b3fe3a.rlib" "-Wl,-Bdynamic" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lntdll" "
-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\M\\mingw-w64-rust\\src\\CLANG32\\bu
ild\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-o" "C:/M/mingw-w64-rust/src/CLANG32/build/bootstrap\\debug\\build\\winapi-i686-pc-windows-gn
u-fc4712a389a91b4c\\build_script_build-fc4712a389a91b4c.exe" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "-LC:/M/mingw-w64-rust/src/CLANG32/build/missing-libs-hack"
"C:\\M\\mingw-w64-rust\\src\\CLANG32\\build\\i686-pc-windows-gnu\\stage0\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsend.o"
  = note: clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
          ld.lld: error: undefined symbol: ___register_frame_info
          >>> referenced by C:\M\mingw-w64-rust\src\CLANG32\build\i686-pc-windows-gnu\stage0\lib\rustlib\i686-pc-windows-gnu\lib\rsbegin.o:(rsbegin::eh_frames::init::h2
357c9895245ac8f)

          ld.lld: error: undefined symbol: ___deregister_frame_info
          >>> referenced by C:\M\mingw-w64-rust\src\CLANG32\build\i686-pc-windows-gnu\stage0\lib\rustlib\i686-pc-windows-gnu\lib\rsbegin.o:(rsbegin::eh_frames::uninit::
he7caf1a310466a98)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: linking with `clang` failed: exit code: 1

My understanding is that the missing symbols (___register_frame_info and ___deregister_frame_info) are supposed to be provided by glibc. Is that correct ? And if yes, where have they gone ?

They are provided by Rust: https://github.com/rust-lang/rust/tree/master/library/rtstartup

I had missed the fact it fails during build of bootstrap which complicates things as it means my hack to the bootstrap no longer works for some reason.

@jeremyd2019
Copy link
Member

jeremyd2019 commented Mar 24, 2024

How are things (the rust ecosystem I guess) with respect to using the -gnullvm targets instead of patching the -gnu ones (#17466)? Would that avoid this issue?

@jeremyd2019
Copy link
Member

jeremyd2019 commented Mar 24, 2024

I'm got the same error trying to build rust 1.76.0 on clang32, when testing to build -gnullvm target. Perhaps it is due to too-new llvm?

Oops, that was the chkstk one, there was a PR for that referenced above, let me try that patch.

@filnet
Copy link
Contributor Author

filnet commented Mar 24, 2024

My understanding is that the missing symbols (___register_frame_info and ___deregister_frame_info) are supposed to be provided by glibc. Is that correct ? And if yes, where have they gone ?

They are provided by Rust: https://github.com/rust-lang/rust/tree/master/library/rtstartup

Are you sure that they are provided by Rust ? Seems that they are referenced but not provided: https://github.com/rust-lang/rust/blob/master/library/rtstartup/rsbegin.rs#L76

EDIT: a search for register_frame_info gives https://github.com/search?q=repo%3Arust-lang%2Frust%20register_frame_info&type=code

@jeremyd2019
Copy link
Member

OK, register/deregister error building rust on CLANG32 from master... So it's a regression due to what's in the repo, not due to this PR. Back to thinking it is due to llvm update somehow

@mati865
Copy link
Collaborator

mati865 commented Mar 24, 2024

I'm got the same error trying to build rust 1.76.0 on clang32, when testing to build -gnullvm target. Perhaps it is due to too-new llvm?

Yeah, chkstk is due to too new LLVM.

Are you sure that they are provided by Rust ? Seems that they are referenced but not provided: rust-lang/rust@master/library/rtstartup/rsbegin.rs#L76

Ah, sorry I have confused the symbols. Those are (or used to be) provided by libgcc/libunwind.

@jeremyd2019
Copy link
Member

Looks like libunwind provides ___register_frame and ___deregister_frame but not _info. They are also not present in 18.1.1-2, but are present in 17.0.6-1

@filnet
Copy link
Contributor Author

filnet commented Mar 24, 2024

Looks like libunwind provides ___register_frame and ___deregister_frame but not _info. They are also not present in 18.1.1-2, but are present in 17.0.6-1

Do we know why and when they were removed ? And what were they replaced with (if anything) ?

@jeremyd2019
Copy link
Member

jeremyd2019 commented Mar 24, 2024

llvm/llvm-project@5eb44df (the commit message says default this to on, but it appears to be defaulted to off)

@mati865
Copy link
Collaborator

mati865 commented Mar 24, 2024

So if we temporarily enable LIBUNWIND_ENABLE_FRAME_APIS, backport rust-lang/compiler-builtins#575 and change all Clang subsystems to gnullvm to get rid of that bootstrap hack. Then we can drop LIBUNWIND_ENABLE_FRAME_APIS.

@jeremyd2019
Copy link
Member

Running into issues trying to backport rust-lang/compiler-builtins#575 on CLANG32, due to the necessity to not vendor because embed-manifest dep was added. I don't know enough about rust/cargo magic to make that work. I vendored rust-installer and moved embed-manifest into rustc's vendor dir, but now it says Cargo.lock needed to be updated 🤷

@filnet
Copy link
Contributor Author

filnet commented Mar 24, 2024

This package does stuff with manifest : https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-rust/0011-disable-uac-for-installer.patch

EDIT: this patch is applied only for CLANG32.

@mati865
Copy link
Collaborator

mati865 commented Mar 24, 2024

This might be fragile but should work without reenabling vendored deps:

❯ git diff
diff --git a/Cargo.lock b/Cargo.lock
index 3110f32ade9..c2380770c02 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -741,8 +741,7 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
 [[package]]
 name = "compiler_builtins"
 version = "0.1.108"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d68bc55329711cd719c2687bb147bc06211b0521f97ef398280108ccb23227e9"
+source = "git+https://github.com/kleisauke/compiler-builtins?branch=sync-chkstk#f20144145358bd4149c78617332062f8dd7f864d"
 dependencies = [
  "cc",
  "rustc-std-workspace-core",
diff --git a/Cargo.toml b/Cargo.toml
index 5dd315ef2f7..f752267df82 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -120,6 +120,7 @@ strip = true
 rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
 rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
 rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
+compiler_builtins = { git = "https://github.com/kleisauke/compiler-builtins", branch = "sync-chkstk"}

 [patch."https://github.com/rust-lang/rust-clippy"]
 clippy_lints = { path = "src/tools/clippy/clippy_lints" }

@jeremyd2019
Copy link
Member

That's got things going further. Will probably need to do something different if we need to backport that here for real.

@jeremyd2019
Copy link
Member

jeremyd2019 commented Mar 24, 2024

This is what I get now (oh, in case I didn't make it clear - I'm still trying to build 1.76.0, not this PR):

   Compiling compiler_builtins v0.1.108 (https://github.com/kleisauke/compiler-builtins?branch=sync-chkstk#f2014414)
thread 'rustc' panicked at compiler\rustc_metadata\src\creader.rs:186:31:
index out of bounds: the len is 1 but the index is 4
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::explicit_predicates_of
      [... omitted 2 frames ...]
   4: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
   5: rustc_hir_analysis::collect::predicates_defined_on
      [... omitted 2 frames ...]
   6: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
   7: rustc_hir_analysis::collect::predicates_of::predicates_of
      [... omitted 2 frames ...]
   8: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
   9: rustc_ty_utils::ty::param_env
      [... omitted 2 frames ...]
  10: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 4]>>>
  11: <core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::VariantDef>>, <rustc_index::slice::IndexSlice<rustc_target::abi::VariantIdx, rustc_middle::ty::VariantDef>>::iter_enumerated::{closure#0}>, <rustc_middle::ty::adt::AdtDef>::discriminants::{closure#0}> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::adapters::filter_map::filter_map_fold<(rustc_target::abi::VariantIdx, rustc_middle::ty::util::Discr), (u128, rustc_middle::mir::BasicBlock), (), <rustc_mir_build::build::Builder>::perform_test::{closure#0}, <(_, _) as core::iter::traits::collect::Extend<(_, _)>>::extend::extend<u128, rustc_middle::mir::BasicBlock, smallvec::SmallVec<[u128; 1]>, smallvec::SmallVec<[rustc_middle::mir::BasicBlock; 2]>>::{closure#0}>::{closure#0}>
  12: <rustc_middle::mir::syntax::SwitchTargets>::new::<core::iter::adapters::filter_map::FilterMap<core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_middle::ty::VariantDef>>, <rustc_index::slice::IndexSlice<rustc_target::abi::VariantIdx, rustc_middle::ty::VariantDef>>::iter_enumerated::{closure#0}>, <rustc_middle::ty::adt::AdtDef>::discriminants::{closure#0}>, <rustc_mir_build::build::Builder>::perform_test::{closure#0}>>
  13: <rustc_mir_build::build::Builder>::match_simplified_candidates
  14: <rustc_mir_build::build::Builder>::match_candidates
  15: <rustc_mir_build::build::Builder>::lower_match_tree
  16: <rustc_mir_build::build::Builder>::expr_into_dest
  17: <rustc_mir_build::build::Builder>::in_scope::<<rustc_mir_build::build::Builder>::expr_into_dest::{closure#0}::{closure#0}, ()>
  18: <rustc_mir_build::build::Builder>::expr_into_dest::{closure#0}
  19: <rustc_mir_build::build::Builder>::expr_into_dest
  20: rustc_mir_build::build::mir_build::{closure#0}
  21: rustc_mir_build::build::mir_built
      [... omitted 2 frames ...]
  22: rustc_mir_transform::check_unsafety::unsafety_check_result
      [... omitted 2 frames ...]
  23: <rustc_mir_transform::check_unsafety::UnsafetyChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  24: <rustc_mir_transform::check_unsafety::UnsafetyChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  25: rustc_mir_transform::check_unsafety::unsafety_check_result
      [... omitted 2 frames ...]
  26: rustc_mir_transform::mir_const
      [... omitted 2 frames ...]
  27: rustc_mir_transform::mir_promoted
      [... omitted 2 frames ...]
  28: rustc_borrowck::mir_borrowck
      [... omitted 2 frames ...]
  29: rustc_hir_analysis::collect::type_of::type_of_opaque
      [... omitted 2 frames ...]
  30: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 4]>>>
  31: rustc_hir_analysis::collect::type_of::type_of
      [... omitted 2 frames ...]
  32: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 4]>>>
  33: <rustc_privacy::ReachEverythingInTheInterfaceVisitor>::ty
  34: <rustc_privacy::EmbargoVisitor as rustc_hir::intravisit::Visitor>::visit_item
  35: <rustc_middle::hir::map::Map>::visit_all_item_likes_in_crate::<rustc_privacy::EmbargoVisitor>
  36: rustc_privacy::effective_visibilities
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please attach the file at `C:\msys64\usr\src\MINGW-packages\mingw-w64-rust\src\rustc-1.76.0-src\rustc-ice-2024-03-24T22_45_13-4940.txt` to your bug report

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -Z unstable-options -C linker=clang -C symbol-mangling-version=legacy -Z unstable-options -Z unstable-options -Z macro-backtrace -Z unstable-options -C split-debuginfo=packed -C prefer-dynamic -Z inline-mir -C embed-bitcode=yes -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/1.76.0/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
thread panicked while processing panic. aborting.
error: could not compile `core` (lib)

Caused by:
  process didn't exit successfully: `C:\msys64\usr\src\MINGW-packages\mingw-w64-rust\src\CLANG32\build\bootstrap\debug\rustc 'C:\msys64\usr\src\MINGW-packages\mingw-w64-rust\src\CLANG32\build\bootstrap\debug\rustc' --crate-name core --edition=2021 'library\core\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=79 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -Zunstable-options --check-cfg 'cfg(feature, values("debug_refcell", "panic_immediate_abort"))' -C metadata=67763e60ae0aba87 -C extra-filename=-67763e60ae0aba87 --out-dir 'C:\msys64\usr\src\MINGW-packages\mingw-w64-rust\src\CLANG32\build\i686-pc-windows-gnu\stage2-std\i686-pc-windows-gnullvm\release\deps' --target i686-pc-windows-gnullvm -C linker=clang -L 'dependency=C:\msys64\usr\src\MINGW-packages\mingw-w64-rust\src\CLANG32\build\i686-pc-windows-gnu\stage2-std\i686-pc-windows-gnullvm\release\deps' -L 'dependency=C:\msys64\usr\src\MINGW-packages\mingw-w64-rust\src\CLANG32\build\i686-pc-windows-gnu\stage2-std\release\deps' -Csymbol-mangling-version=legacy -Zunstable-options '--check-cfg=cfg(feature,values(any()))' -Zunstable-options '--check-cfg=cfg(bootstrap,values())' '--check-cfg=cfg(stdarch_intel_sde,values())' '--check-cfg=cfg(no_fp_fmt_parse,values())' '--check-cfg=cfg(no_global_oom_handling,values())' '--check-cfg=cfg(no_rc,values())' '--check-cfg=cfg(no_sync,values())' '--check-cfg=cfg(backtrace_in_libstd,values())' '--check-cfg=cfg(target_env,values("libnx"))' '--check-cfg=cfg(target_arch,values("spirv","nvptx","xtensa"))' -Zmacro-backtrace -Zunstable-options -Csplit-debuginfo=packed -Cprefer-dynamic -Zinline-mir -Cembed-bitcode=yes '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/1.76.0/")' -Z binary-dep-depinfo` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

@jeremyd2019
Copy link
Member

I'm guessing that your rebase didn't drop (some of) the old commits, since I used a squash-merge on this PR (the history was kind of complex to merge into master IMO). I had to do rebase -i and drop the old commits manually on the branches where I am playing with switching to -gnullvm targets for CLANG64 & CLANG32.

@mati865
Copy link
Collaborator

mati865 commented Apr 4, 2024

Looks more like corrupt archive, maybe it hasn't downloaded properly?
Remove that file with rm /var/cache/pacman/pkg/mingw-w64-clang-x86_64-libunwind-18.1.2-2-any.pkg.tar.zst and try again.

@filnet
Copy link
Contributor Author

filnet commented Apr 4, 2024

It was a CI build failure.
I rebased the PR against master this time (and not this branch) and it looks better.

Still building but went past the last failure : https://github.com/msys2/MINGW-packages/pull/16207/checks

@filnet
Copy link
Contributor Author

filnet commented Apr 5, 2024

Build successful.

@Kreijstal
Copy link
Contributor

is test supposed to fail?

failures:

---- [ui] tests\ui\issues\issue-21763.rs stdout ----
$DIR\issue-21763.rs
\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\rustc-1.77.1-src\vendor\hashbrown\src\map.rs
$SRC_DIR\std\src\collections\hash\map.rs
$DIR\issue-21763.rs
diff of stderr:

8          = note: required because it appears within the type `(Rc<()>, Rc<()>)`
9          = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
10      note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
-         --> $HASHBROWN_SRC_LOCATION
+         --> E:/msys64/home/topkek/t/a/MINGW-packages/mingw-w64-rust/src/rustc-1.77.1-src/vendor/hashbrown/src/map.rs:190:12
+          |
+       LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator = Global> {
+          |            ^^^^^^^
12      note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
13        --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
14      note: required by a bound in `foo`


The actual stderr differed from the expected stderr.
Actual stderr saved to E:\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\UCRT64\build\x86_64-pc-windows-gnu\test\ui\issues\issue-21763\issue-21763.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args issues\issue-21763.rs`

error: 1 errors occurred comparing output.
status: exit code: 1
command: PATH="E:\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\UCRT64\build\x86_64-pc-windows-gnu\stage2\bin;E:\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\UCRT64\build\x86_64-pc-windows-gnu\stage0-bootstrap-tools\x86_64-pc-windows-gnu\release\deps;E:\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\UCRT64\build\x86_64-pc-windows-gnu\stage0\bin;E:\msys64\ucrt64\bin;E:\msys64\usr\local\bin;E:\msys64\usr\bin;E:\msys64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\msys64\usr\bin\site_perl;E:\msys64\usr\bin\vendor_perl;E:\msys64\usr\bin\core_perl" "E:\\msys64\\home\\topkek\\t\\a\\MINGW-packages\\mingw-w64-rust\\src\\UCRT64\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe" "E:\\msys64\\home\\topkek\\t\\a\\MINGW-packages\\mingw-w64-rust\\src\\rustc-1.77.1-src\\tests\\ui\\issues\\issue-21763.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\Users\\topkek\\.cargo" "--sysroot" "E:\\msys64\\home\\topkek\\t\\a\\MINGW-packages\\mingw-w64-rust\\src\\UCRT64\\build\\x86_64-pc-windows-gnu\\stage2" "--target=x86_64-pc-windows-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "E:\\msys64\\home\\topkek\\t\\a\\MINGW-packages\\mingw-w64-rust\\src\\UCRT64\\build\\x86_64-pc-windows-gnu\\test\\ui\\issues\\issue-21763" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=E:\\msys64\\home\\topkek\\t\\a\\MINGW-packages\\mingw-w64-rust\\src\\UCRT64\\build\\x86_64-pc-windows-gnu\\native\\rust-test-helpers" "-L" "E:\\msys64\\home\\topkek\\t\\a\\MINGW-packages\\mingw-w64-rust\\src\\UCRT64\\build\\x86_64-pc-windows-gnu\\test\\ui\\issues\\issue-21763\\auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: `Rc<()>` cannot be sent between threads safely
  --> E:\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\rustc-1.77.1-src\tests\ui\issues\issue-21763.rs:11:11
   |
LL |     foo::<HashMap<Rc<()>, Rc<()>>>();
   |           ^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
   |
   = help: within `(Rc<()>, Rc<()>)`, the trait `Send` is not implemented for `Rc<()>`, which is required by `HashMap<Rc<()>, Rc<()>>: Send`
   = note: required because it appears within the type `(Rc<()>, Rc<()>)`
   = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
  --> E:\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\rustc-1.77.1-src\vendor\hashbrown\src\map.rs:190:12
   |
LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator = Global> {
   |            ^^^^^^^
note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
  --> /rustc/FAKE_PREFIX\library\std\src\collections\hash\map.rs:213:12
note: required by a bound in `foo`
  --> E:\msys64\home\topkek\t\a\MINGW-packages\mingw-w64-rust\src\rustc-1.77.1-src\tests\ui\issues\issue-21763.rs:8:11
   |
LL | fn foo<T: Send>() {}
   |           ^^^^ required by this bound in `foo`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------



failures:
    [ui] tests\ui\issues\issue-21763.rs

test result: FAILED. 15875 passed; 1 failed; 194 ignored; 0 measured; 0 filtered out; finished in 977.58s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-pc-windows-gnu target=x86_64-pc-windows-gnu
Build completed unsuccessfully in 0:21:45
==> ERROR: A failure occurred in check().
    Aborting...

@filnet
Copy link
Contributor Author

filnet commented Apr 6, 2024

is test supposed to fail?

yes, afaik, the tests have never worked.

@Kreijstal
Copy link
Contributor

is test supposed to fail?

yes, afaik, the tests have never worked.

ah, we have 15875 done, 195 tests to go, in that case, haha.

@mati865
Copy link
Collaborator

mati865 commented Apr 6, 2024

Do you have the list of failed tests?
Some of them like debuginfo often fail because of different debugger versions.

@Kreijstal
Copy link
Contributor

Do you have the list of failed tests? Some of them like debuginfo often fail because of different debugger versions.

I assume the test that failed is tests\ui\issues\issue-21763.rs since that is the first test that failed it skipped the rest.

@filnet
Copy link
Contributor Author

filnet commented Apr 6, 2024

The first failure is:

---- [ui] tests\ui\issues\issue-21763.rs stdout ----
$DIR\issue-21763.rs
\M\mingw-w64-rust\src\rustc-1.77.1-src\vendor\hashbrown\src\map.rs
$SRC_DIR\std\src\collections\hash\map.rs
$DIR\issue-21763.rs
diff of stderr:

8	   = note: required because it appears within the type `(Rc<()>, Rc<()>)`
9	   = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
10	note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
-	  --> $HASHBROWN_SRC_LOCATION
+	  --> C:/M/mingw-w64-rust/src/rustc-1.77.1-src/vendor/hashbrown/src/map.rs:190:12
+	   |
+	LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator = Global> {
+	   |            ^^^^^^^
12	note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
13	  --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
14	note: required by a bound in `foo`

The test:

// Regression test for HashMap only impl'ing Send/Sync if its contents do

// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"

use std::collections::HashMap;
use std::rc::Rc;

fn foo<T: Send>() {}

fn main() {
    foo::<HashMap<Rc<()>, Rc<()>>>();
    //~^ ERROR `Rc<()>` cannot be sent between threads safely
}

The expected output:

error[E0277]: `Rc<()>` cannot be sent between threads safely
  --> $DIR/issue-21763.rs:11:11
   |
LL |     foo::<HashMap<Rc<()>, Rc<()>>>();
   |           ^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
   |
   = help: within `(Rc<()>, Rc<()>)`, the trait `Send` is not implemented for `Rc<()>`, which is required by `HashMap<Rc<()>, Rc<()>>: Send`
   = note: required because it appears within the type `(Rc<()>, Rc<()>)`
   = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
  --> $HASHBROWN_SRC_LOCATION
note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
  --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
note: required by a bound in `foo`
  --> $DIR/issue-21763.rs:8:11
   |
LL | fn foo<T: Send>() {}
   |           ^^^^ required by this bound in `foo`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.

The test is actually correct but the test framework fails to "normalize" the std err output.
It is supposed to replace C:/M/mingw-w64-rust/src/rustc-1.77.1-src/vendor/hashbrown/src/map.rs:190:12 with $HASHBROWN_SRC_LOCATION so that the actual output matches the expected output.

Seems the test should use a versioned hashbrown. There are three hashbrown crates in src/vendor:

  • hashbrown
  • hashbrown-0.13.2
  • hashbrown-0.14.0

I guess it is supposed to use one that has a version.
Note the dash in the normalize-stderr-test instruction:
// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"

@filnet
Copy link
Contributor Author

filnet commented Apr 6, 2024

Second failure:

---- [ui] tests\ui\issues\issue-2214.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit code: 1
command: PATH="C:\M\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage2\bin;C:\M\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage0-bootstrap-tools\x86_64-pc-windows-gnu\release\deps;C:\M\mingw-w64-rust\src\MINGW64\build\x86_64-pc-windows-gnu\stage0\bin;C:\msys64\mingw64\bin;C:\msys64\usr\local\bin;C:\msys64\usr\bin;C:\msys64\usr\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\msys64\usr\bin\site_perl;C:\msys64\usr\bin\vendor_perl;C:\msys64\usr\bin\core_perl" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe" "C:\\M\\mingw-w64-rust\\src\\rustc-1.77.1-src\\tests\\ui\\issues\\issue-2214.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\Users\\Philippe\\.cargo" "--sysroot" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2" "--target=x86_64-pc-windows-gnu" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\test\\ui\\issues\\issue-2214\\a.exe" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\native\\rust-test-helpers" "-L" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\test\\ui\\issues\\issue-2214\\auxiliary"
stdout: none
--- stderr -------------------------------
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
   |
   = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "C:\\msys64\\tmp\\rustcI8gS1G\\symbols.o" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\test\\ui\\issues\\issue-2214\\a.issue_2214.acb96087d874e44a-cgu.0.rcgu.o" "-L" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\native\\rust-test-helpers" "-L" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\test\\ui\\issues\\issue-2214\\auxiliary" "-L" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-L" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bdynamic" "-lstd-52a03da70d492f12" "-Wl,-Bstatic" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-91ce6b54f8d65f85.rlib" "-Wl,-Bdynamic" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lntdll" "-lkernel32" "-lgcc_s" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-o" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\test\\ui\\issues\\issue-2214\\a.exe" "-Wl,--gc-sections" "-no-pie" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs" "C:\\M\\mingw-w64-rust\\src\\MINGW64\\build\\x86_64-pc-windows-gnu\\stage2\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
   = note: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/libmsvcrt.a(lib64_libmsvcrt_common_a-sin.o): in function `sin':
           C:/M/B/src/mingw-w64/mingw-w64-crt/math/x86/sin.def.h:64:(.text+0x5f): undefined reference to `__sinl_internal'
           C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/libmsvcrt.a(lib64_libmsvcrt_common_a-log.o): in function `log':
           C:/M/B/src/mingw-w64/mingw-w64-crt/math/x86/log.def.h:68:(.text+0x5c): undefined reference to `__logl_internal'
           collect2.exe: error: ld returned 1 exit status
           
   = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
   = note: use the `-l` flag to specify native libraries to link
   = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

@filnet
Copy link
Contributor Author

filnet commented Apr 6, 2024

PS: the two failures are with MINGW64.

@mati865
Copy link
Collaborator

mati865 commented Apr 6, 2024

I was referring mostly to:

ah, we have 15875 done, 195 tests to go, in that case, haha.

I assumed those 195 tests are the failures and there is a list somewhere.


Hashbrown issue seems worthy reporting upstream,
Undefined references issue could be mingw-w64 regression since these symbols should be provided by mingwex.a.

@filnet
Copy link
Contributor Author

filnet commented Apr 8, 2024

The hashbrown test failure is probably caused by the --enable-vendor option.
I'll check and will report the issue upstream.

About the missing symbols: Is it expected to see lib/libmsvcrt.a(lib64_libmsvcrt_common_a-log.o when linking ?

@mati865
Copy link
Collaborator

mati865 commented Apr 8, 2024

About the missing symbols: Is it expected to see lib/libmsvcrt.a(lib64_libmsvcrt_common_a-log.o when linking ?

If you are asking about the name then yes, libmsvcrt.a is the library and lib64_libmsvcrt_common_a-log.o is the object within this library that pulled missing symbol.

@filnet
Copy link
Contributor Author

filnet commented Apr 9, 2024

Removing the --enable-vendor argument fixes the hashbrown related issue. What it the purpose of this argument ?

About the missing symbol : the libmingwex.a library does contain a lib64_libmingwex_a-sinl_internal.o object.

@jeremyd2019
Copy link
Member

Removing the --enable-vendor argument fixes the hashbrown related issue. What it the purpose of this argument ?

For me, it is two-fold.

  1. it prevents cargo from downloading a bunch of additional code during build, outside the build directory. many distributions have policies against that, and vendoring dependencies satisfies those concerns.
  2. for us, it allows us the opportunity to patch the dependencies (like we do currently with compiler_builtins, and like we did previously with windows_targets).

@filnet
Copy link
Contributor Author

filnet commented Apr 9, 2024

Opened a ticket upstream for the vendoring issue: rust-lang/rust#123688

@filnet
Copy link
Contributor Author

filnet commented Apr 11, 2024

The hashbrown/vendored issue was already fixed upstream in 1.79.0, so all good.
I have a tailored patch in the pipe. The upstream patch did not work out of the box because there is another prior, and massive, patch required.

I am starting to look into the missing symbol issue. This issue is kinda strange as sin and log are missing but not cos and other math related functions.

@jeremyd2019
Copy link
Member

That might be a candidate to ask about on the [email protected] list. if it looks like a mingw-w64 thing rather than rust.

@filnet
Copy link
Contributor Author

filnet commented Apr 11, 2024

It is for sure not related to vendored.

@filnet
Copy link
Contributor Author

filnet commented Apr 11, 2024

I'll ask on the mingw-w64 mailing list.

In the meantime, anyone knows why there is a weird C:/M/B/src/mingw-w64/mingw-w64-crt/math/x86/sin.def.h path in the error output ? In don't have a M directory on my C drive...

@mati865
Copy link
Collaborator

mati865 commented Apr 11, 2024

This issue is kinda strange as sin and log are missing but not cos and other math related functions.

No, the test links lgamma from CRT which doesn't use cos and friends: https://github.com/mingw-w64/mingw-w64/blob/91594db85c374783805c62a49929cf34f3664ee6/mingw-w64-crt/math/lgamma.c#L161

In the meantime, anyone knows why there is a weird C:/M/B/src/mingw-w64/mingw-w64-crt/math/x86/sin.def.h path in the error output ? In don't have a M directory on my C drive...

It's build path from the package builder.

@mati865
Copy link
Collaborator

mati865 commented Apr 11, 2024

The error seems to happen because Rust pulls in lgamma from libmingwex.a, which pulls in sin from libmsvcrt.a, which in turn tries to pull in __sinl_internal from libmingwex.a and fails because of how Rust links MinGW libs:

let mingw_libs = &[
    "-lmsvcrt",
    "-lmingwex",
    "-lmingw32",
    "-lgcc", // alas, mingw* libraries above depend on libgcc
    // mingw's msvcrt is a weird hybrid import library and static library.
    // And it seems that the linker fails to use import symbols from msvcrt
    // that are required from functions in msvcrt in certain cases. For example
    // `_fmode` that is used by an implementation of `__p__fmode` in x86_64.
    // The library is purposely listed twice to fix that.
    //
    // See https://github.com/rust-lang/rust/pull/47483 for some more details.
    "-lmsvcrt",
    "-luser32",
    "-lkernel32",
];

https://github.com/rust-lang/rust/blob/aa6a697a1c75b0aa06954136f7641706edadc2be/compiler/rustc_target/src/spec/base/windows_gnu.rs#L30

Due to how ld.bfd works it'd need another "-lmingwex", after second "-lmsvcrt", since this change: mingw-w64/mingw-w64@a64c1f4

If I'm right UCRT and LLD (with any CRT) are unaffected.

@filnet
Copy link
Contributor Author

filnet commented Apr 11, 2024

The OP reported the hashbrown issue on UCRT64 and was not affected by the missing symbols.
When I tried to reproduce on MINGW64, I got the missing symbols.

I'll try to add another -lmingwex after the second -lmsvcrt,
I believe it must be done here : https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/base/windows_gnu.rs#L42

EDIT: I overlooked that the link to windows_gnu.rs was given. Thanks...

PS: on CLANG we have a patch that nukes the libs list: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-rust/0007-clang-subsystem.patch#L76

@filnet
Copy link
Contributor Author

filnet commented Apr 13, 2024

Adding the extra -lmingwex fixed the test.

Should the fix be submitted upstream or is it msys2 specific ?

@jeremyd2019
Copy link
Member

I think it will be necessary upstream to work with newer mingw-w64. Assuming that this was an intentional effect of the mingw-w64 change. You still might want to ask about it on their mailing list.

@mati865
Copy link
Collaborator

mati865 commented Apr 14, 2024

Definitely upstream, it will be required once Rust upgrades their toolchain.

@filnet
Copy link
Contributor Author

filnet commented Apr 16, 2024

Switching over to #20651

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants