Skip to content

Python failed to build with LINK : error LNK2001: unresolved external symbol on windows using MSVC target ARM64EC  #101971

Open
@spacelg

Description

@spacelg

Hi All,

We try to use msvc to build Python targeting ARM64EC, because there is no ARM64EC configuration in the project files, so we tried to replace the corresponding ARM64 configuration with ARM64EC according to the modification in the PR bpo-36941: Windows build changes for Windows ARM64 (GH-13365), but after rebuilding, it failed in with LINK : error LNK2001: unresolved external symbol on windows using MSVC target ARM64EC, Could you please help look at this issue? Do you have any plans to support windows ARM64EC?

Repro Steps:

  1. git clone https://github.com/python/cpython F:\gitP\python\cpython
  2. Open a vs2019 x64 cmd && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=arm64
  3. cd F:\gitP\python\cpython\PCBuild
  4. Apply python_ARM64EC.patch (replace the corresponding ARM64 configuration with ARM64EC)
  5. build -e -r --no-tkinter -v "/p:PlatformToolset=v142" "/p:WindowsTargetPlatformVersion=10.0.22618.0"

build_arm64ec.log
python_ARM64EC.patch

ErrorMessage:
..
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\bin\HostX64\arm64\link.exe /ERRORREPORT:QUEUE /OUT:"F:\gitP\python\cpython\PCbuild\win32\python3.dll" /INCREMENTAL:NO /NOLOGO /LIBPATH:F:\gitP\python\cpython\PCbuild\win32\ advapi32.lib shell32.lib ole32.lib oleaut32.lib softintrin.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NODEFAULTLIB:LIBC /MANIFEST:NO /DEBUG /PDB:"F:\gitP\python\cpython\PCbuild\win32\python3.pdb" /SUBSYSTEM:WINDOWS /LTCG /LTCGOUT:"F:\gitP\python\cpython\PCbuild\obj\312win32_Release\python3dll\python3.iobj" /TLBID:1 /NOENTRY /DYNAMICBASE /NXCOMPAT /IMPLIB:"F:\gitP\python\cpython\PCbuild\win32\python3.lib" /MACHINE:ARM64EC /OPT:REF,NOICF /DLL F:\gitP\python\cpython\PCbuild\obj\312win32_Release\python3dll\python_nt.res
F:\gitP\python\cpython\PCbuild\obj\312win32_Release\python3dll\python3dll.obj
10>LINK : error LNK2001: unresolved external symbol PyAIter_Check (EC Symbol) [F:\gitP\python\cpython\PCbuild\python3dll.vcxproj]
10>LINK : error LNK2001: unresolved external symbol PyArg_Parse (EC Symbol) [F:\gitP\python\cpython\PCbuild\python3dll.vcxproj]
10>LINK : error LNK2001: unresolved external symbol PyArg_ParseTuple (EC Symbol) [F:\gitP\python\cpython\PCbuild\python3dll.vcxproj]
10>LINK : error LNK2001: unresolved external symbol PyArg_ParseTupleAndKeywords (EC Symbol) [F:\gitP\python\cpython\PCbuild\python3dll.vcxproj]
10>LINK : error LNK2001: unresolved external symbol PyArg_UnpackTuple (EC Symbol) [F:\gitP\python\cpython\PCbuild\python3dll.vcxproj]
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions