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

armclang汇编警告 #5071

Closed
Dozingfiretruck opened this issue May 8, 2024 · 14 comments
Closed

armclang汇编警告 #5071

Dozingfiretruck opened this issue May 8, 2024 · 14 comments
Labels
Milestone

Comments

@Dozingfiretruck
Copy link

Xmake 版本

2.9.1

操作系统版本和架构

win10

描述问题

image
有 Warning: A3912W: Option 't' is deprecated. 警告,但是并未设置 t 参数

期待的结果

无警告

工程配置

armclang编译

附加信息和错误日志

Warning: A3912W: Option 't' is deprecated.

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: armclang assembly warning

@waruqi
Copy link
Member

waruqi commented May 8, 2024

这个好像跟 xmake 没啥关系吧,你可以自己调下 flags ,看下为啥 armclang 会显示这个警告。。xmake 没有加其他 flags

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


This seems to have nothing to do with xmake. You can adjust flags yourself to see why armclang displays this warning. . xmake does not add other flags

@Dozingfiretruck
Copy link
Author

这个好像跟 xmake 没啥关系吧,你可以自己调下 flags ,看下为啥 armclang 会显示这个警告。。xmake 没有加其他 flags

重新捋了一遍确实不应该和xmake有关系,不是xmake加的,但是却报这个,ide里显示的汇编命令有

-mcpu=cortex-m3 -masm=auto  -Wa,armasm,--diag_suppress=A1950W -c
-gdwarf-4 -Wa,armasm,--pd,"__MICROLIB SETA 1"
 -Wa,armasm, -Wa,armasm,--pd,"AIR32F10X_MD SETA 1"

但是自己写这些命令其中

 -mcpu=cortex-m3 -masm=auto  -Wa,armasm,--diag_suppress=A1950W -c -gdwarf-4 -Wa,armasm,

都会报不识别
,命令中好像会把-后面的一个字母吞掉一样,没弄明白怎么回事

比如 -mcpu=cortex-m3
image
编译会报
image
会把-后面的一个字母吞掉,变成了 -cpu cortex-m3

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


This seems to have nothing to do with xmake. You can adjust flags yourself to see why armclang displays this warning. . xmake does not add other flags

I checked it again and it really shouldn’t have anything to do with xmake. It wasn’t added by xmake, but it reported this. The assembly command displayed in the IDE is

-mcpu=cortex-m3 -masm=auto -Wa,armasm,--diag_suppress=A1950W -c
-gdwarf-4 -Wa,armasm,--pd,"__MICROLIB SETA 1"
 -Wa,armasm, -Wa,armasm,--pd,"AIR32F10X_MD SETA 1"

But write these commands yourself

 -mcpu=cortex-m3 -masm=auto -Wa,armasm,--diag_suppress=A1950W -c -gdwarf-4 -Wa,armasm,

Will report that it is not recognized
, the command seems to swallow the letter after -, I don’t understand what’s going on.

For example -mcpu=cortex-m3
image
Compilation report
image
It will swallow up the letter after - and become -cpu cortex-m3

@waruqi
Copy link
Member

waruqi commented May 14, 2024

这也是 armasm 的问题,跟 xmake 好像也没啥关系

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


This is also a problem with armasm, and it seems to have nothing to do with xmake.

@CofeCofe
Copy link
Contributor

这个应该是使用的armasm编译器导致的,armasm编译器只支持-cpu -float。armclang也能作为汇编代码的编译器,对应到armclang下就是-mcpu -mfloat。不知道xmake中能不能显式指定汇编的编译器 @waruqi ,类似cmake中的
set(CMAKE_ASM_COMPILER armclang.exe)
这样应该能解决这个问题

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


This should be caused by the armasm compiler used. The armasm compiler only supports -cpu -float. armclang can also be used as a compiler for assembly code, which corresponds to -mcpu -mfloat under armclang. I don’t know if it is possible to explicitly specify the assembly compiler in xmake @waruqi, similar to that in cmake
set(CMAKE_ASM_COMPILER armclang.exe)
This should solve the problem

@CofeCofe
Copy link
Contributor

我也遇到相似的问题,将/xmake/安装/路径/toolchains/armclang/xmake.lua更改了

  • 第32行set_toolset("as", "armasm")更改为set_toolset("as", "armclang")
  • 第62行toolchain:add("asflags", "-cpu=" .. arch_cpu)更改为toolchain:add("asflags", "-mcpu=" .. arch_cpu)
    这样就将默认的汇编编译器切换为armclang了,重新运行xmake之后解决了。
    Arm Compiler 6.14之后才支持armasm语法,原有的xmake.lua可能需要增加一个对armclang版本的判断。

@waruqi
Copy link
Member

waruqi commented Jun 19, 2024

第32行set_toolset("as", "armasm")更改为set_toolset("as", "armclang")

target 里面也有 set_toolset 接口的,或者直接 xmake f --as= ,或者自定义 toolchain

@Dozingfiretruck
Copy link
Author

我也遇到相似的问题,将/xmake/安装/路径/toolchains/armclang/xmake.lua更改了

  • 第32行set_toolset("as", "armasm")更改为set_toolset("as", "armclang")
  • 第62行toolchain:add("asflags", "-cpu=" .. arch_cpu)更改为toolchain:add("asflags", "-mcpu=" .. arch_cpu)
    这样就将默认的汇编编译器切换为armclang了,重新运行xmake之后解决了。
    Arm Compiler 6.14之后才支持armasm语法,原有的xmake.lua可能需要增加一个对armclang版本的判断。

@waruqi 对armclang版本进行判断比较靠谱,跟随keil的行为

@waruqi
Copy link
Member

waruqi commented Jun 20, 2024

可以直接来个 pr 过来,我暂时没这个 toolchain

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


You can send a PR directly. I don’t have this toolchain yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants