Closed serjflint closed 11 months ago
Hi! I am trying to cross-compile pydantic-core from Linux to Windows now. PKG_CONFIG_ALLOW_CROSS=1 cargo zigbuild --release --target=x86_64-pc-windows-gnu --verbose Now I get an error error: unsupported linker arg: /tmp/rustcXEPy7L/list.def on
PKG_CONFIG_ALLOW_CROSS=1 cargo zigbuild --release --target=x86_64-pc-windows-gnu --verbose
error: unsupported linker arg: /tmp/rustcXEPy7L/list.def
I think it is somehow related to https://github.com/ziglang/zig/issues/10336#issuecomment-1042713686
If you give a hint how to fix this I will try to make a pull-request
It's added by https://github.com/rust-lang/rust/blob/8a7cab8d0ee9190471c819b2acfb9a2ec75308af/compiler/rustc_codegen_ssa/src/back/linker.rs#L664
Maybe just remove it for windows-gnu targets if the path ends with list.def?
list.def
Hi! I am trying to cross-compile pydantic-core from Linux to Windows now.
PKG_CONFIG_ALLOW_CROSS=1 cargo zigbuild --release --target=x86_64-pc-windows-gnu --verbose
Now I get an errorerror: unsupported linker arg: /tmp/rustcXEPy7L/list.def
ona linker command
```bash note: LC_ALL="C" PATH="/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/tmp/cargo/bin:/opt/zig:/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "/root/.cache/cargo-zigbuild/0.17.3/zigcc-x86_64-pc-windows-gnu.sh" "-Wl,/tmp/rustcXEPy7L/list.def" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o" "/tmp/rustcXEPy7L/symbols.o" "/app/target/x86_64-pc-windows-gnu/release/deps/_pydantic_core._pydantic_core.15b78db32cde7b56-cgu.0.rcgu.o" "/app/target/x86_64-pc-windows-gnu/release/deps/_pydantic_core.4zi939puxmyzrfap.rcgu.o" "-L" "/app/target/x86_64-pc-windows-gnu/release/deps" "-L" "/app/target/release/deps" "-L" "/app/target/x86_64-pc-windows-gnu/release/build/libmimalloc-sys-b626ca26bf89d114/out" "-L" "/tmp/cargo/registry/src/index.crates.io-6f17d22bba15001f/windows_x86_64_gnu-0.48.0/lib" "-L" "/usr/lib/python3.11" "-L" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib" "-Wl,-Bstatic" "/app/target/x86_64-pc-windows-gnu/release/deps/libmimalloc-02c8ada101dd596d.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/liblibmimalloc_sys-fb76887757e1f5d7.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libuuid-efe464b402c5b02b.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libregex-dbcafabeda300a2f.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libregex_automata-d3f0ec94e4ca60f8.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libaho_corasick-91b70d2d5338508d.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libmemchr-cbbc1fe783263323.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libregex_syntax-ae6af2031eb30733.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/liburl-624bc25526795dea.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libform_urlencoded-e2fd0363d8476cff.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libpercent_encoding-f1e86c60d7e10579.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libidna-68b1b94bf17711ab.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libunicode_normalization-dd21020464e119f4.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libtinyvec-21ffd937a7f61fbf.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libtinyvec_macros-44151150d8ef10e8.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libunicode_bidi-337d2c35368a683b.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libbase64-bb4c9eafaf4daf29.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libspeedate-27a2dd0eb630f590.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libserde_json-40f154f2023add98.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libryu-a417a84020b24d34.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libitoa-c592dd11ec03f484.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libindexmap-f7bb8547f7ad4e7e.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libequivalent-6c2d0f57c40e8e9f.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libhashbrown-5d5375d2dda572d6.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libstrum-f64dcc7cd4d4de13.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libserde-037624c2a53cd344.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libahash-a1f8f30d34fb72f7.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libgetrandom-ec7986899816e1bb.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libonce_cell-720d7962c1f0b53f.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libpyo3-fe8b49e307480226.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libmemoffset-b4bc08e763a6b599.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libparking_lot-58390d897f74d226.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libparking_lot_core-333f32145f42c721.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libwindows_targets-f46d42734ed754c7.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libcfg_if-48b3170c5f47b290.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libsmallvec-a857e3ebe3ccc801.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/liblock_api-1d29e3d9babe142a.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libscopeguard-22256050b7d4e2d8.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libpyo3_ffi-528fe6a6d8850dfc.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/liblibc-a6678b2a84bec3e0.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libnum_bigint-bfd85a50ad992a95.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libnum_integer-747eab719187dc2b.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libnum_traits-5f0a0b3e01f40234.rlib" "/app/target/x86_64-pc-windows-gnu/release/deps/libunindent-fa6dfd0e4c9af6dd.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-274cab44dc4a644c.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libpanic_unwind-0f177752b9ca8e95.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libobject-06bb167660b3da76.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libmemchr-8ab6cc09499ecf5b.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libaddr2line-126153ebe55b6775.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libgimli-3d08640ec0a90b99.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_demangle-e211ed0efcaf0dab.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd_detect-f17f8b04b9a04cbd.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libhashbrown-dc505c5f7a08eb2f.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_alloc-29139547fec356ea.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libminiz_oxide-cab94e250dc1e17d.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libadler-e6226bb3d40532fc.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libunwind-bc036f0a729eca3e.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcfg_if-b7a734954c1f5dcb.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liblibc-a254eeb9e90dc361.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc-b6fb9ac972c98305.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_core-6db27a6ad3c9479a.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcore-6fcad14090edadfc.rlib" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/libcompiler_builtins-625af2eb18940f92.rlib" "-Wl,-Bdynamic" "-lbcrypt" "-ladvapi32" "-lwindows.0.48.0" "-lpython311" "-lkernel32" "-ladvapi32" "-lbcrypt" "-lkernel32" "-lntdll" "-luserenv" "-lws2_32" "-lkernel32" "-lws2_32" "-lkernel32" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib" "-o" "/app/target/x86_64-pc-windows-gnu/release/deps/_pydantic_core.dll" "-Wl,--gc-sections" "-shared" "-Wl,--out-implib=/app/target/x86_64-pc-windows-gnu/release/deps/lib_pydantic_core.dll.a" "-Wl,-O1" "-Wl,--strip-all" "-nodefaultlibs" "/usr/local/rustup/toolchains/1.72-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-pc-windows-gnu/lib/rsend.o" ```I think it is somehow related to https://github.com/ziglang/zig/issues/10336#issuecomment-1042713686
If you give a hint how to fix this I will try to make a pull-request