Skip to content

linking with x86_64-w64-mingw32-gcc failed: exit code: 1 (regression on 1.87) #139529

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

Closed
tyranron opened this issue Apr 8, 2025 · 1 comment
Closed
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@tyranron
Copy link

tyranron commented Apr 8, 2025

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)

@tyranron tyranron added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 8, 2025
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 8, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Apr 8, 2025

Based on the linker error message, I believe this is a duplicate of #139352, thank you for the report.

@jieyouxu jieyouxu closed this as completed Apr 8, 2025
@jieyouxu jieyouxu added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. regression-untriaged Untriaged performance or correctness regression. labels Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants