#1 spec: Respect rpmbuild --without debuginfo
Closed 2 months ago by ngompa. Opened 4 years ago by orgads.
rpms/ orgads/kernel c8  into  c8

file modified
+7
@@ -1148,6 +1148,13 @@ 

  %define build_hostldflags %{__global_ldflags}

  %endif

  

+ %if !%{with_debuginfo}

+ for i in *.config

+ do

+   sed -i 's/^CONFIG_DEBUG_INFO=y/# CONFIG_DEBUG_INFO is not set/' $i

+ done

+ %endif

+ 

  # enable GCOV kernel config options if gcov is on

  %if %{with_gcov}

  for i in *.config

The build (x86_64) uses 25G, while without CONFIG_DEBUG_INFO it uses 3GB.

1 new commit added

  • config: Remove CONFIG_DEBUG_INFO for non-debug builds
4 years ago

rebased onto 971b96d

4 years ago

Kconfig says about the CONFIG_DEBUG_INFO option:

"If you say Y here the resulting kernel image will include debugging info resulting in a larger kernel image. This adds debug symbols to the kernel and modules (gcc -g), and is needed if you intend to use kernel crashdump or binary object tools like crash, kgdb, LKCD, gdb, etc on the kernel. Say Y here only if you plan to debug the kernel."

We need to be able to do crash analysis, so CONFIG_DEBUG_INFO must be set to yes. This applies to the regular kernel.

I'm not sure I follow. If you pass --without debug --without debuginfo to rpmbuild, then no debuginfo should remain after the build anyway. I suppose it is stripped along the way. Then why create it in the first place?

@orgads the debuginfo are required for debugging, they need to be produced, unless I am not understanding your comment! :)

rebased onto 3c0db51

3 years ago

Ok, my patch was wrong. debug and debuginfo are independent. Please review the new patch.

Thanks for the potential contribution @orgads. Sorry for the delay in response, we're still working out the kinks with our contribution process. CentOS Stream 8 is still built "inside out". What I mean by that is that there is still an internal dist-git and build system where RHEL builds are done, before being exported automatically to this dist-git to be built in the CentOS build system. This means that we can't merge this pull request directly. We can however use it to demonstrate changes and generate a patch file that can be applied to the internal dist-git by RHEL maintainers, if they decide to accept the change. To get their attention, would you mind filing a bugzilla describing this change in detail? This link will pre-populate the necessary fields. Please also link to this pull request in that bugzilla.

https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&version=CentOS%20Stream&component=kernel

This will work much better in CentOS Stream 9, as we're moving to having the RHEL maintainers work directly in a public dist-git so that can merge pull requests from contributors.

Pull-Request has been closed by ngompa

2 months ago
Metadata