-
-
Notifications
You must be signed in to change notification settings - Fork 764
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
汇编文件每次都会编译而不是增量编译 #5327
Comments
Title: The assembly file will be compiled every time instead of incremental compilation |
ruki-2:gas ruki$ xmake
[ 50%]: compiling.release src/main.S
[ 75%]: linking.release test
[100%]: build ok, spent 0.204s
ruki-2:gas ruki$ xmake
[100%]: build ok, spent 0.016s 这边测试正常。 |
这里我的编译: |
这边没法复现,你可以自己调下代码,然后提个 pr 过来:
|
It cannot be reproduced here. You can adjust the code yourself:
|
目前发现 .S 文件对应的 .o 文件的 files_mtime[file] or os.mtime(file) 这两个值都是0,所以会重编译。 |
At present, it is found that the two values of files_mtime[file] or os.mtime(file) of the .o file corresponding to the .S file are both 0, so it will be recompiled. |
补充一点:depend文件中的depend部分是这样的: 但是is_changed打印出的文件是这样的: |
One more thing: the depend part in the depend file looks like this: But the file printed by is_changed is like this: |
那就是没有对应的 .o 文件,要么就是 as 没有编译成功,.o 文件没有被生成。。要么就是没权限读 |
That is, there is no corresponding .o file, or as is not compiled successfully, and the .o file is not generated. . Or you don’t have permission to read it |
相应的目录下有对应的文件,如果是权限问题,其他.c的文件生成的.o都是正常的,只有.s生成的才有问题? |
There are corresponding files in the corresponding directories. If it is a permissions problem, the .o generated by other .c files is normal, but only the .s generated has a problem? |
看起来像是开发电脑上有加密软件,然后白名单没加上导致的 |
It looks like there is encryption software on the development computer, but the whitelist is not added. |
你可以自己 -vD 看下完整的 编译命令和链接命令。找下对应 .o 是否存在,如果不存在就是没生成。。 也可以自己手动复制编译命令,执行确认是否能够正常生成 .o |
You can use -vD to see the complete compilation command and link command yourself. Check whether the corresponding .o exists. If it does not exist, it is not generated. . You can also manually copy the compilation command yourself and execute it to confirm whether .o can be generated normally. |
给下完整 depfiles_gcc 的内容。。
你之前没说清楚,到底是哪个文件的 mtime 是 0 。。也贴下文件路径。。 另外一种可能是它生成的 deps info 格式问题,导致没解析到正确的路径 |
上面就是deps文件的内容,mtime为0的文件目录:D:\work\project\pro\pro\build\.objs\elf\cross\none\release__\boot\flash\alps\arc_startup.S.o |
那你看下这个文件是否存在。。 xmake l os.mtime D:\work\project\pro\pro\build\.objs\elf\cross\none\release__\boot\flash\alps\arc_startup.S.o 执行下,看看返回值是否也是 0 |
发现问题了,mtime为0的文件是
注意文件最后面的这个冒号,目录带了冒号,所以实际是找不到这个文件的,感觉是解析depend出现问题了。
如果修改这dep文件,把目录里面的 :\9 这部分删除就是正常的了,不会重复编译。 |
Then check to see if this file exists. . xmake l os.mtime D:\work\project\pro\pro\build\.objs\elf\cross\none\release__\boot\flash\alps\arc_startup.S.o Execute and see if the return value is also 0 |
Found the problem, the file with mtime 0 is D:\work\project\pro\pro\build.objs\elf\cross\none\release__\boot\flash\alps\arc_startup.S.o**: ** |
这种其实就是工具链自身乱七八糟的bug导致,莫名搞个 |
This is actually caused by the messy bugs in the tool chain itself. Why create |
好的,如果不改那我就自己加点判断处理掉了,谢谢! |
Okay, if it doesn’t change then I will make some judgment and deal with it myself, thank you! |
Xmake 版本
2.9.2
操作系统版本和架构
windows 11
描述问题
我的工程中有c文件和汇编文件,编译的时候c文件可以正常增量编译,但是汇编文件每次都会编译,无论是否有修改。
期待的结果
汇编文件也可以支持增量编译,避免重复编译
工程配置
编译器为自定义,如下:
toolchain("mw")
set_kind("standalone")
set_sdkdir("C:/ARC/MetaWare/arc")
set_toolset("cc", "gcc@ccac")
set_toolset("as", "gcc@ccac")
set_toolset("cxx", "gcc@ccac")
set_toolset("ld", "gcc@ccac")
set_toolset("ar", "ar@arac")
target("elf")
set_kind("binary")
set_policy("check.auto_ignore_flags", false)
add_files("a.c")
add_files("b.s")
附加信息和错误日志
无
The text was updated successfully, but these errors were encountered: