Skip to content

Linking fails for Windows on nightly rust (and future stable versions) #135

Description

@Greatness7

As of rust-lang/rust#138233 mimalloc no longer compiles successfully on windows systems.

Original issue (closed as duplicate) on rust-lang repository here: rust-lang/rust#140041

As far as I can tell this is a change they intend to keep and it is expected for crate authors to adapt.

Backtrace

error: linking with `link.exe` failed: exit code: 1120
  |
  = note: "C:\\Users\\Admin\\Programs\\VisualStudio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\Admin\\AppData\\Local\\Temp\\rustc76KEBa\\symbols.o" "<2 object files omitted>" "C:\\Users\\Admin\\Projects\\test_mimalloc\\target\\release\\deps/{libmimalloc-ad67d45c7a502e86.rlib,liblibmimalloc_sys-b9c6bcbae022bf4a.rlib,liblibc-fa9e52f7b8cff268.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib"
"legacy_stdio_definitions.lib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib"
"dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Admin\\Programs\\VisualStudio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\atlmfc\\lib\\x64" "/LIBPATH:C:\\Users\\Admin\\Projects\\test_mimalloc\\target\\release\\build\\libmimalloc-sys-3b898ff4937b9f62\\out" "/OUT:C:\\Users\\Admin\\Projects\\test_mimalloc\\target\\release\\deps\\test_mimalloc.exe" "/OPT:REF,ICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:<sysroot>\\lib\\rustlib\\etc\\libstd.natvis"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: liblibmimalloc_sys-b9c6bcbae022bf4a.rlib(5a07bf3761bb5df8-static.o) : error LNK2019: unresolved external symbol __imp_OpenProcessToken referenced in function win_enable_large_os_pages␍
          liblibmimalloc_sys-b9c6bcbae022bf4a.rlib(5a07bf3761bb5df8-static.o) : error LNK2019: unresolved external symbol __imp_AdjustTokenPrivileges referenced in function win_enable_large_os_pages␍
          liblibmimalloc_sys-b9c6bcbae022bf4a.rlib(5a07bf3761bb5df8-static.o) : error LNK2019: unresolved external symbol __imp_LookupPrivilegeValueA referenced in function win_enable_large_os_pages␍
          C:\Users\Admin\Projects\test_mimalloc\target\release\deps\test_mimalloc.exe : fatal error
LNK1120: 3 unresolved externals

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions