#1 config: Remove CONFIG_DEBUG_INFO for non-debug builds
Opened a month ago by orgads. Modified 23 days ago
rpms/ orgads/kernel c8  into  c8

@@ -412,6 +412,9 @@ 

  # CONFIG_DEBUG_EFI is not set

  # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set

  # CONFIG_DEBUG_GPIO is not set

+ # CONFIG_DEBUG_INFO is not set

+ # CONFIG_DEBUG_INFO_BTF is not set

+ # CONFIG_DEBUG_INFO_DWARF4 is not set

  # CONFIG_DEBUG_INFO_REDUCED is not set

  # CONFIG_DEBUG_INFO_SPLIT is not set

  # CONFIG_DEBUG_KERNEL_DC is not set

@@ -2971,9 +2974,6 @@ 

  CONFIG_DAVICOM_PHY=m

  CONFIG_DCB=y

  CONFIG_DEBUG_FS=y

- CONFIG_DEBUG_INFO=y

- CONFIG_DEBUG_INFO_BTF=y

- CONFIG_DEBUG_INFO_DWARF4=y

  CONFIG_DEBUG_KERNEL=y

  CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024

  CONFIG_DEBUG_LIST=y

@@ -341,6 +341,9 @@ 

  # CONFIG_DEBUG_DRIVER is not set

  # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set

  # CONFIG_DEBUG_GPIO is not set

+ # CONFIG_DEBUG_INFO is not set

+ # CONFIG_DEBUG_INFO_BTF is not set

+ # CONFIG_DEBUG_INFO_DWARF4 is not set

  # CONFIG_DEBUG_INFO_REDUCED is not set

  # CONFIG_DEBUG_INFO_SPLIT is not set

  # CONFIG_DEBUG_KERNEL_DC is not set

@@ -2646,9 +2649,6 @@ 

  CONFIG_DCB=y

  CONFIG_DEBUGGER=y

  CONFIG_DEBUG_FS=y

- CONFIG_DEBUG_INFO=y

- CONFIG_DEBUG_INFO_BTF=y

- CONFIG_DEBUG_INFO_DWARF4=y

  CONFIG_DEBUG_KERNEL=y

  CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024

  CONFIG_DEBUG_LIST=y

@@ -397,6 +397,9 @@ 

  # CONFIG_DEBUG_DRIVER is not set

  # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set

  # CONFIG_DEBUG_GPIO is not set

+ # CONFIG_DEBUG_INFO is not set

+ # CONFIG_DEBUG_INFO_BTF is not set

+ # CONFIG_DEBUG_INFO_DWARF4 is not set

  # CONFIG_DEBUG_INFO_REDUCED is not set

  # CONFIG_DEBUG_INFO_SPLIT is not set

  # CONFIG_DEBUG_KERNEL_DC is not set

@@ -2912,9 +2915,6 @@ 

  CONFIG_DASD_FBA=m

  CONFIG_DASD_PROFILE=y

  CONFIG_DEBUG_FS=y

- CONFIG_DEBUG_INFO=y

- CONFIG_DEBUG_INFO_BTF=y

- CONFIG_DEBUG_INFO_DWARF4=y

  CONFIG_DEBUG_KERNEL=y

  CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024

  CONFIG_DEBUG_SECTION_MISMATCH=y

file modified
+3 -3

@@ -352,6 +352,9 @@ 

  # CONFIG_DEBUG_DRIVER is not set

  # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set

  # CONFIG_DEBUG_GPIO is not set

+ # CONFIG_DEBUG_INFO is not set

+ # CONFIG_DEBUG_INFO_BTF is not set

+ # CONFIG_DEBUG_INFO_DWARF4 is not set

  # CONFIG_DEBUG_INFO_REDUCED is not set

  # CONFIG_DEBUG_INFO_SPLIT is not set

  # CONFIG_DEBUG_KERNEL_DC is not set

@@ -2782,9 +2785,6 @@ 

  CONFIG_DCB=y

  CONFIG_DCSSBLK=m

  CONFIG_DEBUG_FS=y

- CONFIG_DEBUG_INFO=y

- CONFIG_DEBUG_INFO_BTF=y

- CONFIG_DEBUG_INFO_DWARF4=y

  CONFIG_DEBUG_KERNEL=y

  CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024

  CONFIG_DEBUG_LIST=y

file modified
+3 -3

@@ -352,6 +352,9 @@ 

  # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set

  # CONFIG_DEBUG_GPIO is not set

  # CONFIG_DEBUG_HOTPLUG_CPU0 is not set

+ # CONFIG_DEBUG_INFO is not set

+ # CONFIG_DEBUG_INFO_BTF is not set

+ # CONFIG_DEBUG_INFO_DWARF4 is not set

  # CONFIG_DEBUG_INFO_REDUCED is not set

  # CONFIG_DEBUG_INFO_SPLIT is not set

  # CONFIG_DEBUG_KERNEL_DC is not set

@@ -2726,9 +2729,6 @@ 

  CONFIG_DCDBAS=m

  CONFIG_DEBUG_BOOT_PARAMS=y

  CONFIG_DEBUG_FS=y

- CONFIG_DEBUG_INFO=y

- CONFIG_DEBUG_INFO_BTF=y

- CONFIG_DEBUG_INFO_DWARF4=y

  CONFIG_DEBUG_KERNEL=y

  CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024

  CONFIG_DEBUG_LIST=y

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
a month ago

rebased onto 971b96d

a month 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?