Open USTHzhanglu opened 2 months ago
Bot detected the issue body's language is not English, translate it automatically.
Title: Under gnu-rm, the assembly file week function cannot be overwritten by the file with the same name.
我通过在binary
中指定add_linkgroups("system","driver",{whole = true})
解决了该问题.
但是仍然有一些疑问,其中system
已经声明了依赖于driver
(有一个函数在后者中定义),但是只add_linkgroups("system",{whole = true})
时,会报undefined reference to 'nvic_vector_table_set' collect2.exe: error: ld returned 1 exit status
,必须要两个一起添加才可以;
同时增加该指令后,删除add_deps("driver")
能正常编译
不增加该指令,删除add_deps("driver")
,会报一样的错误
是add_linkgroups
会覆盖add_deps
的设置吗
看不懂你在说啥,很乱。。反正这种 link 问题,xmake -v
看下完整 link 参数,调下链接顺序不就好了么。。
你这一会 merge archive ,一会删 deps ,一会 linkgroups 什么的,又没给 link args 和 logs ,我哪知道咋回事。。
add_linkgroups("system","driver",{whole = true})
既然这个可以,一种可能是两个库之间有循环依赖。
Bot detected the issue body's language is not English, translate it automatically.
I don't understand what you are talking about, it's very confusing. . Anyway, for this kind of link problem, wouldn't it be better to check the complete link parameters with
xmake -v
and adjust the link order? .
Now you merge archive, delete deps, linkgroups and so on, but you don’t provide link args and logs. I don’t know what’s going on. .
add_linkgroups("system","driver",{whole = true})
Since this works, one possibility is that there is a circular dependency between the two libraries.
Xmake 版本
2.9.4
操作系统版本和架构
win10 22H2
描述问题
我在搭建MCU工程时,将工程拆分成
sys.lua
和app.lua
,前者set_kind("static")
,后者set_kind("binary")
,其中中断函数(即week同名函数)放到了sys.lua
中,编译后烧录测试异常,排查后发现startup.s
中的week
函数实际上未被同名函数覆盖,将该文件放到app.lua
中重复编译了一遍才正常链接期待的结果
正确的配置方法,或者其他解决问题的方法
工程配置
附加信息和错误日志
无