Bug 235737

Summary: [CMake] Do not require GNU Gold usage to enable DEBUG_FISSION
Product: WebKit Reporter: Adrian Perez <aperez>
Component: CMakeAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, annulen, cgarcia, ews-watchlist, gyuyoung.kim, mcatanzaro, ryuan.choi, saam, sergio, ysuzuki
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 235476    
Attachments:
Description Flags
Patch none

Description Adrian Perez 2022-01-27 14:45:20 PST
As per my comment at https://bugs.webkit.org/show_bug.cgi?id=235476#c4
all of ld.bfd, lld, and mold support split-debug builds, and there is
not reason whatsoever to make the DEBUG_FISSION option depend on the
value of the USE_LD_GOLD one.

   % cat hello.cc         
   #include <cstdio>
   extern const char* whom();
   int main() { std::printf("Hello, %s!\n", whom()); }
   % cat other.cc         
   const char* whom() { return "Pete"; }
   % g++ -gsplit-dwarf -ggdb -c hello.cc                  
   % g++ -gsplit-dwarf -ggdb -c other.cc  
   % g++ -gsplit-dwarf -ggdb -fuse-ld=bfd -o hello hello.o other.o        
   % dwarfdump hello | grep DW_AT_dwo_name | sort -u 
                    DW_AT_dwo_name              hello.dwo
                    DW_AT_dwo_name              other.dwo

(Replacing g++ with clang++ above also works, plus the Clang compiler
driver will happily accept any -fuse-ld=whatever as long as there is
a “ld.whatever” binary in the $PATH.)
Comment 1 Adrian Perez 2022-01-27 15:16:18 PST
Created attachment 450187 [details]
Patch
Comment 2 EWS 2022-01-27 17:24:54 PST
Committed r288718 (246511@main): <https://commits.webkit.org/246511@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450187 [details].
Comment 3 Adrian Perez 2022-01-28 02:25:19 PST
For the record: I did some tests, and debug builds now take about the
same time with ld.bfd after applying this patch, and ld.lld is faster
than both ld.gold and ld.bfd (no surprises there!). I have not tried
with ld.mold because we do not yet have it in the Flatpak SDK.