Bug#1131840: gcc-15: non-deterministic DWARF debug info (.debug_info, .debug_loclists) across identical builds

Michael Lloyd <[email protected]>
Newsgroups gmane.linux.debian.devel.gcc
Message-ID <a361736e-4651-41fb-8802-b06dc98295bc__42530.5416270689$1774438532$gmane$org@micl.dev>
I've narrowed this down to precompiled header (.gch) generation.

Building quickshell twice in unstable sbuild chroot with
gcc-15 15.2.0-16, ninja -j2, same build path, same SOURCE_DATE_EPOCH
results in 6 out of 475 .o files differing between builds. The
set of differing files changes each run, however all 6 .gch files
differ every time. They are:

   qs-pchset-common.dir/cmake_pch.hxx.gch
   qs-pchset-large.dir/cmake_pch.hxx.gch
   qs-pchset-plugin.dir/cmake_pch.hxx.gch
   qs-pchset-dbus.dir/cmake_pch.hxx.gch
   qs-pchset-launch.dir/cmake_pch.hxx.gch
   qs-pchset-wayland-protocol.dir/cmake_pch.hxx.gch

Recompiling the same .cpp file twice against the same .gch produces
identical .o files. The non-determinism is entirely in the .gch
generation itself. The debug info (.debug_info, .debug_loclists)
serialized into the PCH varies between runs, and the .o files that
include the PCH inherit this.

The .text, .rodata and all code/data sections are identical across
builds. Only debug sections differ.

Also tested with gcc-16 (16.0.1 20260308, trunk r16-7949) and get
the same issue. All 6 PCH files differ, and 33 out of 475 .o files
differ (vs 6 with gcc-15).

I will file this upstream on GCC bugzilla.
OpenPGP_signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEINV1e2m17/gt/4jVFUw51sGTZp0FAmnDx6AACgkQFUw51sGT
Zp3OHA/8ClBnFbthG9zTHq/GefCkc8GcWtiwWKuIHbEHjJUDFs2igvA823A2Ret/
w8btfy9wcdVRT4ReisISY7blt47Pctxrs09LR5Tpm/Aa8OlbnXAduYRjd7/zLfoz
B4dUnK8mRhgsdc5oDy9h446CiTyyn2sqThEusdiX6BS8JWK0jV/zPcjqKTYTLXLN
cU7DT4+teNIk5PNJ/58L8xihjQm4HfNNiS0WwVmyHZIECUWqCGpkJBEVh4LoLKgx
iWc/S3PMDKa/+2GswMWX21DR/h/HQLHFG4mDGaQwKqreLowOk9s+WMhDCMzwYDPK
cbGPWkZDgZyLzyE19r7ALgtU1G5CHo0gy6r6cB8MClCRq43omBCEVLND4Ts2soqa
DWmweXi4qlZKXv3sl2Z3o8gSHE2zH9S6Gg0QdirnLVuuBbgbEmGMy4K3Dy9xhrww
tm1p1S/3ANI0d47GkkLmcohtocbvz/evsgod1C6Dt8zxv10L9vFooACN+bKkI0ps
SHD17nuwE8nwxyMc/aYtUGqrLKc11U4839/UjZn9b1v7rF1wXB6hwAFPBu3SNH6O
820A+e9SquliYpECnFdfNlqXAI6J1moEUrqU0SkMxbEIyC2Dq2hE+EQr5LMxHfAM
cxLFfFqDobh1esg8nmx4spAfbufEmQcEQJ4bYSdItNs+DTSIMr0=
=+c46
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.