Bug 235737 - [CMake] Do not require GNU Gold usage to enable DEBUG_FISSION
Summary: [CMake] Do not require GNU Gold usage to enable DEBUG_FISSION
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CMake (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks: 235476
  Show dependency treegraph
 
Reported: 2022-01-27 14:45 PST by Adrian Perez
Modified: 2022-01-28 02:25 PST (History)
10 users (show)

See Also:


Attachments
Patch (2.08 KB, patch)
2022-01-27 15:16 PST, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.