Bug 216969 - [GTK][WPE] Enable debug fussion if compiler options contain -g
Summary: [GTK][WPE] Enable debug fussion if compiler options contain -g
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Xabier Rodríguez Calvar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-25 04:30 PDT by Xabier Rodríguez Calvar
Modified: 2020-09-25 06:07 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.44 KB, patch)
2020-09-25 04:33 PDT, Xabier Rodríguez Calvar
calvaris: review?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xabier Rodríguez Calvar 2020-09-25 04:30:53 PDT
[GTK][WPE] Enable debug fussion if compiler options contain -g
Comment 1 Xabier Rodríguez Calvar 2020-09-25 04:33:45 PDT
Created attachment 409679 [details]
Patch
Comment 2 Konstantin Tokarev 2020-09-25 04:39:07 PDT
I see one immediate problem this change will cause: some Linux distros are building packages with enabled -g and then split debug info into separate package. If -g will now trigger -gsplit-dwarf they'll need to pass DEBUG_FISSION=OFF explicitly to generate usable debug packages
Comment 3 Konstantin Tokarev 2020-09-25 06:07:31 PDT
Comment on attachment 409679 [details]
Patch

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

> Source/cmake/OptionsCommon.cmake:70
> +if (USE_LD_GOLD AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR "${CMAKE_CXX_FLAGS_RELEASE}" MATCHES "-g"))

1) CMAKE_CXX_FLAGS_RELEASE is used only when CMAKE_BUILD_TYPE == "Release", RelWithDebInfo and MinSizeRel use their own variables.
2) "-g" flag may also be passed via CMAKE_CXX_FLAGS which is applied to all build types
3) "-g" is not the only gcc flag which enables emission of debug info, there are also -g<level> flags and -ggdb and maybe more