The dwz tool tries to deduplicate debug information across binaries,
but it has limits on the number of DWARF DIE (Debug Information Entries)
it can handle. Large C++ binaries especially those using templates
heavilily (like Ceph's crimson components), often exceed these limits.

When building packages with DWZ enabled, the debian packging fails with:

```
dh_dwz: error: Aborting due to earlier error
```

So let's make ceph-crimson-osd an exception when running dwz. This
change will not backported to tentacle as tentacle does not build
crimson by default.

Signed-off-by: Kefu Chai <[email protected]>
---
 ...lude-ceph-osd-crimson-from-dwz-compr.patch | 52 +++++++++++++++++++
 patches/series                                |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 
patches/0053-debian-rules-exclude-ceph-osd-crimson-from-dwz-compr.patch

diff --git 
a/patches/0053-debian-rules-exclude-ceph-osd-crimson-from-dwz-compr.patch 
b/patches/0053-debian-rules-exclude-ceph-osd-crimson-from-dwz-compr.patch
new file mode 100644
index 00000000000..c5f477adb30
--- /dev/null
+++ b/patches/0053-debian-rules-exclude-ceph-osd-crimson-from-dwz-compr.patch
@@ -0,0 +1,52 @@
+From 126f3623e3c36bf0bd233b01fd452aeec0415d89 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <[email protected]>
+Date: Fri, 23 Jan 2026 15:04:47 +0800
+Subject: [PATCH] debian/rules: exclude ceph-osd-crimson from dwz compression
+
+When building with DWZ enabled, the debian packaging fails with:
+```
+  dh_dwz: error: Aborting due to earlier error
+```
+Running the dwz command manually reveals the root cause:
+```
+  $ dwz 
-mdebian/ceph-osd-crimson/usr/lib/debug/.dwz/x86_64-linux-gnu/ceph-osd-crimson.debug
 \
+    -M/usr/lib/debug/.dwz/x86_64-linux-gnu/ceph-osd-crimson.debug -- \
+    debian/ceph-osd-crimson/usr/bin/ceph-osd-crimson \
+    debian/ceph-osd-crimson/usr/bin/crimson-store-nbd
+  dwz: debian/ceph-osd-crimson/usr/bin/ceph-osd-crimson: Too many DIEs, not 
optimizing
+  dwz: Too few files for multifile optimization
+```
+The dwz tool has a limit on the number of DWARF DIEs (Debug Information
+Entries) it can process. The ceph-osd-crimson binary, being a large C++
+executable with extensive template usage, exceeds this limit, causing
+dwz to exit with status 1 and fail the build.
+
+This change excludes only ceph-osd-crimson from dwz processing using
+the -X flag, allowing other binaries in the package to still benefit
+from DWARF compression while avoiding the build failure.
+
+Please note, we always disable DWZ in ceph-build's ceph-dev-pipeline.
+
+Signed-off-by: Kefu Chai <[email protected]>
+---
+ debian/rules | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/debian/rules b/debian/rules
+index 4d31ffd069f..9082c9c4dd2 100755
+--- a/debian/rules
++++ b/debian/rules
+@@ -53,6 +53,10 @@ endif
+ 
+ ifeq ($(DWZ), false)
+ override_dh_dwz:
++else
++override_dh_dwz:
++      # Exclude ceph-osd-crimson due to excessive debug info (too many DIEs)
++      dh_dwz -Xceph-osd-crimson
+ endif
+ 
+ # for python3-${pkg} packages
+-- 
+2.47.3
+
diff --git a/patches/series b/patches/series
index 53e0e6b83ca..874bef96aa4 100644
--- a/patches/series
+++ b/patches/series
@@ -50,3 +50,4 @@
 0050-debian-rules-enable-WITH_CRIMSON-when-pkg.ceph.crims.patch
 0051-debian-ceph.spec-fix-ceph-osd-upgrade-conflicts.patch
 0052-cmake-build-static-seastar-for-release-builds.patch
+0053-debian-rules-exclude-ceph-osd-crimson-from-dwz-compr.patch
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to