$ gcc --version gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9) Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ as --version GNU assembler version 2.35-18.fc33 Copyright (C) 2020 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later. This program has absolutely no warranty. This assembler was configured for a target of `x86_64-redhat-linux'. $ export CC="gcc -gdwarf-5" CXX="g++ -gdwarf-5" $ make clean && make && make check [...] Running /home/mark/dwz/testsuite/dwz.tests/dwz-tests.exp ... child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-class-ns.sh child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-class.sh child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-def-decl.sh child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-loc.sh child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-struct-ns.sh child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-struct.sh child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-union-ns.sh child process exited abnormally FAIL: /home/mark/dwz/testsuite/dwz.tests/odr-union.sh === dwz Summary === # of expected passes 51 # of unexpected failures 8 [...] The same can be seen with gcc11 from git trunk which defaults to -gdwarf-5 (so you don't need any setting of CC or CXX).
Ack, managed to reproduce, thanks.
I've looked at the odr-struct.sh fail. First of all, odr is not enabled because the language is DW_LANG_C_plus_plus_14 instead of DW_LANG_C_plus_plus, so we need this in a few places: ... case DW_LANG_C_plus_plus: + case DW_LANG_C_plus_plus_03: + case DW_LANG_C_plus_plus_11: + case DW_LANG_C_plus_plus_14: ... Then, it seems the checksums for both struct aaa are different, because of processing a DW_AT_decl_line with DW_FORM_implicit_const. The const has the same value (according to readelf), but somehow the resulting hashes are different.
Created attachment 13224 [details] Tentative patch
(In reply to Tom de Vries from comment #2) > I've looked at the odr-struct.sh fail. > > First of all, odr is not enabled because the language is > DW_LANG_C_plus_plus_14 instead of DW_LANG_C_plus_plus, so we need this in a > few places: > ... > case DW_LANG_C_plus_plus: > + case DW_LANG_C_plus_plus_03: > + case DW_LANG_C_plus_plus_11: > + case DW_LANG_C_plus_plus_14: > ... > Fix in https://sourceware.org/git/?p=dwz.git;a=commit;h=6d5673b84fa075d296d4ad4d60c03823cb773863
https://sourceware.org/pipermail/dwz/2021q1/000869.html
Fixed in https://sourceware.org/git/?p=dwz.git;a=commit;h=4100572baed5a1dcafb43713f051bb1349482cec