Repository navigation
linking with x86_64-w64-mingw32-gcc failed: exit code: 1 (regression on 1.87) #139529
Copy link
Copy link
Closed as duplicate
Closed as duplicate
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Code
I tried this code from tigerbeetle-unofficial-sys crate.
I expected to see this to compile and link okay:
cargo test -p tigerbeetle-unofficial-sys --all-features
but it started to give the following error:
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" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcI54lRn\\symbols.o" "<2 object files omitted>" "-Wl,-Bstatic" "-l:tb_client.lib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib/{libtest-*,libgetopts-*,libunicode_width-*,librustc_std_workspace_std-*}.rlib" "D:\\a\\tigerbeetle-unofficial\\tigerbeetle-unofficial\\target\\debug\\deps/{libbitflags-08a67e333596472b.rlib,libbytemuck-213575fa212e7cfa.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lkernel32" "-lkernel32" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-ldbghelp" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-lmingwex" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "D:\\a\\tigerbeetle-unofficial\\tigerbeetle-unofficial\\target\\debug\\build\\tigerbeetle-unofficial-sys-da5a7450d817ed23\\out\\tigerbeetle\\src/clients/c/lib\\x86_64-windows" "-o" "D:\\a\\tigerbeetle-unofficial\\tigerbeetle-unofficial\\target\\debug\\deps\\tigerbeetle_unofficial_sys-0e5de1b58cc5b609.exe" "-Wl,--gc-sections" "-no-pie" "-nodefaultlibs" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: Warning: corrupt .drectve at end of def file␍
Warning: corrupt .drectve at end of def file␍
Warning: corrupt .drectve at end of def file␍
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\a\tigerbeetle-unofficial\tigerbeetle-unofficial\target\debug\build\tigerbeetle-unofficial-sys-da5a7450d817ed23\out\tigerbeetle\src/clients/c/lib\x86_64-windows\tb_client.lib(D:/a/tigerbeetle-unofficial/tigerbeetle-unofficial/target/debug/build/tigerbeetle-unofficial-sys-da5a7450d817ed23/out/tigerbeetle/.zig-cache/o/00da0820b854c71f92b2d414ec4272aa/tb_client.lib.obj):tb_client:(.text+0xaf34d): undefined reference to `SystemFunction036'␍
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)
Version it worked on
It most recently worked on: 1.86 (current stable)
Version with regression
Starting to fail from 1.87 (current beta)
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Activity
jieyouxu commentedon Apr 8, 2025
Based on the linker error message, I believe this is a duplicate of #139352, thank you for the report.