[PATCH] D71451: Support to emit extern variables debuginfo with "-fstandalone-debug"

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 15 12:05:08 PST 2020


dblaikie added a comment.

In D71451#1822497 <https://reviews.llvm.org/D71451#1822497>, @Jac1494 wrote:

> >> I'd be curious to the answer to David's questions. If the size increase is because of unused extern variables coming in from libc or something then it doesn't seem worth the cost.
>
> For above case clang size is increase because ,it is difference between clang build without "-fstandalone-debug" option and clang build with "-fstandalone-debug"  option and both build contain change D71451 <https://reviews.llvm.org/D71451> and D71599 <https://reviews.llvm.org/D71599> . So for clang build with "-fstandalone-debug"  option size will be more because it will add debuginfo.
>
> And to check impact of my change on clang i have build clang with and without D71451 <https://reviews.llvm.org/D71451> and D71599 <https://reviews.llvm.org/D71599> change(testcases are not included).
>
> Size of clang without D71451 <https://reviews.llvm.org/D71451> and D71599 <https://reviews.llvm.org/D71599> change and with option "-fstandalone-debug":-
>  =======================================================================
>>  .comment                     159         0
>  .debug_str               3994952         0
>  .debug_loc                   941         0
>  .debug_abbrev              12754         0
>  .debug_info              2223641         0
>  .debug_ranges              46592         0
>  .debug_line               153901         0
>  .note.gnu.gold-version        28         0
>  Total                    6827932
>
> Size of clang with D71451 <https://reviews.llvm.org/D71451> and D71599 <https://reviews.llvm.org/D71599> change and with option  "-fstandalone-debug":-
>  ======================================================================
>>  .comment                     159         0
>  .debug_str               3994894         0
>  .debug_loc                   941         0
>  .debug_abbrev              12746         0
>  .debug_info              2223617         0
>  .debug_ranges              46592         0
>  .debug_line               153865         0
>  .note.gnu.gold-version        28         0
>  Total                    6827806
>
> Size of clang with D71451 <https://reviews.llvm.org/D71451> and D71599 <https://reviews.llvm.org/D71599> is reduced.


Do you have any reason to believe these patches would reduce the size of the debug info? It seems like they only add more debug info, and don't remove anything - so we'd expect an increase in the size, certainly not a decrease. That means, to me, there's probably a mistake in the measurement somehow?

> This results are with latest source and with self-host build of clang. First I have build clang with Release mode and using that clang I have build clang with debug mode with below options
> 
> “cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++) -DLLVM_TARGETS_TO_BUILD="X86" -DBUILD_SHARED_LIBS=On  -DCMAKE_CXX_FLAGS="-fstandalone-debug"   -DCMAKE_C_FLAGS="-fstandalone-debug"  -DCMAKE_INSTALL_PREFIX=/home/bft/Jaydeep/latest_llvm/llvm-project/install_withhstandalone ../llvm”




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71451/new/

https://reviews.llvm.org/D71451





More information about the cfe-commits mailing list