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

修复Windows arm64无法编译的问题 #366

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Baiyuetribe
Copy link

fix #364

@Baiyuetribe
Copy link
Author

Baiyuetribe commented Aug 13, 2024

遇到新的报错,由于默认的WINDOWS ARM64不支持ASM_MASM(补充:ARM64环境下用ASM_MARMASM)。我修改为ASM后,虽然可以编译出静态库,但是最终在自己的项目里调用co.lib时,仍然会报错

co.lib(io_event.obj) : error LNK2001: 无法解析的外部符号 tb_context_jump [C:\arch\demo\build\demo.vcxproj]
co.lib(co.obj) : error LNK2001: 无法解析的外部符号 tb_context_jump [C:\arch\demo\build\demo.vcxproj]
co.lib(sched.obj) : error LNK2001: 无法解析的外部符号 tb_context_jump [C:\arch\demo\build\demo.vcxproj]
co.lib(hook_win.obj) : error LNK2001: 无法解析的外部符号 tb_context_jump [C:\arch\demo\build\demo.vcxproj]
co.lib(sock_win.obj) : error LNK2001: 无法解析的外部符号 tb_context_jump [C:\arch\demo\build\demo.vcxproj]
co.lib(sched.obj) : error LNK2019: 无法解析的外部符号 tb_context_make,函数 "public: void __cdecl co::xx::Sched::resume(struct co::xx::Coroutine *)" (?resume@Sched@xx@co@@QEAAXPEAUCoroutine@23@@Z)

其余平台win x64及mac x64和arm64都正常,就win arm64异常,不知道大佬有没有什么解决思路 @idealvin

@idealvin
Copy link
Owner

idealvin commented Sep 3, 2024

@Baiyuetribe
windows arm64 协程部分未实现,手上没有 windows arm环境测试。

你如果能写汇编的话,可以试试将 src/co/context/context_arm64.S 翻译成 windows 需要的 .asm 形式

@Baiyuetribe
Copy link
Author

@idealvin 使用cursor成功编写context_arm64.asm。现在一切运行正常,就是我不懂汇编,大佬评估下该文件是否正确

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.

Windows arm64编译报错MASM not supported on this platform
2 participants