protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Windows 64arm: unresolved external symbol __popcnt referenced in function _upb_log2_table_size

Open tawmoto opened this issue 6 months ago • 0 comments

What version of protobuf and what language are you using? Version: 6.31.0 Language: C++

What operating system (Linux, Windows, ...) and version? Windows 64 ARM

What runtime / compiler are you using (e.g., python version or gcc version) Visual Studio 2022

What did you do? Steps to reproduce the behavior: I am trying to build protobuf on Windows 64 ARM using this command (that I use for every protobuf version) P.S. Please ignore the SUBSYSTEM:CONSOLE,6.01 flag, I know is wrong, I get a warning for this, I will correct it soon.

cmake -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_WITH_ZLIB=OFF -DCMAKE_INSTALL_PREFIX="C:\BUILD\work\e71b5095dc8040d0\3rdparty_work_dir\build_protobuf_release\prefix_dir\win_arm64" -Dprotobuf_ABSL_PROVIDER=package -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_PREFIX_PATH="C:\BUILD\work\e71b5095dc8040d0\3rdparty_work_dir\build_abseil_release\prefix_dir" -Dprotobuf_MSVC_STATIC_RUNTIME=ON -DCMAKE_STATIC_LINKER_FLAGS=" /SUBSYSTEM:CONSOLE,6.01 -d2:-FH4-" -DCMAKE_EXE_LINKER_FLAGS=" /SUBSYSTEM:CONSOLE,6.01 -d2:-FH4-" -G"NMake Makefiles" -DCMAKE_C_FLAGS=" -d2FH4-" -DCMAKE_CXX_FLAGS=" -d2FH4- /EHsc" -DCMAKE_BUILD_TYPE=RELEASE C:\BUILD\work\e71b5095dc8040d0\3rdparty_work_dir\build_protobuf_release\project_dir\protobuf-31.0

What did you expect to see Building should be finished. Note: I build it on linux64, win32, win64, macos and everything is perfect. Only win64 arm has this problem.

What did you see instead?

 C:\BUILD\work\e71b5095dc8040d0\3rdparty_work_dir\build_abseil_release\prefix_dir\lib\absl_int128.lib -ignore:4221 kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1" failed (exit code 1120) with the following output:
11:28:12     [DEBUG]   libupb.lib(common.c.obj) : error LNK2019: unresolved external symbol __popcnt referenced in function _upb_log2_table_size
 [DEBUG]   protoc-gen-upb.exe : fatal error LNK1120: 1 unresolved externals
11:28:12     [DEBUG]   NMAKE : fatal error U1077: 'C:\TOOLs\cmake\3.27.2\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\protoc-gen-upb.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~1\2022\PROFES~1\VC\Tools\MSVC\1436~1.325\bin\Hostx64\arm64\link.exe /nologo @CMakeFiles\protoc-gen-upb.dir\objects1.rsp @C:\BUILD\temp\buildTmp\nm7129.tmp' : return code '0xffffffff'
11:28:12     [DEBUG]   Stop.
11:28:12     [DEBUG]   NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.36.32532\bin\HostX64\ARM64\nmake.exe"  -f CMakeFiles\protoc-gen-upb.dir\build.make /nologo -L                  CMakeFiles\protoc-gen-upb.dir\build' : return code '0x2'

tawmoto avatar May 29 '25 08:05 tawmoto