From patchwork Fri Oct 20 09:55:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 56262 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B1AAD3857702 for ; Fri, 20 Oct 2023 09:55:50 +0000 (GMT) X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id C8599385841B for ; Fri, 20 Oct 2023 09:55:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8599385841B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C8599385841B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697795746; cv=none; b=UXEztP5qMhH+A5IpkEmsdd3Jz1HaXtjOBu6oXTBh/+5SvFdTEXOntmWd8qEJ2Qw1GrWd3hpKR3DpBGW/30NeGHBD3VDuGvZP04bPmoql2+cHbk//JVvalp5lbT2ncQq5H5UPbuVqGcBmJCwN5504OvzlQBlebq7g9qkQCLAGIdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697795746; c=relaxed/simple; bh=XS+6pub9VrYL5pLXmDEALjVuAj/JsxTzmZfADbAH7iY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=xKiH+0zYrpsEsPMNN6eKl0vetv8BCN5f5EwTgwY7CvJi7Ml4fHwp+P5QRKlm/ZA/VXYgw/ZHT9/moekVvzpCVBdM/p0hfyZ1/FCK28PN2n4+f4CNzlXeKNppZyqbxJH6XG9ZBLNbw1ain7WbWtjPFiqXcm5oTAfJXrQ27kGyW80= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697795743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=ZE+PtPVbo7EONRXpVh+YKU5VCKQAiL65kGvnwXUD95o=; b=g9jMfXXw186v6he55wNkqnrrWq1Z58Ii9OPySCkWP2bf8xghfUitUEc9a/Xaem6Qfi9BTI rbvaTmbTT5mxl3GRLDDpcRr2W3zUn/oIMA4FBU5OVQ5V1jpGJ4Sa9Dd+5r4TXeuSw/tMhw fslfFoPWl8cQQW3epKspUYjvgixuwlg= 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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-684-D9482NTcNamkflInELyoIg-1; Fri, 20 Oct 2023 05:55:28 -0400 X-MC-Unique: D9482NTcNamkflInELyoIg-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-66d0ceb78cbso7777406d6.1 for ; Fri, 20 Oct 2023 02:55:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697795728; x=1698400528; h=mime-version:user-agent:message-id:date:organization:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZE+PtPVbo7EONRXpVh+YKU5VCKQAiL65kGvnwXUD95o=; b=JIRTnf9w4zrOkkf117wYyVoLuZFHSv76ApGvhRs160J0/b7pTEwqizCYPuKVYWBPaU tlGczI/+DW7YLUDKNlnDS3LvWce1WWNBvz1OL/6XkE2FnSQ8oEYdDtaN0zx4mPVXYxMl wnA+fmhF4qh9NbbTc6/xLxr37zbTRzomWbFUN089Fx2d6mc2idAyyNT3knM5BCcIctT3 etxq2dYePJNlxufBsRqX+fqU2md0YobXs00q11XJMkc3b882sjX3ZZw+ly/4JNqXLVY9 Vxl8tuGPH6tJ0RsTqd4hC3nkJIv2CHloh6t8nYYicHuy0jm2FKTEXf3G8UwaffVkJ2pP CK2Q== X-Gm-Message-State: AOJu0YyJDKaps1au/7WnxD6QbcHDWR8grLvsU/XHDspjWucVzjJX7DmO elyhdGZuJkKF1/IDDJ/3CbufacClBw8ACvKExxE3q+ybON5TzNP+4hba24DzWmmRdqrfH5mE5tR N5glOnReoTbqJBeF64tRd X-Received: by 2002:ad4:5f09:0:b0:66d:6043:fa16 with SMTP id fo9-20020ad45f09000000b0066d6043fa16mr1728700qvb.2.1697795728029; Fri, 20 Oct 2023 02:55:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTFJ8y2J8JDfOwpcPjBYsKrLvADBUejzVfxto6GZu2auug/de6WFfrIJATfnmF2+8dJBS8fg== X-Received: by 2002:ad4:5f09:0:b0:66d:6043:fa16 with SMTP id fo9-20020ad45f09000000b0066d6043fa16mr1728688qvb.2.1697795727734; Fri, 20 Oct 2023 02:55:27 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id po15-20020a05620a384f00b007776c520488sm482483qkn.9.2023.10.20.02.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:55:27 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id C722E5077C49; Fri, 20 Oct 2023 11:55:24 +0200 (CEST) From: Dodji Seketeli To: John Moon , Trilok Soni , Satya Durga Srinivasu Prabhala Cc: libabigail@sourceware.org, dodji@redhat.com Subject: [PATCH 0/7, applied to mainline] Support the Linux Kernel UAPI checker project Organization: Red Hat / France X-Operating-System: AlmaLinux 9.2 X-URL: http://www.redhat.com Date: Fri, 20 Oct 2023 11:55:24 +0200 Message-ID: <87cyx97h4j.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Hello, The check-uapi.sh script uses abidiff to validate backwards compatibility of the Linux Kernel UAPI headers. It does so by comparing modified headers' ABI before and after a patch is applied. The script is being reviewed upstream, notably at https://lore.kernel.org/lkml/20230407203456.27141-1-quic_johmoo@quicinc.com/. During that review, it appeared that libabigail needs a number of improvements to support this Linux Kernel UAPI checker project. From a discussion on the mailing list[1], John Moon laid out the 3 areas that need improvement in libabigail: 1. Extend the suppression specification engine to better support enum expansion by adding support for this kind type suppression: [suppress_type] type_kind = enum 2. Extend the suppression specification engine to support suppressing change reports involving new data members being added right before flexible array data members with this kind of type suppression: [suppress_type] type_kind = struct name = foo has_data_member_inserted_at = offset_of_flexible_array_data_member has_size_change = yes 3. Better support representing changes to anonymous enum, union and struct types. Item 1/ is handled by the first patch: suppression: Add "changed_enumerators_regexp" property Item 2/ is handled by the sixth patch: Support suppressing data member insertion before a flexible array member Item 3/ is handled by patches three to five: ir,comparison,corpus: Better support anonymous enums comparison ir,comparison: Represent changed anonymous enums comparison: Represent changed unreachable anonymous unions, structs & enums The last patch is a rewrite of the support of the (existing) handling of the "end" keyword in terms of the concept of "named boundary" introduced by the sixth patch. Note that the "end" keyword is used in suppression specifications like this one: [suppress_type] type_kind = struct name = foo has_data_member_inserted_at = end has_size_change = yes That last patch thus makes the new "named boundary" concept used in a consistent way in the source code, making it more maintainable. This patch set has been applied to the master branch. Thanks. Dodji Seketeli (6): default-reporter,reporter-priv: Do not report names of anonymous enums ir,comparison,corpus: Better support anonymous enums comparison ir,comparison: Represent changed anonymous enums comparison: Represent changed unreachable anonymous unions, structs & enums Support suppressing data member insertion before a flexible array member suppression: Make the "end" data member offset selector be named boundary John Moon (1): suppression: Add "changed_enumerators_regexp" property doc/manuals/libabigail-concepts.rst | 30 + include/abg-fwd.h | 53 + include/abg-ir.h | 11 + include/abg-suppression.h | 33 + src/abg-comparison.cc | 152 +- src/abg-corpus.cc | 4 +- src/abg-default-reporter.cc | 12 +- src/abg-ir.cc | 358 +- src/abg-reporter-priv.cc | 11 +- src/abg-suppression-priv.h | 1 + src/abg-suppression.cc | 187 +- tests/data/Makefile.am | 44 + .../test-anon-types-report-1.txt | 31 + .../test-abidiff-exit/test-anon-types-v0.c | 42 + .../test-abidiff-exit/test-anon-types-v0.o | Bin 0 -> 3240 bytes .../test-abidiff-exit/test-anon-types-v1.c | 33 + .../test-abidiff-exit/test-anon-types-v1.o | Bin 0 -> 3168 bytes .../test-anonymous-enums-change-report-v0.txt | 16 + .../test-anonymous-enums-change-report-v1.txt | 21 + .../test-anonymous-enums-change-v0.c | 36 + .../test-anonymous-enums-change-v0.o | Bin 0 -> 3296 bytes .../test-anonymous-enums-change-v1.c | 41 + .../test-anonymous-enums-change-v1.o | Bin 0 -> 3336 bytes .../test-abidiff-exit/test-fam1-report-1.txt | 14 + .../test-abidiff-exit/test-fam1-report-2.txt | 3 + .../test-abidiff-exit/test-fam1-report-3.txt | 14 + .../test-abidiff-exit/test-fam1-report-4.txt | 3 + .../test-abidiff-exit/test-fam1-report-5.txt | 14 + .../test-fam1-suppr-1.abignore | 4 + .../test-fam1-suppr-2.abignore | 3 + .../test-fam1-suppr-3.abignore | 5 + .../test-fam1-suppr-4.abignore | 5 + tests/data/test-abidiff-exit/test-fam1-v0.c | 10 + tests/data/test-abidiff-exit/test-fam1-v0.o | Bin 0 -> 3184 bytes tests/data/test-abidiff-exit/test-fam1-v1.c | 11 + tests/data/test-abidiff-exit/test-fam1-v1.o | Bin 0 -> 3224 bytes .../test-abidiff-exit/test-fam2-report-1.txt | 14 + tests/data/test-abidiff-exit/test-fam2-v0.c | 10 + tests/data/test-abidiff-exit/test-fam2-v0.o | Bin 0 -> 3184 bytes tests/data/test-abidiff-exit/test-fam2-v1.c | 12 + tests/data/test-abidiff-exit/test-fam2-v1.o | Bin 0 -> 3232 bytes tests/data/test-annotate/libtest23.so.abi | 224 +- .../test-anonymous-members-0.o.abi | 22 +- .../data/test-annotate/test15-pr18892.so.abi | 8 +- ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 54 +- ...19-pr19023-libtcmalloc_and_profiler.so.abi | 10 +- ...st20-pr19025-libvtkParallelCore-6.1.so.abi | 2 +- .../test43-PR22913-report-0.txt | 4 +- ...merator-changes-enumerator-changes-1.suppr | 3 + ...merator-changes-enumerator-changes-2.suppr | 3 + ...merator-changes-enumerator-changes-3.suppr | 3 + ...merator-changes-enumerator-changes-4.suppr | 3 + ...merator-changes-enumerator-changes-5.suppr | 3 + ...or-changes-enumerator-changes-report-0.txt | 29 + ...or-changes-enumerator-changes-report-1.txt | 21 + ...or-changes-enumerator-changes-report-2.txt | 21 + ...or-changes-enumerator-changes-report-3.txt | 13 + ...or-changes-enumerator-changes-report-4.txt | 21 + ...or-changes-enumerator-changes-report-5.txt | 3 + ...enumerator-changes-enumerator-changes-v0.c | 37 + ...enumerator-changes-enumerator-changes-v0.o | Bin 0 -> 3944 bytes ...enumerator-changes-enumerator-changes-v1.c | 40 + ...enumerator-changes-enumerator-changes-v1.o | Bin 0 -> 4064 bytes .../test-read-dwarf/PR22122-libftdc.so.abi | 12416 ++++++++-------- tests/data/test-read-dwarf/libtest23.so.abi | 216 +- .../test-read-dwarf/test-libandroid.so.abi | 44 +- .../test-read-dwarf/test16-pr18904.so.abi | 1816 +-- ...st18-pr19037-libvtkRenderingLIC-6.1.so.abi | 40 +- .../test22-pr19097-libstdc++.so.6.0.17.so.abi | 60 +- tests/test-abidiff-exit.cc | 153 + tests/test-diff-suppr.cc | 60 + 71 files changed, 9022 insertions(+), 7545 deletions(-) create mode 100644 tests/data/test-abidiff-exit/test-anon-types-report-1.txt create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v0.c create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v0.o create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v1.c create mode 100644 tests/data/test-abidiff-exit/test-anon-types-v1.o create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v0.txt create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-report-v1.txt create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.c create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v0.o create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.c create mode 100644 tests/data/test-abidiff-exit/test-anonymous-enums-change-v1.o create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-1.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-2.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-3.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-4.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-report-5.txt create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-1.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-2.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-3.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-suppr-4.abignore create mode 100644 tests/data/test-abidiff-exit/test-fam1-v0.c create mode 100644 tests/data/test-abidiff-exit/test-fam1-v0.o create mode 100644 tests/data/test-abidiff-exit/test-fam1-v1.c create mode 100644 tests/data/test-abidiff-exit/test-fam1-v1.o create mode 100644 tests/data/test-abidiff-exit/test-fam2-report-1.txt create mode 100644 tests/data/test-abidiff-exit/test-fam2-v0.c create mode 100644 tests/data/test-abidiff-exit/test-fam2-v0.o create mode 100644 tests/data/test-abidiff-exit/test-fam2-v1.c create mode 100644 tests/data/test-abidiff-exit/test-fam2-v1.o create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-1.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-2.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-3.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-4.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-5.suppr create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-0.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-1.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-2.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-3.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-4.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-report-5.txt create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.c create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v0.o create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.c create mode 100644 tests/data/test-diff-suppr/test40.1-enumerator-changes-enumerator-changes-v1.o