From 2026bdb3da878187d4c6361b8fecaaae74ff2050 Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sun, 29 Mar 2026 12:33:24 -0500 Subject: [PATCH] fix: suppress MinGW auto-export to resolve Windows DLL ordinal overflow Add src-tauri/.cargo/config.toml with --exclude-all-symbols linker flag for x86_64-pc-windows-gnu. MinGW auto-exports ~106k public Rust symbols into the cdylib export table, exceeding the 65,535 PE ordinal limit. The desktop binary links against rlib (static) so the cdylib export table is unused. An empty export table is a valid DLL. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- docs/wiki/CICD-Pipeline.md | 14 ++++++++++++++ src-tauri/.cargo/config.toml | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 src-tauri/.cargo/config.toml diff --git a/docs/wiki/CICD-Pipeline.md b/docs/wiki/CICD-Pipeline.md index 8ef5de87..082b0fd5 100644 --- a/docs/wiki/CICD-Pipeline.md +++ b/docs/wiki/CICD-Pipeline.md @@ -246,6 +246,20 @@ docker volume rm $(docker volume ls -q | grep '0_') docker restart woodpecker_agent ``` +### Windows DLL Export Ordinal Too Large +`/usr/bin/x86_64-w64-mingw32-ld: error: export ordinal too large: 106290` + +MinGW's `ld` auto-exports ALL public Rust symbols into the DLL export table. With a +large dependency tree (~106k symbols), this exceeds the 65,535 PE ordinal limit. + +Fix: `src-tauri/.cargo/config.toml` tells `ld` to suppress auto-export: +```toml +[target.x86_64-pc-windows-gnu] +rustflags = ["-C", "link-arg=-Wl,--exclude-all-symbols"] +``` +The desktop `main.exe` links against `rlib` (static), so the cdylib export table is +unused at runtime. An empty export table is valid for a DLL. + ### Gogs OAuth2 Limitation Gogs 0.14 has no OAuth2 provider support, blocking upgrade to Woodpecker 2.x. diff --git a/src-tauri/.cargo/config.toml b/src-tauri/.cargo/config.toml new file mode 100644 index 00000000..ec6d3760 --- /dev/null +++ b/src-tauri/.cargo/config.toml @@ -0,0 +1,6 @@ +[target.x86_64-pc-windows-gnu] +# Prevent MinGW ld from auto-exporting all ~106k public symbols into the DLL +# export table, which would exceed the 65535 ordinal limit and cause a link +# error. The desktop binary links against rlib (static), so cdylib exports +# are unused at runtime. +rustflags = ["-C", "link-arg=-Wl,--exclude-all-symbols"]