Bug 146641 - [CMake] Reduce debug info on 32bit using -g1 to avoid OOM
Summary: [CMake] Reduce debug info on 32bit using -g1 to avoid OOM
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-06 09:08 PDT by Emanuele Aina
Modified: 2017-03-11 10:58 PST (History)
13 users (show)

See Also:


Attachments
Patch (2.46 KB, patch)
2015-07-06 09:18 PDT, Emanuele Aina
no flags Details | Formatted Diff | Diff
Patch (7.50 KB, patch)
2015-07-22 00:32 PDT, Emanuele Aina
no flags Details | Formatted Diff | Diff
Patch (7.50 KB, patch)
2015-07-22 00:35 PDT, Emanuele Aina
no flags Details | Formatted Diff | Diff
Patch (2.39 KB, patch)
2015-07-22 00:40 PDT, Emanuele Aina
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuele Aina 2015-07-06 09:08:18 PDT
On a 32bit processors (tested both in a x86 chroot and with the 32bit version of the armhf cross-toolchain for the Raspberry Pi) linking a full debug build results in a out of memory error. Switching to a 64bit build architecture solves the build problem, but it still produce a library that's so big that the dynamic linker on the target system will simply refuse to load with EOVERFLOW (tested with the 64bit version of the armhf cross-toolchain for the Raspberry Pi).

DEBUG_FISSION solves the issue but it's not active by default as it requires the gold linker.

Another option is to severely reduce the amount of debug symbols generated: the -g1 flag will just produce enough symbols to get sensible stack traces, but without any line number info. It's not particularly useful during debug, but for distribution packages it would be an improvement over no symbols at all. :)
Comment 1 Emanuele Aina 2015-07-06 09:18:16 PDT
Created attachment 256216 [details]
Patch
Comment 2 WebKit Commit Bot 2015-07-06 09:21:00 PDT
Attachment 256216 [details] did not pass style-queue:


ERROR: Source/cmake/OptionsCommon.cmake:110:  No space after "("  [whitespace/parentheses] [5]
ERROR: Source/cmake/OptionsCommon.cmake:110:  No space before ")"  [whitespace/parentheses] [5]
ERROR: Source/cmake/OptionsCommon.cmake:111:  No space after "("  [whitespace/parentheses] [5]
ERROR: Source/cmake/OptionsCommon.cmake:111:  No space before ")"  [whitespace/parentheses] [5]
Total errors found: 4 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Csaba Osztrogonác 2015-07-06 09:21:36 PDT
Comment on attachment 256216 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=256216&action=review

> ChangeLog:4
> +        [CMake] Reduce debug info on 32bit using -g1 to avoid OOM
> +        https://bugs.webkit.org/show_bug.cgi?id=146641

Just a nit: This line should be same as the title 
of the bug report. Please change one of them.
Comment 4 Emanuele Aina 2015-07-06 09:27:58 PDT
I've attached a patch to override the default -g flag with -g1, while allowing for more specific flags (eg. -ggdb3) to be specified by the user.

This relies of the patch for bug #146640 to work on the armhf toolchain I'm using. Note that here we care about both the build and destination architecture, while bug #146640 was more about the build architecture as the --no-keep-memory does not affects the generated binaries.

Another option would be to properly detect the word size of the destination architecture using CMAKE_SIZEOF_VOID_P instead of CMAKE_HOST_SYSTEM_PROCESSOR.
Comment 5 Emanuele Aina 2015-07-06 09:30:21 PDT
> Just a nit: This line should be same as the title 
> of the bug report. Please change one of them.

Done, thanks! check-webkit-style complains about parentheses, but I guess it's a false positive that can be ignored?
Comment 6 Emanuele Aina 2015-07-22 00:32:42 PDT
Created attachment 257247 [details]
Patch

Rebased on current trunk (r187148) and added a dep from ENABLE(WAYLAND_TARGET) to ENABLE(OPENGL) due to EGL usage.
Comment 7 Emanuele Aina 2015-07-22 00:35:45 PDT
Created attachment 257248 [details]
Patch

Oops, I forgot to add the newline suggested by Zan while I rebased the patch. Added.
Comment 8 Zan Dobersek 2015-07-22 00:37:53 PDT
Comment on attachment 257248 [details]
Patch

Wrong bug, I guess.
Comment 9 Emanuele Aina 2015-07-22 00:40:43 PDT
Created attachment 257250 [details]
Patch

Sigh, I still need to figure out how `webkit-patch` works. The submitted patches were clearly aimed to other bugs, reuploading the original patch.
Comment 10 WebKit Commit Bot 2015-07-22 00:42:33 PDT
Attachment 257250 [details] did not pass style-queue:


ERROR: Source/cmake/OptionsCommon.cmake:111:  No space after "("  [whitespace/parentheses] [5]
ERROR: Source/cmake/OptionsCommon.cmake:111:  No space before ")"  [whitespace/parentheses] [5]
ERROR: Source/cmake/OptionsCommon.cmake:112:  No space after "("  [whitespace/parentheses] [5]
ERROR: Source/cmake/OptionsCommon.cmake:112:  No space before ")"  [whitespace/parentheses] [5]
Total errors found: 4 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Michael Catanzaro 2015-07-22 06:09:06 PDT
If you use the -b option to webkit-patch, the patch will always go to the right bug. It's always been detected automatically and correctly when I use 'webkit-patch upload' so I don't bother to pass -b to that, but when using 'webkit-patch post-commits' the patches often go to the wrong bugs unless I pass -b. Bug #143965.