not fast
Closed this issue · 9 comments
i use zld in my project
but not be faster
-fuse-ld=$(SRCROOT)/zld -Wl,-zld_original_ld_path,$(DT_TOOLCHAIN_DIR)/usr/bin/ld
$(inherited)
-ObjC
-fprofile-instr-generate
-lc++
-l"c++"
-l"c++abi"
-l"sqlite3"
-l"z"
xcode version is Version 13.1 (13A1030d)
and i see the tmp file in folder, its update
my project all library is static library, could zld imporve static library link speed?
what shoud i do?
hi, can you post the time difference you measured between zld and ld64? can you run it repeatedly (at least 3 times on each) so we have more samples to analyze?
n
ld64: 66.4s 65s 67.1s
zld: 62.5 60.3 61
interesting. this is a really long link time, so i wonder if there's one main bottleneck specific to this app. can you try building the latest zld from master, which is significantly faster, and post those numbers, as well as how fast lld is? if we don't see any improvement there, then we can look at a time profiling of it to see why it's so long
<inline asm>:1:1: warning: inline asm clobber list contains reserved registers: W18
ld1 {v0.8h, v1.8h}, [x21], #32
^^^^^^^^
<inline asm>:1:1: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
ld1 {v0.8h, v1.8h}, [x21], #32
^^^^^^^^
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
Command Ld failed with a nonzero exit code
i build zld by my self, but when i use it, fail with link error
my macbook is M1 cpm, could arm cpu build zld?
that's very interesting, it may be evidence of a bug in zld. if you could send me a reproducible test case, e.g. the full linking or just trying to link that one object file, i'll take a look and fix it
i make a demo but not have same error
my project is complex so its hard to make a same demo
i will try to solve the error by debug zld's source code
and try again when xcode14 release
thanks for your reply
I think a git-bisect should accomplish this, you can pick a date from, say, April 2022 as the start
But even simpler than that, would you be willing to try an older version of zld and just see if it works? I'm curious if some of the optimizations I added recently are causing this
In any case, try lld and let me know how it goes. In my own testing, lld has been faster than zld