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

add option to remove -Gd flag in x86 masm #1779

Closed
xq114 opened this issue Oct 27, 2021 · 5 comments
Closed

add option to remove -Gd flag in x86 masm #1779

xq114 opened this issue Oct 27, 2021 · 5 comments

Comments

@xq114
Copy link
Contributor

xq114 commented Oct 27, 2021

你在什么场景下需要该功能?

#1777
需要去掉内置的-Gd flag

描述可能的解决方案

用set_values控制

set_values("masm.option_language", "none") -- not to add anything
set_values("masm.option_language", "c") -- /Gd
set_values("masm.option_language", "pascal") -- /Gc
set_values("masm.option_language", "stcall") -- /GZ

文档见 https://docs.microsoft.com/en-us/cpp/assembler/masm/ml-and-ml64-command-line-reference?view=msvc-160

描述你认为的候选方案

去掉默认的-Gd flag

@waruqi
Copy link
Member

waruqi commented Oct 27, 2021

改进了,默认还是带 -Gd ,毕竟跟 c 混编的 case 很常见,方便日常开发,不必额外配置 flags,也为了向下兼容。

但是用户可以自己设置 add_asflags("-Gc") 修改默认的 flag,如果用户设置了 Gc/GZ 那么内置的 -Gd 会被自动移除

@waruqi waruqi added this to the v2.5.9 milestone Oct 27, 2021
@xq114
Copy link
Contributor Author

xq114 commented Oct 27, 2021

改进了,默认还是带 -Gd ,毕竟跟 c 混编的 case 很常见,方便日常开发,不必额外配置 flags,也为了向下兼容。

但是用户可以自己设置 add_asflags("-Gc") 修改默认的 flag,如果用户设置了 Gc/GZ 那么内置的 -Gd 会被自动移除

那什么也不加怎么设置呢

@waruqi
Copy link
Member

waruqi commented Oct 27, 2021

什么都不加 默认是什么调用约定,Gd Gc GZ都不是?ml默认会是什么?

@xq114
Copy link
Contributor Author

xq114 commented Oct 27, 2021

测试了一下,应该是GZ,但网上没有相关信息我也不是很确定

@waruqi
Copy link
Member

waruqi commented Oct 27, 2021

我感觉至少是其中的一种,反正走 add_asflags 可以切

@waruqi waruqi closed this as completed Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants