Closed Ekulelu closed 1 year ago
I found this error is something about "Dead Code Stripping"
I turn on the "Dead Code Stripping", but there is also a error, ld: Linking globals named '_ZTVN4xxx10network_cl9TcpSocketE': symbol multiply defined! for architecture arm64
thanks for the report, do you have a test case i can reproduce? i.e., all the input files such as .o files as well as the invocation
also, where did you see that this error was about dead code stripping?
"ld: Linking globals named '_ZTVN4xxx10network_cl9TcpSocketE': symbol multiply defined! for architecture arm64" this error is nothing about dead code stripping. If turn on dead code stripping, there are more duplicate symbols errors. Sorry, the project occured the error is owned by company, and I can't give it to you. I will try to create a demo project for you when I have time.
sounds good
I have tried to create a demo project to reproduce the case, but failed. The demo project works so well.
if you delete the cache at /tmp/zld-*
, and then run zld again, do you still see the same problem?
After I deleted the /tmp/zld-* , the first time build is ok, but the second time will failed
ok, i think i may know the issue. when i get a chance i can dig deeper
Can you try the latest release, 1.2.1?
Thank you, I will try it on Monday.
------------------ 原始邮件 ------------------ 发件人: "notifications"<notifications@github.com>; 发送时间: 2020年10月17日(星期六) 晚上10:41 收件人: "michaeleisel/zld"<zld@noreply.github.com>; 抄送: "政"<709314090@qq.com>; "Author"<author@noreply.github.com>; 主题: Re: [michaeleisel/zld] duplicate symbol (#57)
Can you try the latest release, 1.2.1?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I try 1.2.1, but it's still failed. The error is also " Linking globals named '_ZTVN4bigo10network_cl9TcpSocketE': symbol multiply defined! for architecture arm64"
I find there are some 'TcpSocket.o' in different libraries in the /tmp/zld-*
file like blow. If I delete all the 'TcpSocket.o', then the link process will report another multiply symbol error. I think the error has something to do with the content of /tmp/zld-*
, but I don't know how the file effects the link process.
xxx/Pods/nerv/nerv.framework/nerv
....
TcpSocket.o
.....
xxx/Pods/chunklink/chunklink.framework/chunklink
....
TcpSocket.o
.....
There is another thing I confuse.
TcpSocket is defined in C++ name space like blow, but the /tmp/zld-*
seems to ignore the namespace. Dose this reason cause the link error?
namespace bigo {
namespace network_cl {
class TcpSocket {
........
}
}
}
/tmp/zld-* causes eager loading of all the object files within it. that list consists of all the object files that were loaded for the last linker execution, and it may include object files that would no longer be loaded by stock ld, which in many cases loads lazily
I have same problem, is there any advise to solve this problem?
Can you provide a reproducible example?
Maybe I can have a try.
there is "duplicate symbol" error when use zld, these symbols are in different lib. However, there is only warning when use the origin linker.