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

Linker error "invalid library format; library ignored" only for debug builds on Windows #119092

Open
Jianqoq opened this issue Dec 18, 2023 · 20 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Jianqoq
Copy link

Jianqoq commented Dec 18, 2023

My program can get compile when I use --release, but if I don't use it, it will failed.

Platform: Windows 11

error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\123\\AppData\\Local\\Temp\\rustc4rT1nJ\\symbols.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.10j8pr6qot2biwmp.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.10tjwp8kcatxtjx9.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.11ec2wydbc23e8xl.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.17g0hfjmxe4iitmc.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.180t2req1pach8fw.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.196jtlc5l9d6nvjh.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.1a42wao8c6s1m0ma.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.1rq505qklmd274hc.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.1wi4zxlbo9ls68bv.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.1xm5bi4y7qcwpd1b.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.23zpah1vi4ow5rli.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.24pn5fjpgdcw4v0s.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.29be3accb7uxkey7.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.2al7pan57ubjhiw1.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.2dq3uyjjlxbwp45d.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.2fl1rg3aair7xmni.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.2rd8nftfrz4r8p8i.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.2ro85nzgbm188kr6.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.2u4rxeos8dq7rqzh.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.332v4qw30eqcio72.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.33ce0nj22w8say8z.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.3518jajvk3q47qg4.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.37nxy4acp9vtaqa1.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.37zfl4dn0bws0crz.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.390n5tdawtaxtoci.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.3ld7fqchzkmahmmr.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.3nh7urrrrpx3i5sn.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.46qkq3g6iliqaoyo.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.478w033jl8ex7eqg.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.48b3ohwm73vli1ki.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.4ylpb38zw0gy0rek.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.58z3eorkwydjp6iy.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.5d07fh0a9nrvbii2.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.5dt3xrotih9blkn4.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.629xnpjd1nn72pr.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.6eg74a7koh8mxle.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.8fowqqjf5nn23pr.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.9jbqon5ew6h7d46.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.bm942h7igzqwoh1.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.de60vj43urjwiqm.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.fqrhrqgn6gi9u97.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.k8s825yh83w604x.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.rh2f9cfwagise44.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.s7f09r6tqop22az.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.zow6imnv3k6kxrx.rcgu.o" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.3yvtm76ie88swoi6.rcgu.o" "/LIBPATH:C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps" "/LIBPATH:C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\atlmfc\\lib\\x64" "/LIBPATH:C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\build\\sys-info-11b86fef7cc477d6\\out" "/LIBPATH:C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libutensor_main-8018ca3a41f0b75d.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum-c1eaa37c7743caf7.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum_iter-6bad526b4db8dbe3.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum_rational-1b7f0551e5debed7.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum_bigint-371de3ca9483328c.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum_integer-8f8bd6c3e25c9199.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgemm-19ae2ff552000d21.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgemm_c32-d8b210fefc76a894.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgemm_c64-d807a28e0e2d91ab.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgemm_f64-2203d13dded0e92c.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgemm_f16-3c069b9b40a1e8d3.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgemm_f32-8bc227e73fb6dc42.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgemm_common-4aaf935d09edc49e.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libonce_cell-d20b4003b6caba86.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libpulp-354d26888845c706.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum_complex-5514afb27551898a.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libhalf-13e026280d630505.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libdyn_stack-9a9cccd30afaa536.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libreborrow-e6b0e601f23aa135.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libbytemuck-6be2b48df1d06a5b.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libcache_size-7b2460367a94ecb8.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libraw_cpuid-93939eb49730cde5.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libbitflags-328ecab904d0935c.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libanyhow-89740173114efeff.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libthreadpool-5c0cf5f8a069c5af.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum_cpus-aa3f3d82f79f091b.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libsys_info-562ad0e91712f2c8.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\liblibc-d1942894312345ec.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\librand_distr-9239edbc59a0f930.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libnum_traits-562c533f5f36712f.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\librand-2db7c7c1b2f63fa9.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\librand_chacha-5db8e5f680d2bdf0.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libppv_lite86-ef452d24c39e4d36.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\librand_pcg-8e608c0176243cad.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\librand_core-d77ce29d7c9cac65.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libgetrandom-5fb55a492cd08729.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\librayon-91958d43dc9605d4.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\librayon_core-969f8219b8272893.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libcrossbeam_deque-3e0d9a9109834756.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libcrossbeam_epoch-5468512845dd1fee.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libmemoffset-d49893391e216008.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libcrossbeam_utils-215c9ae9f84cc79e.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libcfg_if-fd3486bfba9b44a7.rlib" "C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\libeither-c613c4c9870cb017.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-c029129ed8af67ae.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-a68a173d84465ae9.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-8334e7dd37afc348.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_detect-34a3ab412318ab67.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-6e83954a95d3c17c.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-956408015a3d9380.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-a3d749588a7add4b.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-86294ad678722c6c.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-3ee616106607257a.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-5de07e1edce79364.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-747897f502f49f1a.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-0a7d9524c210bd3d.rlib" "C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-54ca2f8628761f08.rlib" "psapi.lib" "powrprof.lib" "legacy_stdio_definitions.lib" "bcrypt.lib" "advapi32.lib" "kernel32.lib" "advapi32.lib" "bcrypt.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "kernel32.lib" "ws2_32.lib" "kernel32.lib" "ntdll.lib" "kernel32.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:C:\\Users\\123\\Utensor\\Utensor\\utensor_main\\target\\debug\\deps\\utensor_main.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\123\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note: C:\Users\123\Utensor\Utensor\utensor_main\target\debug\deps\libutensor_main-8018ca3a41f0b75d.rlib : warning LNK4003: invalid library format; library ignored
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN4core4iter6traits8iterator8Iterator7product17ha452682545add752E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$13shape_to_size17h0871065ad57fdbf8E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN5alloc3vec9from_elem17hb804bfe6e81f16f4E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$16shape_to_strides17h39033006584b95aeE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN81_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..index..Index$LT$I$GT$$GT$5index17h323f5ceacf6f74feE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$16shape_to_strides17h39033006584b95aeE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN84_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..index..IndexMut$LT$I$GT$$GT$9index_mut17h71fc5c805b70e47cE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$16shape_to_strides17h39033006584b95aeE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN5alloc5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$8into_vec17h931f441439fe527cE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN5alloc4sync12Arc$LT$T$GT$3new17h7ad1b9a97186e28aE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2001: unresolved external symbol _ZN5alloc4sync12Arc$LT$T$GT$3new17h7ad1b9a97186e28aE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$5empty17h9d62e1bd153e7c39E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN79_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try_trait..Try$GT$6branch17h6c1f5d8a984524e4E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE
          utensor_main.46qkq3g6iliqaoyo.rcgu.o : error LNK2001: unresolved external symbol _ZN79_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try_trait..Try$GT$6branch17h6c1f5d8a984524e4E
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2001: unresolved external symbol _ZN79_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$core..ops..try_trait..Try$GT$6branch17h6c1f5d8a984524e4E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$10as_raw_mut17h0553507686077641E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2001: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$10as_raw_mut17h0553507686077641E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN153_$LT$core..result..Result$LT$T$C$F$GT$$u20$as$u20$core..ops..try_trait..FromResidual$LT$core..result..Result$LT$core..convert..Infallible$C$E$GT$$GT$$GT$13from_residual17he7ddcf7717a389f0E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2001: unresolved external symbol _ZN153_$LT$core..result..Result$LT$T$C$F$GT$$u20$as$u20$core..ops..try_trait..FromResidual$LT$core..result..Result$LT$core..convert..Infallible$C$E$GT$$GT$$GT$13from_residual17he7ddcf7717a389f0E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN5rayon5slice87_$LT$impl$u20$rayon..iter..IntoParallelIterator$u20$for$u20$$RF$mut$u20$$u5b$T$u5d$$GT$13into_par_iter17h7b6b30d201bd762dE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2001: unresolved external symbol _ZN5rayon5slice87_$LT$impl$u20$rayon..iter..IntoParallelIterator$u20$for$u20$$RF$mut$u20$$u5b$T$u5d$$GT$13into_par_iter17h7b6b30d201bd762dE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN4core3ptr86drop_in_place$LT$utensor_main..tensor..tensor_impl..tensor_core..Tensor$LT$i32$GT$$GT$17h0b138ead0012b3e6E referenced in function "?dtor$7@?0?_ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE@4HA" (?dtor$7@?0?_ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6arange17he0ba7e5400b24baaE@4HA)
          utensor_main.46qkq3g6iliqaoyo.rcgu.o : error LNK2001: unresolved external symbol _ZN4core3ptr86drop_in_place$LT$utensor_main..tensor..tensor_impl..tensor_core..Tensor$LT$i32$GT$$GT$17h0b138ead0012b3e6E
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2001: unresolved external symbol _ZN4core3ptr86drop_in_place$LT$utensor_main..tensor..tensor_impl..tensor_core..Tensor$LT$i32$GT$$GT$17h0b138ead0012b3e6E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6parent17hce0471c4a4b5ac36E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main8ptr_pool4pool8push_ptr17h59ea62f87343f32eE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor12data_convert9axis_data138_$LT$impl$u20$core..convert..Into$LT$utensor_main..tensor..data_convert..axis_data..AxisDataIter$GT$$u20$for$u20$$LP$usize$C$usize$RP$$GT$4into17h720f26a4b5ff255cE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN67_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h96bec03f11e60199E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$5shape17h424fdf52cb8aeaa9E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7strides17h0bfdbf4811728231E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN73_$LT$alloc..sync..Arc$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hbfebb318c2f5a227E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2001: unresolved external symbol _ZN73_$LT$alloc..sync..Arc$LT$T$C$A$GT$$u20$as$u20$core..ops..deref..Deref$GT$5deref17hbfebb318c2f5a227E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN107_$LT$utensor_main..tensor..tensor_impl..tensor_ptr_impl..Pointer$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h85e52ce356317352E referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E
          utensor_main.de60vj43urjwiqm.rcgu.o : error LNK2001: unresolved external symbol _ZN107_$LT$utensor_main..tensor..tensor_impl..tensor_ptr_impl..Pointer$LT$T$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h85e52ce356317352E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN4core3ptr73drop_in_place$LT$alloc..sync..Arc$LT$alloc..vec..Vec$LT$usize$GT$$GT$$GT$17h7d9606506f20a8f3E referenced in function "?dtor$30@?0?_ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E@4HA" (?dtor$30@?0?_ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17h81f1397a4df7cb48E@4HA)
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2001: unresolved external symbol _ZN4core3ptr73drop_in_place$LT$alloc..sync..Arc$LT$alloc..vec..Vec$LT$usize$GT$$GT$$GT$17h7d9606506f20a8f3E
          utensor_main.s7f09r6tqop22az.rcgu.o : error LNK2001: unresolved external symbol _ZN4core3ptr73drop_in_place$LT$alloc..sync..Arc$LT$alloc..vec..Vec$LT$usize$GT$$GT$$GT$17h7d9606506f20a8f3E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor12data_convert9axis_data149_$LT$impl$u20$core..convert..Into$LT$utensor_main..tensor..data_convert..axis_data..AxisDataIter$GT$$u20$for$u20$$RF$alloc..vec..Vec$LT$usize$GT$$GT$4into17ha1dabf53b593b4aeE referenced in function _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$7reshape17hd07e20d7cb143023E
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$13is_contiguous17h09b7db42e41e4028E referenced in function _ZN12utensor_main6tensor11tensor_impl15tensor_ops_impl81_$LT$impl$u20$utensor_main..tensor..tensor_impl..tensor_core..Tensor$LT$T$GT$$GT$10contiguous17h78145820d7d0c95cE
          utensor_main.10j8pr6qot2biwmp.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$4copy17h8cd45356ee15fc10E referenced in function _ZN12utensor_main6tensor11tensor_impl15tensor_ops_impl81_$LT$impl$u20$utensor_main..tensor..tensor_impl..tensor_core..Tensor$LT$T$GT$$GT$10contiguous17h78145820d7d0c95cE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN114_$LT$utensor_main..iterator..iterator..MyIterator$LT$T$GT$$u20$as$u20$rayon..iter..plumbing..UnindexedProducer$GT$5split17hfb0fde2be6b69fcdE referenced in function _ZN113_$LT$utensor_main..iterator..iterator..MyZip$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..UnindexedProducer$GT$5split17he02aa8fb23536ab0E
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN4core6option15Option$LT$T$GT$6unwrap17h4df0c7193f2a37ebE referenced in function _ZN113_$LT$utensor_main..iterator..iterator..MyZip$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..UnindexedProducer$GT$5split17he02aa8fb23536ab0E
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN4core3ptr104drop_in_place$LT$core..option..Option$LT$utensor_main..iterator..iterator..MyIterator$LT$i32$GT$$GT$$GT$17h682917ceed2a2592E referenced in function _ZN113_$LT$utensor_main..iterator..iterator..MyZip$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..UnindexedProducer$GT$5split17he02aa8fb23536ab0E
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN4core3ptr76drop_in_place$LT$utensor_main..iterator..iterator..MyIterator$LT$i32$GT$$GT$17hffbba1f69be187c0E referenced in function "?dtor$1@?0?_ZN113_$LT$utensor_main..iterator..iterator..MyZip$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..UnindexedProducer$GT$5split17he02aa8fb23536ab0E@4HA" (?dtor$1@?0?_ZN113_$LT$utensor_main..iterator..iterator..MyZip$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..UnindexedProducer$GT$5split17he02aa8fb23536ab0E@4HA)
          utensor_main.46qkq3g6iliqaoyo.rcgu.o : error LNK2001: unresolved external symbol _ZN4core3ptr76drop_in_place$LT$utensor_main..iterator..iterator..MyIterator$LT$i32$GT$$GT$17hffbba1f69be187c0E
          utensor_main.s7f09r6tqop22az.rcgu.o : error LNK2001: unresolved external symbol _ZN4core3ptr76drop_in_place$LT$utensor_main..iterator..iterator..MyIterator$LT$i32$GT$$GT$17hffbba1f69be187c0E
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN68_$LT$alloc..sync..Arc$LT$T$C$A$GT$$u20$as$u20$core..clone..Clone$GT$5clone17hd62b9ac50c6ce205E referenced in function _ZN12utensor_main8iterator8iterator19MyIterator$LT$T$GT$3zip17hb2e14b0ac5fed6eeE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN70_$LT$alloc..sync..Arc$LT$T$C$A$GT$$u20$as$u20$core..cmp..PartialEq$GT$2ne17hd3d31de3acb1d938E referenced in function _ZN12utensor_main8iterator8iterator19MyIterator$LT$T$GT$3zip17hb2e14b0ac5fed6eeE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main5utils17is_broadcastable217h087c0b5c26639b57E referenced in function _ZN12utensor_main8iterator8iterator19MyIterator$LT$T$GT$3zip17hb2e14b0ac5fed6eeE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN4core3cmp9PartialEq2ne17h80ea5ed52984be7fE referenced in function _ZN12utensor_main8iterator8iterator19MyIterator$LT$T$GT$3zip17hb2e14b0ac5fed6eeE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main5utils18preprocess_strides17h0a903b6b6ed11660E referenced in function _ZN12utensor_main8iterator8iterator19MyIterator$LT$T$GT$3zip17hb2e14b0ac5fed6eeE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN68_$LT$alloc..sync..Arc$LT$T$C$A$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h01e0a316e0cc75dfE referenced in function _ZN12utensor_main8iterator8iterator19MyIterator$LT$T$GT$3zip17hb2e14b0ac5fed6eeE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN4core3ptr89drop_in_place$LT$alloc..sync..Arc$LT$alloc..vec..Vec$LT$$LP$usize$C$usize$RP$$GT$$GT$$GT$17h85d29a9bb7b08f3dE referenced in function _ZN12utensor_main8iterator8iterator19MyIterator$LT$T$GT$3zip17hb2e14b0ac5fed6eeE
          utensor_main.1rq505qklmd274hc.rcgu.o : error LNK2019: unresolved external symbol _ZN118_$LT$utensor_main..iterator..iterator..MyIterator$LT$T$GT$$u20$as$u20$utensor_main..iterator..iterator..ItemGetter$GT$4next17hdcc0f4d43a80b052E referenced in function _ZN12utensor_main8iterator8iterator9fold_func17hfdbc187046edaa7aE
          utensor_main.2rd8nftfrz4r8p8i.rcgu.o : error LNK2019: unresolved external symbol _ZN94_$LT$rayon..iter..zip..ZipProducer$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$7min_len17hcb021fde729aa136E referenced in function _ZN5rayon4iter8plumbing24bridge_producer_consumer17h0ab0563fa9be183dE
          utensor_main.2rd8nftfrz4r8p8i.rcgu.o : error LNK2019: unresolved external symbol _ZN94_$LT$rayon..iter..zip..ZipProducer$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$7max_len17hbae25868bec44d1cE referenced in function _ZN5rayon4iter8plumbing24bridge_producer_consumer17h0ab0563fa9be183dE
          utensor_main.2rd8nftfrz4r8p8i.rcgu.o : error LNK2019: unresolved external symbol _ZN94_$LT$rayon..iter..zip..ZipProducer$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$8split_at17h23b3a3c94d5d3d89E referenced in function _ZN5rayon4iter8plumbing24bridge_producer_consumer6helper17h507ff6a2e9cb7aabE
          utensor_main.2rd8nftfrz4r8p8i.rcgu.o : error LNK2019: unresolved external symbol _ZN91_$LT$rayon..iter..zip..Zip$LT$A$C$B$GT$$u20$as$u20$rayon..iter..IndexedParallelIterator$GT$3len17h4c87b374951034dfE referenced in function _ZN5rayon4iter8plumbing6bridge17hcccfd8f70fc5b4d2E
          utensor_main.3518jajvk3q47qg4.rcgu.o : error LNK2019: unresolved external symbol _ZN94_$LT$core..slice..iter..IterMut$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$24__iterator_get_unchecked17hbb1123e2d859b53cE referenced in function _ZN111_$LT$core..iter..adapters..zip..Zip$LT$A$C$B$GT$$u20$as$u20$core..iter..adapters..zip..ZipImpl$LT$A$C$B$GT$$GT$13get_unchecked17h9abb1b0308bbb69eE
          utensor_main.3518jajvk3q47qg4.rcgu.o : error LNK2019: unresolved external symbol _ZN4core4iter8adapters3zip27TrustedRandomAccessNoCoerce4size17he3d0a28e9272ec41E referenced in function _ZN111_$LT$core..iter..adapters..zip..Zip$LT$A$C$B$GT$$u20$as$u20$core..iter..adapters..zip..ZipImpl$LT$A$C$B$GT$$GT$3new17haa0e20ec48c8a737E
          utensor_main.3518jajvk3q47qg4.rcgu.o : error LNK2019: unresolved external symbol _ZN111_$LT$core..iter..adapters..zip..Zip$LT$A$C$B$GT$$u20$as$u20$core..iter..adapters..zip..ZipImpl$LT$A$C$B$GT$$GT$9size_hint17ha728edc702d83ab6E referenced in function _ZN111_$LT$core..iter..adapters..zip..Zip$LT$A$C$B$GT$$u20$as$u20$core..iter..adapters..zip..ZipImpl$LT$A$C$B$GT$$GT$4fold17hcd0ac9e9e42f68e1E
          utensor_main.3518jajvk3q47qg4.rcgu.o : error LNK2019: unresolved external symbol _ZN111_$LT$core..iter..adapters..zip..Zip$LT$A$C$B$GT$$u20$as$u20$core..iter..adapters..zip..ZipImpl$LT$A$C$B$GT$$GT$13get_unchecked17h597c24137f40b722E referenced in function _ZN111_$LT$core..iter..adapters..zip..Zip$LT$A$C$B$GT$$u20$as$u20$core..iter..adapters..zip..ZipImpl$LT$A$C$B$GT$$GT$4fold17hcd0ac9e9e42f68e1E
          utensor_main.46qkq3g6iliqaoyo.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$20inp_strided_par_iter17h8467f22191bab213E referenced in function _ZN12utensor_main4main17h50de285f8b362155E
          utensor_main.48b3ohwm73vli1ki.rcgu.o : error LNK2019: unresolved external symbol _ZN5rayon4iter8plumbing8Producer7max_len17hbf543b18a02f35e7E referenced in function _ZN102_$LT$rayon..iter..enumerate..EnumerateProducer$LT$P$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$7max_len17hfce45d1480a3ee05E
          utensor_main.48b3ohwm73vli1ki.rcgu.o : error LNK2019: unresolved external symbol _ZN5rayon4iter8plumbing8Producer7min_len17hb2bdfcf81796f831E referenced in function _ZN102_$LT$rayon..iter..enumerate..EnumerateProducer$LT$P$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$7min_len17hbdcbbc19e3c643b8E
          utensor_main.48b3ohwm73vli1ki.rcgu.o : error LNK2019: unresolved external symbol _ZN90_$LT$rayon..slice..IterMutProducer$LT$T$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$8split_at17hf4e684ee2c1c856eE referenced in function _ZN102_$LT$rayon..iter..enumerate..EnumerateProducer$LT$P$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$8split_at17h731c2178d3bff2e9E
          utensor_main.48b3ohwm73vli1ki.rcgu.o : error LNK2019: unresolved external symbol _ZN90_$LT$rayon..slice..IterMutProducer$LT$T$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$9into_iter17hac9a048a33a8f378E referenced in function _ZN102_$LT$rayon..iter..enumerate..EnumerateProducer$LT$P$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$9into_iter17h3c92b86a90c39f94E
          utensor_main.48b3ohwm73vli1ki.rcgu.o : error LNK2019: unresolved external symbol _ZN87_$LT$rayon..slice..IterMut$LT$T$GT$$u20$as$u20$rayon..iter..IndexedParallelIterator$GT$3len17h3352baa97ac5d93aE referenced in function _ZN99_$LT$rayon..iter..enumerate..Enumerate$LT$I$GT$$u20$as$u20$rayon..iter..IndexedParallelIterator$GT$3len17h7b43caf06af886aeE
          utensor_main.5d07fh0a9nrvbii2.rcgu.o : error LNK2019: unresolved external symbol _ZN4core3ptr34drop_in_place$LT$anyhow..Error$GT$17h9b06971f07c37206E referenced in function _ZN79_$LT$core..result..Result$LT$T$C$E$GT$$u20$as$u20$std..process..Termination$GT$6report17h32288b72dfeaac34E
          utensor_main.629xnpjd1nn72pr.rcgu.o : error LNK2019: unresolved external symbol _ZN63_$LT$I$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hb3146c3d07bf56f0E referenced in function _ZN106_$LT$rayon..iter..for_each..ForEachConsumer$LT$F$GT$$u20$as$u20$rayon..iter..plumbing..Folder$LT$T$GT$$GT$12consume_iter17hb0af7abe40a0c7f1E
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$10empty_like17h55a9eb454d28c1b7E referenced in function _ZN12utensor_main6tensor11tensor_impl15tensor_ops_impl22contiguous_elementwise17ha4d59e01747cfb1fE
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2019: unresolved external symbol _ZN12utensor_main6tensor11tensor_impl11tensor_core15Tensor$LT$T$GT$6as_raw17hfbae94658721c3e7E referenced in function _ZN12utensor_main6tensor11tensor_impl15tensor_ops_impl22contiguous_elementwise17ha4d59e01747cfb1fE
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2019: unresolved external symbol _ZN5rayon5slice79_$LT$impl$u20$rayon..iter..IntoParallelIterator$u20$for$u20$$RF$$u5b$T$u5d$$GT$13into_par_iter17h984e341f18403574E referenced in function _ZN12utensor_main6tensor11tensor_impl15tensor_ops_impl22contiguous_elementwise17ha4d59e01747cfb1fE
          utensor_main.8fowqqjf5nn23pr.rcgu.o : error LNK2019: unresolved external symbol _ZN5rayon4iter23IndexedParallelIterator3zip17ha39af64450911062E referenced in function _ZN12utensor_main6tensor11tensor_impl15tensor_ops_impl22contiguous_elementwise17ha4d59e01747cfb1fE
          utensor_main.fqrhrqgn6gi9u97.rcgu.o : error LNK2019: unresolved external symbol _ZN94_$LT$rayon..iter..zip..ZipProducer$LT$A$C$B$GT$$u20$as$u20$rayon..iter..plumbing..Producer$GT$9into_iter17h2eaaf3c248a87f62E referenced in function _ZN5rayon4iter8plumbing8Producer9fold_with17h3c536e1657bfb688E
          C:\Users\123\Utensor\Utensor\utensor_main\target\debug\deps\utensor_main.exe : fatal error LNK1120: 57 unresolved externals


error: could not compile `utensor_main` (bin "utensor_main") due to 1 previous error
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 18, 2023
@Jianqoq
Copy link
Author

Jianqoq commented Dec 18, 2023

In my ops folder, I used macro to implement operations for my struct with a bunch of different type, from bool to f64. If I remove all the operations and left only around 5 operations like Add, Sub, Div, Shr, etc, it can pass the compilation. However, if I add one more operations, link error will occur.

@saethlin
Copy link
Member

What did you compile to produce this error? What version of Rust did you use?

@saethlin saethlin added S-unactionable C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 19, 2023
@Jianqoq
Copy link
Author

Jianqoq commented Dec 19, 2023

"rust-analyzer.linkedProjects": [
    ".\\utensor_main\\Cargo.toml",
],
"rust-analyzer.runnables.extraEnv": {
    "RUSTFLAGS": "-C target-feature=+avx2 -C target-feature=+fma -C incremental=true -C opt-level=0"
},
"rust-analyzer.server.extraEnv": {
    "RUSTFLAGS": "-C target-feature=+avx2 -C target-feature=+fma -C incremental=true -C opt-level=0"
},

I was using rust analyzer to compile it with the argument shown above. The version is stable 1.74 but I had also tried 1.76.0 nightly, none of them can compile my program in debug mode.

[package]

name = "Utensor"
version = "0.1.0"
edition = "2021"

[wordspace]
members = [
"utensor-main",
"utensor-macros",
]

[dependencies]
utensor_macros = { path = "utensor_macros" }
utensor_main = { path = "utensor_main" }

[[bin]]
name = "utensor"
path = "utensor_main/src/main.rs"

It is my workspace cargo.toml, I can see that most of the linking error are about iterator, but I am not sure why release mode can compile instead of debug.

@saethlin
Copy link
Member

Can you point us to the source code you're compiling? If one of us can compile it there's a much better chance of figuring out what's going on here.

@Jianqoq
Copy link
Author

Jianqoq commented Dec 19, 2023

https://github.com/Jianqoq/utensor-rs, this is the source code

@saethlin
Copy link
Member

I can reproduce the error on Windows. Trying Linux...

@Jianqoq
Copy link
Author

Jianqoq commented Dec 19, 2023

Thank you! Hopfully we can get it fix :)

@saethlin saethlin added A-linkage Area: linking into static, shared libraries and binaries O-windows Operating system: Windows and removed S-unactionable labels Dec 19, 2023
@saethlin
Copy link
Member

Hm, seems to manage to build on Linux which is unfortunate because I have almost no skill with Windows tooling. The build uses a pretty incredible amount of memory, so my first guess was that the object file is getting truncated or otherwise mangled because it's run over some limit in the linker or LLVM or in rustc.

So I think it's possible this is a limitation of the Windows linker, or the code that breaks rustc/LLVM is being cfg(windows), perhaps behind a dependency.

I did get this error when I switched from nightly to stable which suggests something is wrong:

error[E0514]: found crate `utensor_main` compiled by an incompatible version of rustc
 --> utensor_main/src/main.rs:4:5
  |
4 | use utensor_main::rayon::iter::ParallelIterator;
  |     ^^^^^^^^^^^^
  |
  = note: the following crate versions were found:
          crate `utensor_main` compiled by rustc 1.76.0-nightly (6a6287132 2023-12-17): /tmp/utensor-rs/target/release/deps/libutensor_main-c9123daf0cdb3b52.rlib
  = help: please recompile that crate using this compiler (rustc 1.76.0-nightly (3f28fe133 2023-12-18)) (consider running `cargo clean` first)

@saethlin saethlin changed the title Compile fail when using debug Linker error "invalid library format; library ignored" only for debug builds on Windows Dec 19, 2023
@Jianqoq
Copy link
Author

Jianqoq commented Dec 19, 2023

It is also what I am thinking at, the memory problem. This build generate I think like at least 1000 of operations template, for example: bool + bool = bool, f32 + f64 = f64, stuff like that, generally, each operation would need to generate around 150 functions. But since there are not many, only add, sub, mul, div, rem, shl, shr, etc, shouldn't be that many. But anyway, since everything has to be implement in the same crate, so the amount of the work might huge. Do you think it is solvable?

@saethlin
Copy link
Member

I think this is a link.exe limitation or bug. LLVM's linker LLD works just fine. I really don't know how to use Windows; normally I'd configure the linker with an environment variable, but I can also tell that

cargo rustc -- -Clinker=lld-link.exe

will build just fine. Any other way of setting your linker to lld-link.exe should be able to build.

@ChrisDenton
Copy link
Member

ChrisDenton commented Dec 21, 2023

Library files are a type of archive containing many object files. The first file in the archive is a directory of public symbols that's just called /. However, the library file in the OP starts with a file called /SYM64/ which is not understood by MSVC. It is by LLVM which is why using lld-link works.

So the issue is that rustc is producing libraries in a format that MSVC does not understand and then passing them to the MSVC linker. Note that /SYM64/ is an extension that allows for a larger symbol table which is likely the reason it's being used.

I'm pretty sure this is a compiler bug.

@ChrisDenton ChrisDenton added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 21, 2023
@ChrisDenton
Copy link
Member

Oh, the problem with /SYM64/ in msvc rlibs has come up before in #88351. cc @ehuss, do you happen to have any more context here?

@ehuss
Copy link
Contributor

ehuss commented Dec 21, 2023

Sorry, I have not tested 64-bit archive lookup tables with link.exe. The / entry fundamentally only supports 32-bit offsets, so when the file size exceeds 4GB, it can only use /SYM64/.

which is not understood by MSVC

Can you say how you determined that is the issue?

If link.exe does not support 64-bit archive lookup tables, then I don't think there is anything rustc can do here?

@ChrisDenton
Copy link
Member

Well it can, for example, use two archives instead of one, no? Unless there's really no way to arrange things to fit then I support it would have to error.

Can you say how you determined that is the issue?

By looking at the rlib that failed in a hex editor. See also Archive (Library) File Format.

@bjorn3
Copy link
Member

bjorn3 commented Dec 22, 2023

Well it can, for example, use two archives instead of one, no?

Cargo and basically every other build tool expect only a single file to be emitted, --emit link=/path/to/rlib only accepts a single output file and --extern only accepts a single input file per crate. And finally given a single object file with enough large symbols the symbol table itself can exceed 4GB and thus push the object file beyond 4GB. In other words it would be possible but require a large coordinated effort across all build tools that support cargo to support this, some of which only support a single output file produced by a build step.

@ChrisDenton
Copy link
Member

That's only true for rlibs. What matters here is only what's being sent to the linker, not the format of rlibs in general (which iirc are completely undocumented).

Yes it's convenient if rlibs are directly compatible with the linker but if that's not possible a conversion step can happen completely invisibly when it's time to link.

@bjorn3
Copy link
Member

bjorn3 commented Dec 22, 2023

I guess. Wouldn't work for staticlibs though.

@ehuss
Copy link
Contributor

ehuss commented Dec 24, 2023

By looking at the rlib that failed in a hex editor. See also Archive (Library) File Format.

My question was more of how you determined that not having a / entry was the issue? The linker error only says LNK4003: invalid library format; library ignored. I'm wondering if there is some other issue, perhaps it just doesn't like some other aspect of the archive format. For example, maybe the format of the /SYM64/ is missing something, or it is expecting a // entry, or something else.

@ChrisDenton
Copy link
Member

As you can see from Archive (Library) File Format (linked earlier), in msvc a lib file must start with !<arch>\n. This is then directly followed by the header of what it calls the "first linker member". The "Name" field is the first field in the header and we're told that the "name of the first linker member is /". The name field is padded with spaces thus that becomes / . So putting that together, a valid msvc lib must start with:

Text Hex
!<arch>\n/ 21 3C 61 72 63 68 3E 0A 2F 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

Opening up in the "invalid" lib file in a hex editor I see

Text Hex
!<arch>\n/SYM64/ 21 3C 61 72 63 68 3E 0A 2F 53 59 4D 36 34 2F 20 20 20 20 20 20 20 20 20

The first member is not called / so it's not valid according to the spec.

Might there be other problems with the /SYM64/ table? That's pretty irrelevant given the lack of support for it in the first place.

@ehuss
Copy link
Contributor

ehuss commented Dec 24, 2023

Oh, I see! Thanks! Yea, searching around it seems that 64-bit archives simply aren't supported. 😦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants