From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5A91238560AC for ; Thu, 23 Jun 2022 11:45:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A91238560AC Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-vtrhXPdINoK-y2Uksp8htg-1; Thu, 23 Jun 2022 07:45:58 -0400 X-MC-Unique: vtrhXPdINoK-y2Uksp8htg-1 Received: by mail-qv1-f70.google.com with SMTP id g7-20020a0ce747000000b0047079ec462dso1631156qvn.20 for ; Thu, 23 Jun 2022 04:45:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:organization:date:message-id :user-agent:mime-version; bh=B5cry5Nf+4puULTEZF96YgeqInGjCEW+46uNlK4M8bM=; b=5ndHfh8FYT0G+XJZbVSnUQn8rqBlaeOT50QLDsuy3FqcA534YxjejRcdKC2xck60Ri lBNrgzUj9e4ImcTjOOUi0SH7GU/x/VNZShJYO36S9sPnIYPIGR2nICVKq7YdTfnlc311 oKIQp5naT071YHOhZnPjRmlIy1x0Xg5oYgYXrjqTRnRgmoUnnvYUCr+sE9TQuJVKIhAZ mRvTgqLmIkeqIVJy83pgXxTsP0hufLPOf8QhJmAgksGbYf8egt/bI0zqJL/bkDi9CqWq yTcK72JJR96poQUy5fqJd4B99yTyND1hUNAFgY3NS/LZNKHTEE38f7+nahi5kJwU7KAy JEpA== X-Gm-Message-State: AJIora8pmBQN7HShAjk7kJgEQwXH8MhIYwSMTmOIVFTeegHPu3dQthLd dY/zpN0RUmoEHKPyCYdC5KCJasQHbMn6T2kGDeG6ONRrAQy+rec8d87u+3ZbVLWE7TNLH9GDpVf FrhM2mNVQIBvvQae0cZIJ X-Received: by 2002:a05:620a:24d3:b0:6a7:51b1:d98e with SMTP id m19-20020a05620a24d300b006a751b1d98emr5894676qkn.580.1655984757263; Thu, 23 Jun 2022 04:45:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vaKWyxUlZNm/SsxfT4Q6RcsMBK5vkUdFyPYdxdYOgW7Eu8FaxQ5LLcxGz716BFxiXU2w9pdw== X-Received: by 2002:a05:620a:24d3:b0:6a7:51b1:d98e with SMTP id m19-20020a05620a24d300b006a751b1d98emr5894656qkn.580.1655984756962; Thu, 23 Jun 2022 04:45:56 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id br31-20020a05620a461f00b006a6af4b40b1sm18451079qkb.73.2022.06.23.04.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jun 2022 04:45:56 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id C9796581C3B; Thu, 23 Jun 2022 13:45:54 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Cc: bewoodar@redhat.com Subject: [PATCH, applied] ir: Make canonicalization stable wrt typedefs in fn return types Organization: Red Hat / France X-Operating-System: Fedora 37 X-URL: http://www.redhat.com Date: Thu, 23 Jun 2022 13:45:54 +0200 Message-ID: <87o7yjfvrh.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2022 11:46:01 -0000 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 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