public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Cc: bewoodar@redhat.com
Subject: [PATCH, applied] ir: Make canonicalization stable wrt typedefs in fn return types
Date: Thu, 23 Jun 2022 13:45:54 +0200	[thread overview]
Message-ID: <87o7yjfvrh.fsf@redhat.com> (raw)

Hello,

[This patch is to address an issue where 'abidw --abidiff' from the
current master branch is failing on the libstdc++ from Rawhide F37,
pointed out by Ben Woodard]

In the grand scheme of things, two function return types can be equal
modulo typedefs.  Because those two function textual representations
are different, the two overall function types would end up having
different canonical types and thus, the two functions would be
considered as having different sub-types.  The harmless change pass
would then kick in and flag that change as harmless.  But then, "abidw
--abidiff" that is used for testing purposes would still be not happy.

This patch strips typedefs off of return types of function types when
the string representation is to be used for internal (e.g, type
canonicalization) purposes.

The fix for this change uncovered another issue:

When setting the naming typedefs for an (anonymous) C++ class, the
qualified name of the class was wrongly being set to the qualified
name of the typedef.  Only the name of the class should be affected,
in essence.  The qualified name would, ONLY as a result of the name
change, be adjusted.

This patch fixes those issues and adjusts the test suite accordingly.

	* src/abg-ir.cc (get_function_type_name, get_method_type_name):
	When the function type name is for internal purposes, strip
	potential typedefs off.
	(equal): In the overload for function_type, strip potential
	typedefs off of return types before comparing them.
	(decl_base::set_naming_typedef): Properly adjust the qualified
	name of the type to which a naming typedef is being set.
	* tests/data/test-alt-dwarf-file/libstdc++/libstdc++-report.txt:
	New reference test output.
	* tests/data/test-alt-dwarf-file/libstdc++/usr/lib/debug/usr/lib64/libstdc++.so.6.0.30-12.1.1-1.fc37.x86_64.debug:
	New binary test input.
	* tests/data/test-alt-dwarf-file/libstdc++/usr/lib64/libstdc++.so.6.0.30:
	New binary test input.
	* tests/data/Makefile.am: Add the new test material to source
	distribution.
	* tests/data/test-annotate/test15-pr18892.so.abi: Adjust.
	* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
	* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
	* tests/data/test-read-dwarf/PR25007-sdhci.ko.abi: Likewise.
	* tests/data/test-read-dwarf/test-libaaudio.so.abi: Likewise.
	* tests/data/test-read-dwarf/test-libandroid.so.abi: Likewise.
	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.
---
 src/abg-ir.cc                                 |    31 +-
 tests/data/Makefile.am                        |     3 +
 .../libstdc++/libstdc++-report.txt            |     0
 ...tdc++.so.6.0.30-12.1.1-1.fc37.x86_64.debug |   Bin 0 -> 15440008 bytes
 .../libstdc++/usr/lib64/libstdc++.so.6.0.30   |   Bin 0 -> 2360008 bytes
 .../data/test-annotate/test15-pr18892.so.abi  |   620 +-
 .../data/test-annotate/test17-pr19027.so.abi  | 10721 ++++++++--------
 .../data/test-annotate/test21-pr19092.so.abi  |    60 +-
 .../data/test-read-dwarf/PR25007-sdhci.ko.abi |  2308 ++--
 .../test-read-dwarf/test-libaaudio.so.abi     |    16 +-
 .../test-read-dwarf/test-libandroid.so.abi    |  1440 ++-
 .../test-read-dwarf/test15-pr18892.so.abi     |   402 +-
 .../test-read-dwarf/test16-pr18904.so.abi     |   388 +-
 .../test-read-dwarf/test17-pr19027.so.abi     | 10231 ++++++++-------
 .../test-read-dwarf/test21-pr19092.so.abi     |    48 +-
 tests/test-alt-dwarf-file.cc                  |     7 +
 16 files changed, 13141 insertions(+), 13134 deletions(-)
 create mode 100644 tests/data/test-alt-dwarf-file/libstdc++/libstdc++-report.txt
 create mode 100644 tests/data/test-alt-dwarf-file/libstdc++/usr/lib/debug/usr/lib64/libstdc++.so.6.0.30-12.1.1-1.fc37.x86_64.debug
 create mode 100755 tests/data/test-alt-dwarf-file/libstdc++/usr/lib64/libstdc++.so.6.0.30

The patch is too big for the mailing list so it can be read online at
https://sourceware.org/git/?p=libabigail.git;a=commit;h=72b46b2600ef1f7af54b6d5f7dd6afc23c7cf2c3

Cheers,

-- 
		Dodji


                 reply	other threads:[~2022-06-23 11:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o7yjfvrh.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=bewoodar@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).