Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win32(arm64): call the function pointer used by erts_sys_perf_counter #8984

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

cocoa-xu
Copy link
Contributor

@cocoa-xu cocoa-xu commented Oct 24, 2024

This PR is one of the smaller PRs separated from the original PR #8142 that attempts to add initial support for ARM64 windows.

This PR fixes the following compiling errors on ARM64 Windows, and I copy-pasted the same lines from erts/emulator/beam/jit/x86/instr_common.cpp to here.

CXX    obj/win32/opt/jit/instr_common.o
beam\jit\arm\instr_common.cpp(3112): error C2039: 'perf_counter': is not a member of 'erts_sys_time_read_only_data__'
C:\src\erts\emulator\sys\win32\erl_win_sys.h(185): note: see declaration of 'erts_sys_time_read_only_data__'
beam\jit\arm\instr_common.cpp(3112): error C2672: 'BeamModuleAssembler::runtime_call': no matching overloaded function found
C:\src\erts\emulator\beam\jit\arm\beam_asm.hpp(1430): note: could be 'void BeamModuleAssembler::runtime_call(T *)'
Failed: cl.exe -nologo -D__WIN32__ -DWIN32 -DWINDOWS -D_WIN32 -DNT -D_CRT_SECURE_NO_DEPRECATE -D__aarch64__ -MD -Ox -Z7 /std:c++17 /Zc:__cplusplus -DASMJIT_EMBED=1 -DASMJIT_NO_BUILDER=1 -DASMJIT_NO_DEPRECATED=1 -DASMJIT_STATIC=1 -DASMJIT_NO_FOREIGN=1 -Iwin32/opt/jit -Ibeam -Isys/win32 -Isys/common -Iwin32 -Izlib -Ipcre -Iryu -Iopenssl/include -I../include -I../include/win32 -I../include/internal -I../include/internal/win32 -Ibeam/jit -Ibeam/jit/arm -I"C:\src\erts\win32" -D_WIN32_WINNT=0x0600 -DWINVER=0x0600 -DERTS_MIXED_VC -DSTATIC_ERLANG_DRIVER -DHAVE_CONFIG_H -DUSE_THREADS -DWIN32_THREADS -DBEAMASM=1 /std:c++17 /Zc:__cplusplus /EHsc /FS -c -FoC:\src\erts\emulator\obj\win32\opt\jit\instr_common.o beam\jit\arm\instr_common.cpp
make[4]: *** [win32/Makefile:957: obj/win32/opt/jit/instr_common.o] Error 2
make[4]: Leaving directory '/mnt/c/src/erts/emulator'
make[3]: *** [/mnt/c/src/make/run_make.mk:35: opt] Error 2
make[3]: Leaving directory '/mnt/c/src/erts/emulator'
make[2]: *** [Makefile:45: opt] Error 2
make[2]: Leaving directory '/mnt/c/src/erts'
make[1]: *** [Makefile:60: jit] Error 2
make[1]: Leaving directory '/mnt/c/src/erts'
make: *** [Makefile:483: emulator] Error 2

And good news is, with this fix we can successfully compile the ARM64 version with JIT support for Windows --

Screenshot 2024-10-24 141009

There're likely some functions not working properly at the moment, but being able to compile it will definitely help anyone who's interested in running these test suites and fixing these issues.

I'll submit another PR which documents how to compile for ARM64 Windows.

Copy link
Contributor

github-actions bot commented Oct 24, 2024

CT Test Results

    3 files    141 suites   48m 53s ⏱️
1 596 tests 1 547 ✅ 49 💤 0 ❌
2 305 runs  2 236 ✅ 69 💤 0 ❌

Results for commit bdd5c26.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@garazdawi garazdawi merged commit 0b6fe48 into erlang:master Oct 24, 2024
21 checks passed
@garazdawi
Copy link
Contributor

Nice! Thanks!

@cocoa-xu cocoa-xu deleted the cx-arm64-windows-jit branch October 24, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants