#27 Enable debuginfo for x86_64 and aarch64.
Closed 4 months ago by than. Opened 3 years ago by jankratochvil.
rpms/ jankratochvil/chromium debuginfo  into  rawhide

Enable debuginfo for x86_64 and aarch64.
Jan Kratochvil • 3 years ago  
@@ -0,0 +1,12 @@ 

+ --- chromium-83.0.4103.116/build/config/compiler/BUILD.gn.debug	2020-06-29 19:07:24.928680424 +0200

+ +++ chromium-83.0.4103.116/build/config/compiler/BUILD.gn	2020-06-29 19:40:23.063688281 +0200

+ @@ -2277,7 +2277,8 @@ config("symbols") {

+      # flag, so we can use use -g1 for pnacl and nacl-clang compiles.

+      # gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang.

+      if (!is_nacl || is_clang) {

+ -      cflags += [ "-g2" ]

+ +      cflags += [ "-g3" ]

+ +      cflags += [ "-fdebug-types-section" ]

+      }

+  

+      if (is_clang && !is_nacl && !use_xcode_clang) {

file modified
+26 -11
@@ -19,6 +19,14 @@ 

  # We'd like to always have this on.

  %global use_vaapi 1

  

+ # gold on i686 runs out of 32-bit address space.

+ %ifarch x86_64 aarch64

+ # It must be set to value 2.

+ %global use_debuginfo 2

+ %else

+ %global use_debuginfo 0

+ %endif

+ 

  # Since no one liked replacing just the media components, we do not build shared anymore.

  %global shared 0

  
@@ -45,9 +53,13 @@ 

  %global headlessbuilddir out/Headless

  %global remotingbuilddir out/Remoting

  

- # Debuginfo packages aren't very useful here. If you need to debug

- # you should do a proper debug build (not implemented in this spec yet)

+ %if %{use_debuginfo}

+ # Debuginfo would run out of 32-bit 4GB DWARF so use -fdebug-types-section.

+ %global _find_debuginfo_dwz_opts %{nil}

+ %else

+ # Disable generating *-debuginfo.rpm

  %global debug_package %{nil}

+ %endif

  

  # %%{nil} for Stable; -beta for Beta; -dev for Devel

  # dash in -beta and -dev is intentional !
@@ -163,7 +175,7 @@ 

  Name:		chromium%{chromium_channel}

  %endif

  Version:	%{majorversion}.0.4103.116

- Release:	3%{?dist}

+ Release:	3debugtypes%{?dist}

Is this on purpose or some left over?

  %if %{?freeworld}

  %if %{?shared}

  # chromium-libs-media-freeworld
@@ -287,6 +299,9 @@ 

  # Apply these patches to work around EPEL8 issues

  Patch300:	chromium-76.0.3809.132-rhel8-force-disable-use_gnome_keyring.patch

  

+ # Enable chromium-debuginfo.rpm

+ Patch301:	chromium-debuginfo.patch

+ 

  # Use chromium-latest.py to generate clean tarball from released build tarballs, found here:

  # http://build.chromium.org/buildbot/official/

  # For Chromium Fedora use chromium-latest.py --stable --ffmpegclean --ffmpegarm
@@ -877,6 +892,9 @@ 

  %if 0%{?rhel} == 8

  %patch300 -p1 -b .disblegnomekeyring

  %endif

+ %if %{use_debuginfo}

+ %patch301 -p1 -b .debuginfo

+ %endif

  

  # Change shebang in all relevant files in this directory and all subdirectories

  # See `man find` for how the `-exec command {} +` syntax works
@@ -959,12 +977,14 @@ 

  

  # Core defines are flags that are true for both the browser and headless.

  CHROMIUM_CORE_GN_DEFINES=""

- CHROMIUM_CORE_GN_DEFINES+=' is_debug=false'

+ CHROMIUM_CORE_GN_DEFINES+=' is_debug=false symbol_level=%{use_debuginfo}'

  %ifarch x86_64 aarch64

  CHROMIUM_CORE_GN_DEFINES+=' system_libdir="lib64"'

  %endif

  CHROMIUM_CORE_GN_DEFINES+=' google_api_key="%{api_key}" google_default_client_id="%{default_client_id}" google_default_client_secret="%{default_client_secret}"'

- CHROMIUM_CORE_GN_DEFINES+=' is_clang=false use_sysroot=false use_gold=false fieldtrial_testing_like_official_build=true use_lld=false rtc_enable_symbol_export=true'

+ CHROMIUM_CORE_GN_DEFINES+=' is_clang=false use_sysroot=false fieldtrial_testing_like_official_build=true use_lld=false rtc_enable_symbol_export=true'

+ # With use_debuginfo GNU ld would run out of memory.

+ CHROMIUM_CORE_GN_DEFINES+=' use_gold=true'

  %if %{freeworld}

  CHROMIUM_CORE_GN_DEFINES+=' ffmpeg_branding="ChromeOS" proprietary_codecs=true'

  %else
@@ -992,7 +1012,7 @@ 

  %else

  CHROMIUM_BROWSER_GN_DEFINES+=' is_component_ffmpeg=false is_component_build=false'

  %endif

- CHROMIUM_BROWSER_GN_DEFINES+=' blink_symbol_level=0 enable_hangout_services_extension=true'

+ CHROMIUM_BROWSER_GN_DEFINES+=' blink_symbol_level=%{use_debuginfo} enable_hangout_services_extension=true'

  CHROMIUM_BROWSER_GN_DEFINES+=' use_aura=true'

  CHROMIUM_BROWSER_GN_DEFINES+=' enable_widevine=true'

  %if %{use_vaapi}
@@ -1379,11 +1399,6 @@ 

  . /opt/rh/devtoolset-%{dts_version}/enable

  %endif

  

- # Decrease the debuginfo verbosity, so it compiles in koji

- %ifarch %{ix86}

- %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')

- %endif

- 

  export PYTHONPATH="../../third_party/pyjson5/src:../../third_party/catapult/third_party/google-endpoints"

  

  echo

Is it OK to enable debuginfo for Chromium? The builds will be sure slower.
It will need some adjustments in Koji but before the Koji farm adjustments are made there should be agreement from Chromium maintainer:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/6R5BC6TG5QPP5OORNF5WP6S7SSRMI7HJ/

Is this on purpose or some left over?

+# Debuginfo packages aren't very useful here. If you need to debug
+# you should do a proper debug build (not implemented in this spec yet)
+%global debug_package %{nil}
 %changelog
+* Tue Feb 21 2017 Tom Callaway <spot@fedoraproject.org> 56.0.2924.87-4
+- disable debuginfo

There are multiple possibilities why Spot disabled the debuginfo. Any of them does not seem to be Chromium-specific. They could rather be implemented distro-wide (which I agree with but that is orthogonal to chromium.spec).

  • For real debugging one needs -O0 -g (and not -O2 -g). I agree but that applies to every package and we would need a new distro spin (something like "Debug build" of Fedora). debuginfo is useful to investigate crash of the application running in real world.

  • Default build with DWZ will fail with debuginfo enabled as it is too big in the Chromium case.

  • Even with the changes I provided the build will fail in Koji because Koji hosts do not provide enough disk space. But that could be negotiated to be fixed in Koji farm.

BTW I am NOT asking for a merge - it would break the builds in Koji. I am asking if there is an agreement with this patch so that I can try to make the Koji hosts handle it first.

I disabled it originally (eons ago) for several reasons:

  1. The debuginfo files were huge. Really really really huge.
  2. They were not useful. Chromium needs to be compiled with debug options enabled and it is not currently built that way in Fedora. Last time I looked at this (which was admittedly a long time ago), symbols were being stripped by default on Linux.

Oh, and doing debug builds of chromium added a significant cost in time to build. It's already a multi-day affair thanks to aarch64.

"Chromium needs to be compiled with debug options enabled and it is not currently built that way in Fedora" - all debuginfo options are IMO enabled by my patch as built in: https://koji.fedoraproject.org/koji/taskinfo?taskID=46456273
Sure it is not a debug build but that is a distro-wide problem, many packages have debugging mode at compile time (such as glib --enable-debug) but that would need a new "Debug" spin of Fedora.
I do not see anything different on Chromium than other packages why it cannot have debuginfo. Except it is the biggest debuginfo package.

all debuginfo options are IMO enabled by my patch

Yes, this is correct. I'm not sure that the additional build time and storage demands of this are worthwhile in practice.

Do note that I have re-enabled the 'heavybuilder' aarch64 hosts now for chromium... so that should help build times a lot on aarch64 at least.

@kevin I have tried now a scratch build of Chromium and both x86_64 and aarch64 got only 138GB of disk space:
https://koji.fedoraproject.org/koji/taskinfo?taskID=46992836 = buildvm-x86-05.iad2.fedoraproject.org
https://koji.fedoraproject.org/koji/taskinfo?taskID=46992837 = buildvm-a64-18.iad2.fedoraproject.org

Pull-Request has been closed by than

4 months ago

closed as it's enable in chromium update.

Metadata