From patchwork Thu Jul 30 18:12:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140285 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9EE334BBCDC4 for ; Thu, 30 Jul 2026 18:12:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EE334BBCDC4 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by sourceware.org (Postfix) with ESMTPS id 418674BB8F4A for ; Thu, 30 Jul 2026 18:12:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 418674BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 418674BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435169; cv=none; b=XpVXJ8rukoIRIPmX8ImvUubVu2CiOJ6ydgVT0tM+yuIqpZxWA10ItzRZYuwHtBRpDZIfiVYEg0plRBmabPRtkTHkyic26MILEeeY3qIpldDNuOAsLnq2PWK4EsfsWgWkHTUOzHw8r1wdJfK1f62o/Ota90v/kzLEWDYOGohN1fQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435169; c=relaxed/simple; bh=KmRmu+DjRa+Gmsf3GRrLLJ75YgCIDUWoI8oWJusVrpg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=T2V6NFbe8cjJlGKOKKApn3XdNh74MKfwV/o6oLscWFe/gyApuptDGPk+sF7IZIoFimA311S3tl7+AQxOtanf8iUIr+JdZt/7HYkaZpJbHbM4GRirbguFDrr1nM7T4htJLywAw7lUh7TMUXxdmo9ZaviixOpWZw9kTBJwXYqKJTo= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 418674BB8F4A Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4954dff6536so498775e9.0 for ; Thu, 30 Jul 2026 11:12:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435168; x=1786039968; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pj6K+OtoHiy7NXY1dGLHnt7k8pGa8S8TSqLAluzrz1A=; b=eaj8PdDyqvhA0vaJQMjWqa0HiSS37ulgqMX4RbSbsPsuL96QZJpp0mGR3zyY68xufD 6Sdd/uXxqRpBCYwSBZxezXzqv9VIGI2ThhrGg/PC6tH12s37Rm0te7KxMxq8XKtySO+D 43ceD+QNsJKKSBEIQEKVE9UuXHRm5kaH4dxtl+WcNnh0rk1iK6xnxOIwW/g1H6YkE1Mz 0ZziW01fmlYjJr7C855I/upQyoxxY1VxFuGKpf1M+KueDDX7J5dCLtMhyX1EWNIpv/Tm 4ppT0OntbkMbtsmCu5yzWuHck6E546h9muD0zkT8BprqeRNInGgJgaaKEkuxstRl0HBc R0Ng== X-Gm-Message-State: AOJu0Yx/vv58BJV9xc/Q4IUl1A7+YfCN8F7z2aXlcPysx2M5U/N46oBf lP7sRlncbcauVZ1hCHkoTWOtDaS92li3kBZwMk4LyT3vfCbnG93BGDZnuFIPjYiZ X-Gm-Gg: AR+sD10PWwsZQmicmST0ZVJ7/8Le2mf3vajb3q4fqnn51nBmLx2rq1t7HWyInXj1yB0 zTYmCqJKlOJ3QTqo81hTiWP880AbLxKw9YyV3nImlqmTY8RkIltnosybYE2PPWQMw0A/wDP9Z0k KdZKEct8/TBUGFrN1O5uNpMAp74J1H9HyPkpxpHRlUXnVda6ewXWu3SKqHAWgx67we4RXzx3pzh kkOTTMTSJ/mwgSvS35PZruJ0A0plN+4hSVJ9hdbmsBOfozRLGwhADlfd8Df/3X82qDdL2v5G+/V NG+WPhVxnfT0URSDOYSSiaCNOs8+FShV0dQfw/JT8yENewrskxzQZDYe4tAEYwjFLig7ZNu+OSF 7TPMBRwoj7sM/HwmcXQB9DOmO7rKaGB1N0DzRlUzQhlZXf0+kiXhx3xaBNwK/poMgKtoNx5EeV7 GHIpLWiG8h5gMid1zNi0ldwRw+1YSDiCxUCoWowhwdXZiZZgHAetKhy5s/0f385AxSzFPnbAJo7 zUUva3BHG8HmW8elGlro87m/EzNdDApyIBKvtMNW5Ckjps/7GI3mQ== X-Received: by 2002:a05:6000:2008:b0:47f:7f95:8a1e with SMTP id ffacd0b85a97d-47fc80c62a2mr5478594f8f.5.1785435167781; Thu, 30 Jul 2026 11:12:47 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fc892cc49sm8187564f8f.17.2026.07.30.11.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:12:46 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 3F2916058B8B; Thu, 30 Jul 2026 20:12:46 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 1/9] tests/mockfedabipkgdiff.in: Fix python module loading Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:12:46 +0200 Message-ID: <87o6fopcrl.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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 master branch was failing to build in Fedora 45 (Rawhide) due to a python-3 related change in package availability. Fixed thus. * tests/mockfedabipkgdiff.in (load_source): Make this work for python 3. Applied to the master branch. Signed-off-by: Dodji Seketeli --- tests/mockfedabipkgdiff.in | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/tests/mockfedabipkgdiff.in b/tests/mockfedabipkgdiff.in index 863cf7f6..6abbb99e 100644 --- a/tests/mockfedabipkgdiff.in +++ b/tests/mockfedabipkgdiff.in @@ -69,30 +69,19 @@ def get_download_dir(): def load_source(name, path): - # Different version of Python want this be done differently. - try: - import importlib.machinery - loader = importlib.machinery.SourceFileLoader(name, path) - import importlib.util - spec = importlib.util.spec_from_loader(name, loader) - module = importlib.util.module_from_spec(spec) - spec.loader.exec_module(module) - import sys.modules - sys.modules[name] = module - return module - except: - pass - try: - import importlib.machinery - loader = importlib.machinery.SourceFileLoader(name, path) - module = loader.load_module() - return module - except: - pass - import imp - module = imp.load_source(name, path) - return module + import importlib.util + from importlib.machinery import SourceFileLoader + + loader = SourceFileLoader(name, path) + spec = importlib.util.spec_from_file_location(name, path, loader=loader) + if spec is None: + raise ImportError(f"Cannot find module '{name}' at path '{path}'") + module = importlib.util.module_from_spec(spec) + import sys + sys.modules[name] = module + spec.loader.exec_module(module) + return module # Import the fedabipkgdiff program file from the source directory. fedabipkgdiff_mod = load_source('fedabipkgdiff', FEDABIPKGDIFF) From patchwork Thu Jul 30 18:13:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140286 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9A5B94BB8F71 for ; Thu, 30 Jul 2026 18:13:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A5B94BB8F71 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by sourceware.org (Postfix) with ESMTPS id DC2C14BBCDEA for ; Thu, 30 Jul 2026 18:13:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC2C14BBCDEA Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DC2C14BBCDEA Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435217; cv=none; b=IjPeNe+SZoPRQB3mBDJLVX4Whsw2v8XMAxrr8wjY7vo/hPpCZMUl2DAOVr7U5HpMuvyQwerHzGIjCyrClW6nBoBY4K/kAGgWzdeL07jbl9DMSOuoR/Xhfj6bT+20QCIj+LqRqPhgMblNXfqAa7yNgKBc1+SaqmOgwqsvNqPY1TU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435217; c=relaxed/simple; bh=dGS3DOqvX/Gbd6Uuk/rFZT5mR8+KgN1EpgzDrsXu55Y=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=h5jwa81R4vqTZMDNr20MP4vUMygUGnjBm0Bc+E00yEI4wYP2GFnHgyBWJxjy9GFMLeUjrBkuuKxDUdua2Fsya6WZIqDBbUuVwIcDoAom6n++OL9fZ3rbmeWwk2E08uLOHoGz7+7mB8Ghws/yCPTDCPVL9vQEaWLAnzeG7k6EIlI= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC2C14BBCDEA Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-498028b3d5eso880385e9.1 for ; Thu, 30 Jul 2026 11:13:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435216; x=1786040016; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Na8nsTJlgioHJUeAJjco4tGeYU5uaavlKz7L3Ph7K/8=; b=qVb8XWkIsZf2Ucfa2SZ9Z9jF8GILVjGsE39lOaxCEwdaqjaO2WkWCCY52jyJqSDy15 MD7AfTmmNdI8cfgxhudU4YBHK2VC5kk2RgrlHFsaAQQ+lOLFxKkcveH59pUWtYxInOpb dDWYK9qhC4rk91UlJLsOEBXpQqGQPld5gJItTeLCVbfbxG3SLOwzXR3aM0G2l5bhE57q zGTDO8HGKfp3QExg1rcEM1UpKHlm5dvSoxBvA4QwLul8464h/us+qs7uRhOfLNn5API6 Nvx391ie12pRjNRpaXPIMs6iBuem5I45RIYsn6qOfqxXQoZ15GlWr8ad4HnZMm/ZdsW1 NMnw== X-Gm-Message-State: AOJu0YyRmCinuAVdCdNXqXa4ZVjeKdMLNcCpluSv1W8RBnJFJbOEonQR CnHy/s7QEVhaPIIYRC4kYKJLg3B5g51oUQsGHntRf4eBFLhlTpkoutl2axgibXFc X-Gm-Gg: AR+sD10ljAULNpWwjtDco7r81bqf1mMkUDl2OP+0805L+GubZcXD3Q99KaRa3lRr029 VvKtdiV3ID8FpInA5RcaZas6GRRMJNXD6qBnr9GbwN3eJ8qS7hG0TD3ms2/iwvrnXuLjl0kBqKg 4Ahus2yDkGMzqBWSVC9r6hN1UiTTNUQ3z+Grs3p8vqavQ2FPtUajNEY5KLYmEcb/p6mKRzrgHqT KxwtaGBubSSvFbUBTEP0gLeHVYik/AfkFnC4GaW5LkNhtAACXMlRpfJ9vhgiF4MgczPH7plD8TO d3L7nC4xl9S4t0+g5D1hmUSDGttRIgd/+qt8RWJIWEUnOX1gYyeCMeYP8Au9vukOoWI5aMCPmjH Xw1T/b9YnRGy3v81M8vaNZbE1bx38kcSR8+bBbid+R4Z35uWouGvDy4fdEeFYm+YwpIFcMnlY0W DIFClEtLjOGG1KOca8bvZTUk94xF4EnFzecGe/xh0sDE8dIm2JX+Mwibi/oykQU2OfKgfi4VNSa cDDSBCxoE1E3AxKtJL5EJXntFfs1zeEvg2oa7Z2HDC+TsL6k1OSxQ== X-Received: by 2002:a05:6000:186c:b0:47f:77a8:7e8f with SMTP id ffacd0b85a97d-47fc8217056mr5623574f8f.60.1785435215642; Thu, 30 Jul 2026 11:13:35 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fc877dafasm7622176f8f.0.2026.07.30.11.13.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:13:34 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 6FFD36058B8B; Thu, 30 Jul 2026 20:13:34 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 2/9] dwarf-reader: Log the number of canonicalized types Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:13:34 +0200 Message-ID: <87jyqcpcq9.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, When doing abidw --verbose, log the number of unique canonicalized types. * src/abg-dwarf-reader.cc (reader::canonicalize_types_scheduled): Log the number of unique canonicalized types in the system using the new function environment::priv::get_number_of_canonical_types. * src/abg-ir-priv.h (environment::priv::get_number_of_canonical_types): Define new function. Signed-off-by: Dodji Seketeli Applied to the master branch. --- src/abg-dwarf-reader.cc | 6 +++++- src/abg-ir-priv.h | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 5b66fed2..db09958c 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -5091,9 +5091,13 @@ public: if (do_log()) { cn_timer.stop(); + const environment& env = types_to_canonicalize().front()->get_environment(); cerr << "DWARF Reader finished types " << "sorting, hashing & canonicalizing in: " - << cn_timer << "\n"; + << cn_timer + << ", for " + << env.priv_->get_number_of_canonical_types() + << " types\n"; } } diff --git a/src/abg-ir-priv.h b/src/abg-ir-priv.h index 24da0f02..b9e2d63e 100644 --- a/src/abg-ir-priv.h +++ b/src/abg-ir-priv.h @@ -806,6 +806,20 @@ struct environment::priv right_type_comp_operands_.pop_back(); } + /// Get the number of canonical types in the system. + /// + /// @return the number of canonical types in the system. + size_t + get_number_of_canonical_types() + { + size_t n = 0; + for (auto& entry : canonical_types_) + for(unsigned i = 0; i < entry.second.size(); ++i) + ++n; + + return n; + } + #ifdef WITH_DEBUG_SELF_COMPARISON const unordered_map& From patchwork Thu Jul 30 18:15:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140287 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 743AB4BB8F71 for ; Thu, 30 Jul 2026 18:15:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 743AB4BB8F71 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by sourceware.org (Postfix) with ESMTPS id F101E4BB8F4A for ; Thu, 30 Jul 2026 18:15:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F101E4BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F101E4BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435321; cv=none; b=gmrByJokSsjoY2k0sVWiV3CYSTcIJnLZNKcI/C/VQyzdjpr14iZEDZyzVwR7N+y15dxG+NGMK7Ilb+vyUgHfLr3R/p+uvJpRu1E5SDHRs2+2pWL5x4am1hwqg9WDmO485Bb4VrJo15hd+NgZJV1MlJgm04kaG2YQPiFnPsSdvNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435321; c=relaxed/simple; bh=Tp98uVDAICMkt1C8dLZHuGDgrrTXLRAPIbW4AIdNKkI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=PXx5yLrktO9k9b+BqzkWHID7I7/y/z99/S99d9549E03IODHe5MzfcwUq7HYeF2Jauc+5h9KKC1Fqr2rNoR1wNBAa/ZkrFS41q3CqK3U3ixO2lfKprcgG5QT6K2SD31+BErjVp0nTGElw6DfGNLrvwqinLTZopGoHuVRoJ36RhM= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F101E4BB8F4A Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-47f633e6058so27628f8f.0 for ; Thu, 30 Jul 2026 11:15:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435320; x=1786040120; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=MNq3+WVYZpWRjAdMO0fw8mLzBcwbMhG7wLZIlnEjTy4=; b=O8eunxad1YDDG29JnYIItxKzBiGOe4wXiVUxJL6B1qqwP7q1mOqXm8ul3j//vvfqn2 tipk8pRi2nXWaB8m9DxLpHMy6QQgWRQh6LqQMt1+euRsU/DkLL529W/ISfbdS326Tw1R BMp9R3n/5CLa0l6HpXsvjdo+9yP2np6TnwzNzlMvEMRVpKb/Wxd+9aLJbK/rQu3flzCL lV6AjtNnu5eguCHoCObEmJp4DbbawwJTtZtgQfjsPwuJMwXBurjWUzf09B/tfxJmE6r9 W9k8LzIb3HsIzrNUeA/Aw4n2/AfBuaSFElvKBIR8JrcncnxEHQ5siq5MWSFEbQSWIUEH Dl6A== X-Gm-Message-State: AOJu0YycgQv++UgNfBwpLELKoWa/w2Ln/BaPakdsZcJWAJT0CgFxJ4qb tFE8z6f/I9f0tIx1/AY5KQ5DNuhPMDcUZFw8oeECsu/FidSCRlQ20Up5HK1CrCq8 X-Gm-Gg: AR+sD132OLLtmsm7eJmLgsNkVIfPi2zLpIKIYcDlxWdNG/pBOY0ZAAOA96PMHsv0Sfi QUbZcTRYTJL4sJyDPSgOK9WnTNcQ5595OOnbqpWApe0UAl8t+8Ecct1KR0RQG+6otyvTmrPmv/5 8gOwFVeuys25WfIsOSnsLfP3YpuKn4iKkD/kRQjAGOxRAW6QvLVnvu4QABVo+ASectVFw2N5GKZ znGLEgP9wIq5HTsZXfzuFJ255ia9t6To0kKwJG8v5ZHVXUgwoU1KVIjXp9iUE52I2wkrfXsfVMg HW7MwgpYt7HT6zhx6GmFEvnUHZYFfPnlwlSxfoDkHVruhlTrZeSWHNhZOISViFyRWflC0ioM+/z 2JpPnCA+BchakwgJ0HeK9duJnVplU269OX9pVb6EVqEwJG7NDrgQKE35BUsUb0ezggC737v8JL2 Eto62y/xVMcF5Q1MpVfNUcCQQzwqZe2mv4282CMUcbgRDtHIT8WTC8jUw38/oBV4gW8aPeu4R6+ Xzk1VtzoyrrqnCfBoUL34fwbr7YLClEliMQKrbq9slF+/8jA5nurg== X-Received: by 2002:a05:6000:2dc4:b0:47f:c62e:9cca with SMTP id ffacd0b85a97d-47fc81c43d9mr5618957f8f.22.1785435319758; Thu, 30 Jul 2026 11:15:19 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fc8941e7asm7115152f8f.36.2026.07.30.11.15.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:15:18 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 5964F6058B8B; Thu, 30 Jul 2026 20:15:18 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 3/9] {tests,tools}/Makefile.am: Consider prefixed include directories Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:15:18 +0200 Message-ID: <87fr10pcnd.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, When the tree is configured to consider dependencies in a prefixed directory, some tools still ignore those dependencies. Fixed thus. * tests/Makefile.am: Do not forget to consider the prefixed include directories. * tools/Makefile.am: Likewise. Signed-off-by: Dodji Seketeli Applied to the master branch. --- tests/Makefile.am | 2 +- tools/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index c3223f1a..5bad12bb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -234,7 +234,7 @@ runtestabidb3_sh_SOURCES = runtestabidb3.sh$(EXEEXT): -AM_CPPFLAGS=-I${abs_top_srcdir}/include -I${abs_top_srcdir}/src \ +AM_CPPFLAGS=$(DEPS_CPPFLAGS) -I${abs_top_srcdir}/include -I${abs_top_srcdir}/src \ -I${abs_top_builddir}/include -I${abs_top_srcdir}/tools -fPIC clean-local: clean-local-check diff --git a/tools/Makefile.am b/tools/Makefile.am index ea2d300c..b1f10db2 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -48,6 +48,6 @@ kmidiffdir = $(bindir) kmidiff_LDADD = $(abs_top_builddir)/src/libabigail.la kmidiff_LDFLAGS = $(abs_top_builddir)/src/libabigail.la -pthread -AM_CXXFLAGS = \ +AM_CPPFLAGS= $(DEPS_CPPFLAGS) \ $(VISIBILITY_FLAGS) -I$(abs_top_srcdir)/include \ -I$(abs_top_srcdir)/tools -fPIC From patchwork Thu Jul 30 18:15:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140288 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A0434BBC0E9 for ; Thu, 30 Jul 2026 18:16:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A0434BBC0E9 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by sourceware.org (Postfix) with ESMTPS id 21F7A4BB8F4A for ; Thu, 30 Jul 2026 18:16:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21F7A4BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 21F7A4BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435360; cv=none; b=wGiS/wT0BCshXRWCtwI+efb7IoKJyHDvb8zMNVLHBGyGQBQIgPb29XQr4yqxQPJxE9aSnLw8fddfY+k9QDJrZvyvCdZSXsr9l/RX3437goZu6D0SIMuUrsH2n57GeNZqpfVBxQi5y++FGyqTymhkMjq9+lDLe7Q9R1slOWwGXT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435360; c=relaxed/simple; bh=qbIvKDhIGc88JOl5qSEXp+80hLOuQH0VZgeKWHvtpqs=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=lP1aoMzn7HWQTAi/cnz0EMplAbVn6EyyuYsfmxHk8X3vwDYrYLfWycrq4Isp0ll5xOP266bFVo2x0LQHSQa/+PATpS8fLipvlsYqy7Xpwov5bgWN4EYo3zAsV9IUBWWSZPRv/I8Se9cZw3q94/PJmXLGbN0VeyTgUE/mMIU/j4A= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21F7A4BB8F4A Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-47ddf7b09e5so12461f8f.1 for ; Thu, 30 Jul 2026 11:16:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435359; x=1786040159; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=NF2Pbyc0JmKSGeP58zuAIXXpreYxTMmShHmM54J3F5g=; b=RJeor7184ubXd4QRIKU1Kt63NakV+DmSaevvsQLchuuUUbqyVPe8KdbK4AJr7sOtuS mF4er9nZsG0i0+Yhpff6S8bOl4OeUEvywHAj1LKQ6tww2tRmE6mhSPG/G/pjwDsR2Iqx WEpZxfXP0IN5jE+17HNQJARWC7z49zjzqftYeocz/6yrNy2oWC5IxDzp6WLcNmr8Nhwv T2pV0GCeOl0szj+LR/WBcNCbl9d54TcnPYEammrR+B2AOc/8retguYr5yu/hTFggMXHV BfG4Lo5KePxziA8oYLffXIgIjA/Zv1POwLdMWXfXkJAREC3lPvJVY7fhZf6s2pXu7b9k E/3g== X-Gm-Message-State: AOJu0Yyuj/n7a4ezUTD/gwzrXVDY9fAQ/kCChUaoDf8tOuAP1TpXn8O7 9Z8jiHrE5QBF1VLlt8DWZTMkl8sSRYXPDk/iYteu99dgcu7Ezto7OVOl/+G8EiOm X-Gm-Gg: AR+sD11eTiWzxaBvlXVyifsbHPfl3ajewVXWPiKStEn8QtKPzY/vjUBrf0a0tOoJXNJ ZI3RYtrI6Dh61FuXW7+/GSgPYVwUDUvhdfB/q3W0YJsJxjtEw1KEHKoI7tBW68GnczOQq/8tnkJ FVARnNGiYIH7sxUT/M86MGDvg2me6S6ocfc5UAwQ8yyPkD/wLpJ4lGDo4YX0foOd3Vsycchhq2y JyMDWxn8V31nAJ38UgwkPCqPCxcKmJNeWjHj4WKuqJNVh+c7jDJyGjaSNrd7yX5a8sI8QkXB8nd he7FacWLTWYzNiNFflHgw9HjsfpqAxfpN0QzyhZmw6Iy/+tJldqXDZWlXduMSlB++pQk3KfcnCB tWWy9gf+Q8YVtNcj0IhItEsjq6+MIdgO9EohEt1b5sm5E/uDS8rxnt+nVWT2dRp6gtKKs+Ea1OW JUituyrI1dJPq2UCwHpZGf3Q/diqJgam7b9fwPmEaYqv6BV6BcZu/liW7BxO2mE5HhvfwhcPNvE 4FIcY7ya2aQwNSfHeF9peq4rN3zFB5A8AEhERNP1yI= X-Received: by 2002:a05:6000:402a:b0:47f:8cf9:a12b with SMTP id ffacd0b85a97d-47fc80c6f2emr5501894f8f.6.1785435357525; Thu, 30 Jul 2026 11:15:57 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fc8941708sm8112723f8f.35.2026.07.30.11.15.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:15:56 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 262776058B8B; Thu, 30 Jul 2026 20:15:56 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 4/9] Update copyright year for 2026 Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:15:56 +0200 Message-ID: <87bjbopcmb.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, POISEN_SPAM_PILL, POISEN_SPAM_PILL_2, POISEN_SPAM_PILL_4, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, This was long overdue. * include/abg-btf-reader.h: Update copyright year for 2026. * include/abg-comp-filter.h: Likewise. * include/abg-comparison.h: Likewise. * include/abg-config.h: Likewise. * include/abg-corpus.h: Likewise. * include/abg-ctf-reader.h: Likewise. * include/abg-cxx-compat.h: Likewise. * include/abg-diff-utils.h: Likewise. * include/abg-dwarf-reader.h: Likewise. * include/abg-elf-based-reader.h: Likewise. * include/abg-elf-reader.h: Likewise. * include/abg-fe-iface.h: Likewise. * include/abg-fwd.h: Likewise. * include/abg-hash.h: Likewise. * include/abg-ini.h: Likewise. * include/abg-interned-str.h: Likewise. * include/abg-ir.h: Likewise. * include/abg-libxml-utils.h: Likewise. * include/abg-reader.h: Likewise. * include/abg-regex.h: Likewise. * include/abg-reporter.h: Likewise. * include/abg-sptr-utils.h: Likewise. * include/abg-suppression.h: Likewise. * include/abg-tools-utils.h: Likewise. * include/abg-traverse.h: Likewise. * include/abg-viz-common.h: Likewise. * include/abg-viz-dot.h: Likewise. * include/abg-viz-svg.h: Likewise. * include/abg-workers.h: Likewise. * include/abg-writer.h: Likewise. * src/abg-btf-reader.cc: Likewise. * src/abg-comp-filter.cc: Likewise. * src/abg-comparison-priv.h: Likewise. * src/abg-comparison.cc: Likewise. * src/abg-config.cc: Likewise. * src/abg-corpus-priv.h: Likewise. * src/abg-corpus.cc: Likewise. * src/abg-ctf-reader.cc: Likewise. * src/abg-default-reporter.cc: Likewise. * src/abg-diff-utils.cc: Likewise. * src/abg-dwarf-reader.cc: Likewise. * src/abg-elf-based-reader.cc: Likewise. * src/abg-elf-helpers.cc: Likewise. * src/abg-elf-helpers.h: Likewise. * src/abg-elf-reader.cc: Likewise. * src/abg-fe-iface.cc: Likewise. * src/abg-hash.cc: Likewise. * src/abg-ini.cc: Likewise. * src/abg-internal.h: Likewise. * src/abg-ir-priv.h: Likewise. * src/abg-ir.cc: Likewise. * src/abg-leaf-reporter.cc: Likewise. * src/abg-libxml-utils.cc: Likewise. * src/abg-reader.cc: Likewise. * src/abg-regex.cc: Likewise. * src/abg-reporter-priv.cc: Likewise. * src/abg-reporter-priv.h: Likewise. * src/abg-suppression-priv.h: Likewise. * src/abg-suppression.cc: Likewise. * src/abg-symtab-reader.cc: Likewise. * src/abg-symtab-reader.h: Likewise. * src/abg-tools-utils.cc: Likewise. * src/abg-traverse.cc: Likewise. * src/abg-viz-common.cc: Likewise. * src/abg-viz-dot.cc: Likewise. * src/abg-viz-svg.cc: Likewise. * src/abg-workers.cc: Likewise. * src/abg-writer.cc: Likewise. * tests/print-diff-tree.cc: Likewise. * tests/test-abicompat.cc: Likewise. * tests/test-abidiff-exit.cc: Likewise. * tests/test-abidiff.cc: Likewise. * tests/test-alt-dwarf-file.cc: Likewise. * tests/test-core-diff.cc: Likewise. * tests/test-cxx-compat.cc: Likewise. * tests/test-diff-dwarf-abixml.cc: Likewise. * tests/test-diff-dwarf.cc: Likewise. * tests/test-diff-filter.cc: Likewise. * tests/test-diff-pkg.cc: Likewise. * tests/test-diff-suppr.cc: Likewise. * tests/test-diff2.cc: Likewise. * tests/test-dot.cc: Likewise. * tests/test-elf-helpers.cc: Likewise. * tests/test-ini.cc: Likewise. * tests/test-ir-walker.cc: Likewise. * tests/test-kmi-whitelist.cc: Likewise. * tests/test-lookup-syms.cc: Likewise. * tests/test-read-btf.cc: Likewise. * tests/test-read-ctf.cc: Likewise. * tests/test-read-dwarf.cc: Likewise. * tests/test-read-write.cc: Likewise. * tests/test-svg.cc: Likewise. * tests/test-symtab-reader.cc: Likewise. * tests/test-symtab.cc: Likewise. * tests/test-tools-utils.cc: Likewise. * tests/test-types-stability.cc: Likewise. * tests/test-utils.cc: Likewise. * tests/test-utils.h: Likewise. * tools/abicompat.cc: Likewise. * tools/abidiff.cc: Likewise. * tools/abidw.cc: Likewise. * tools/abilint.cc: Likewise. * tools/abipkgdiff.cc: Likewise. * tools/abisym.cc: Likewise. * tools/binilint.cc: Likewise. * tools/kmidiff.cc: Likewise. * update-copyright.sh: Likewise. Signed-off-by: Dodji Seketeli Applied to the master branch. --- include/abg-btf-reader.h | 2 +- include/abg-comp-filter.h | 2 +- include/abg-comparison.h | 2 +- include/abg-config.h | 2 +- include/abg-corpus.h | 2 +- include/abg-ctf-reader.h | 2 +- include/abg-cxx-compat.h | 2 +- include/abg-diff-utils.h | 2 +- include/abg-dwarf-reader.h | 2 +- include/abg-elf-based-reader.h | 2 +- include/abg-elf-reader.h | 2 +- include/abg-fe-iface.h | 2 +- include/abg-fwd.h | 2 +- include/abg-hash.h | 2 +- include/abg-ini.h | 2 +- include/abg-interned-str.h | 2 +- include/abg-ir.h | 2 +- include/abg-libxml-utils.h | 2 +- include/abg-reader.h | 2 +- include/abg-regex.h | 2 +- include/abg-reporter.h | 2 +- include/abg-sptr-utils.h | 2 +- include/abg-suppression.h | 2 +- include/abg-tools-utils.h | 2 +- include/abg-traverse.h | 2 +- include/abg-viz-common.h | 2 +- include/abg-viz-dot.h | 2 +- include/abg-viz-svg.h | 2 +- include/abg-workers.h | 2 +- include/abg-writer.h | 2 +- src/abg-btf-reader.cc | 2 +- src/abg-comp-filter.cc | 2 +- src/abg-comparison-priv.h | 2 +- src/abg-comparison.cc | 2 +- src/abg-config.cc | 2 +- src/abg-corpus-priv.h | 2 +- src/abg-corpus.cc | 2 +- src/abg-ctf-reader.cc | 2 +- src/abg-default-reporter.cc | 2 +- src/abg-diff-utils.cc | 2 +- src/abg-dwarf-reader.cc | 2 +- src/abg-elf-based-reader.cc | 2 +- src/abg-elf-helpers.cc | 2 +- src/abg-elf-helpers.h | 2 +- src/abg-elf-reader.cc | 2 +- src/abg-fe-iface.cc | 2 +- src/abg-hash.cc | 2 +- src/abg-ini.cc | 2 +- src/abg-internal.h | 2 +- src/abg-ir-priv.h | 2 +- src/abg-ir.cc | 2 +- src/abg-leaf-reporter.cc | 2 +- src/abg-libxml-utils.cc | 2 +- src/abg-reader.cc | 2 +- src/abg-regex.cc | 2 +- src/abg-reporter-priv.cc | 2 +- src/abg-reporter-priv.h | 2 +- src/abg-suppression-priv.h | 2 +- src/abg-suppression.cc | 2 +- src/abg-symtab-reader.cc | 4 ++-- src/abg-symtab-reader.h | 2 +- src/abg-tools-utils.cc | 2 +- src/abg-traverse.cc | 2 +- src/abg-viz-common.cc | 2 +- src/abg-viz-dot.cc | 2 +- src/abg-viz-svg.cc | 2 +- src/abg-workers.cc | 2 +- src/abg-writer.cc | 2 +- tests/print-diff-tree.cc | 2 +- tests/test-abicompat.cc | 2 +- tests/test-abidiff-exit.cc | 2 +- tests/test-abidiff.cc | 2 +- tests/test-alt-dwarf-file.cc | 2 +- tests/test-core-diff.cc | 2 +- tests/test-cxx-compat.cc | 2 +- tests/test-diff-dwarf-abixml.cc | 2 +- tests/test-diff-dwarf.cc | 2 +- tests/test-diff-filter.cc | 2 +- tests/test-diff-pkg.cc | 2 +- tests/test-diff-suppr.cc | 2 +- tests/test-diff2.cc | 2 +- tests/test-dot.cc | 2 +- tests/test-elf-helpers.cc | 2 +- tests/test-ini.cc | 2 +- tests/test-ir-walker.cc | 2 +- tests/test-kmi-whitelist.cc | 2 +- tests/test-lookup-syms.cc | 2 +- tests/test-read-btf.cc | 2 +- tests/test-read-ctf.cc | 2 +- tests/test-read-dwarf.cc | 2 +- tests/test-read-write.cc | 2 +- tests/test-svg.cc | 2 +- tests/test-symtab-reader.cc | 2 +- tests/test-symtab.cc | 2 +- tests/test-tools-utils.cc | 2 +- tests/test-types-stability.cc | 2 +- tests/test-utils.cc | 2 +- tests/test-utils.h | 2 +- tools/abicompat.cc | 2 +- tools/abidiff.cc | 2 +- tools/abidw.cc | 2 +- tools/abilint.cc | 2 +- tools/abipkgdiff.cc | 2 +- tools/abisym.cc | 2 +- tools/binilint.cc | 2 +- tools/kmidiff.cc | 2 +- update-copyright.sh | 4 ++-- 107 files changed, 109 insertions(+), 109 deletions(-) diff --git a/include/abg-btf-reader.h b/include/abg-btf-reader.h index 542bf8bb..68bb4724 100644 --- a/include/abg-btf-reader.h +++ b/include/abg-btf-reader.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-comp-filter.h b/include/abg-comp-filter.h index 26751f50..71eea88c 100644 --- a/include/abg-comp-filter.h +++ b/include/abg-comp-filter.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-comparison.h b/include/abg-comparison.h index 56f75e4f..d6c756bf 100644 --- a/include/abg-comparison.h +++ b/include/abg-comparison.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-config.h b/include/abg-config.h index 34a2ceea..37c34110 100644 --- a/include/abg-config.h +++ b/include/abg-config.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-corpus.h b/include/abg-corpus.h index 0a7cf165..6fd63f7e 100644 --- a/include/abg-corpus.h +++ b/include/abg-corpus.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h index d0eeabe7..3d394f33 100644 --- a/include/abg-ctf-reader.h +++ b/include/abg-ctf-reader.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2021-2025 Oracle, Inc. +// Copyright (C) 2021-2026 Oracle, Inc. // // Author: Jose E. Marchesi diff --git a/include/abg-cxx-compat.h b/include/abg-cxx-compat.h index 40251523..c402411b 100644 --- a/include/abg-cxx-compat.h +++ b/include/abg-cxx-compat.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2019-2025 Google, Inc. +// Copyright (C) 2019-2026 Google, Inc. /// @file diff --git a/include/abg-diff-utils.h b/include/abg-diff-utils.h index f516d624..222c617e 100644 --- a/include/abg-diff-utils.h +++ b/include/abg-diff-utils.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file /// diff --git a/include/abg-dwarf-reader.h b/include/abg-dwarf-reader.h index a059bef4..6ea71490 100644 --- a/include/abg-dwarf-reader.h +++ b/include/abg-dwarf-reader.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-elf-based-reader.h b/include/abg-elf-based-reader.h index 0f270eb3..2044af52 100644 --- a/include/abg-elf-based-reader.h +++ b/include/abg-elf-based-reader.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-elf-reader.h b/include/abg-elf-reader.h index 7fde1804..cc393bd8 100644 --- a/include/abg-elf-reader.h +++ b/include/abg-elf-reader.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-fe-iface.h b/include/abg-fe-iface.h index 9be50833..78aa1164 100644 --- a/include/abg-fe-iface.h +++ b/include/abg-fe-iface.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-fwd.h b/include/abg-fwd.h index 233a169b..b1b73f65 100644 --- a/include/abg-fwd.h +++ b/include/abg-fwd.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-hash.h b/include/abg-hash.h index f5eec101..d21649cf 100644 --- a/include/abg-hash.h +++ b/include/abg-hash.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-ini.h b/include/abg-ini.h index 4155b859..35f431d9 100644 --- a/include/abg-ini.h +++ b/include/abg-ini.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-interned-str.h b/include/abg-interned-str.h index 9beebc98..646e04ff 100644 --- a/include/abg-interned-str.h +++ b/include/abg-interned-str.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-ir.h b/include/abg-ir.h index 3f1c741f..84dd2939 100644 --- a/include/abg-ir.h +++ b/include/abg-ir.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-libxml-utils.h b/include/abg-libxml-utils.h index c5ce84f8..26818f13 100644 --- a/include/abg-libxml-utils.h +++ b/include/abg-libxml-utils.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-reader.h b/include/abg-reader.h index 566cd393..6cc67657 100644 --- a/include/abg-reader.h +++ b/include/abg-reader.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-regex.h b/include/abg-regex.h index 7c4ebd57..196e2d0f 100644 --- a/include/abg-regex.h +++ b/include/abg-regex.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file /// diff --git a/include/abg-reporter.h b/include/abg-reporter.h index 108c55da..c0c38d0d 100644 --- a/include/abg-reporter.h +++ b/include/abg-reporter.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2017-2025 Red Hat, Inc. +// Copyright (C) 2017-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-sptr-utils.h b/include/abg-sptr-utils.h index d6f5b9a3..dcadfd14 100644 --- a/include/abg-sptr-utils.h +++ b/include/abg-sptr-utils.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file /// diff --git a/include/abg-suppression.h b/include/abg-suppression.h index b2a69a51..e7f648fa 100644 --- a/include/abg-suppression.h +++ b/include/abg-suppression.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-tools-utils.h b/include/abg-tools-utils.h index 3db1dc32..b456f9d2 100644 --- a/include/abg-tools-utils.h +++ b/include/abg-tools-utils.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. ///@file diff --git a/include/abg-traverse.h b/include/abg-traverse.h index dca2c6f5..c36c9d5d 100644 --- a/include/abg-traverse.h +++ b/include/abg-traverse.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-viz-common.h b/include/abg-viz-common.h index e9dfd689..47670936 100644 --- a/include/abg-viz-common.h +++ b/include/abg-viz-common.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-viz-dot.h b/include/abg-viz-dot.h index 275d613e..01769e25 100644 --- a/include/abg-viz-dot.h +++ b/include/abg-viz-dot.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-viz-svg.h b/include/abg-viz-svg.h index e24513de..2cd9cf38 100644 --- a/include/abg-viz-svg.h +++ b/include/abg-viz-svg.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/include/abg-workers.h b/include/abg-workers.h index 155f3804..5a24154e 100644 --- a/include/abg-workers.h +++ b/include/abg-workers.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/include/abg-writer.h b/include/abg-writer.h index 355d9eb2..1c6c6654 100644 --- a/include/abg-writer.h +++ b/include/abg-writer.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-btf-reader.cc b/src/abg-btf-reader.cc index 89132dfd..8e3032d3 100644 --- a/src/abg-btf-reader.cc +++ b/src/abg-btf-reader.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-comp-filter.cc b/src/abg-comp-filter.cc index 985ce260..39d34517 100644 --- a/src/abg-comp-filter.cc +++ b/src/abg-comp-filter.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-comparison-priv.h b/src/abg-comparison-priv.h index 865cd9f9..919046d9 100644 --- a/src/abg-comparison-priv.h +++ b/src/abg-comparison-priv.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2017-2025 Red Hat, Inc. +// Copyright (C) 2017-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-comparison.cc b/src/abg-comparison.cc index e7e3256e..2032b579 100644 --- a/src/abg-comparison.cc +++ b/src/abg-comparison.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-config.cc b/src/abg-config.cc index db428686..8b12e406 100644 --- a/src/abg-config.cc +++ b/src/abg-config.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/src/abg-corpus-priv.h b/src/abg-corpus-priv.h index ae1a4c19..ad1b556d 100644 --- a/src/abg-corpus-priv.h +++ b/src/abg-corpus-priv.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. /// @file /// diff --git a/src/abg-corpus.cc b/src/abg-corpus.cc index a53ae308..e112ce9c 100644 --- a/src/abg-corpus.cc +++ b/src/abg-corpus.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc index 497b2fb4..d7a6dde9 100644 --- a/src/abg-ctf-reader.cc +++ b/src/abg-ctf-reader.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2021-2025 Oracle, Inc. +// Copyright (C) 2021-2026 Oracle, Inc. // // Author: Jose E. Marchesi diff --git a/src/abg-default-reporter.cc b/src/abg-default-reporter.cc index 48ffb3b0..f19e4d36 100644 --- a/src/abg-default-reporter.cc +++ b/src/abg-default-reporter.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2017-2025 Red Hat, Inc. +// Copyright (C) 2017-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-diff-utils.cc b/src/abg-diff-utils.cc index 5073e8d1..143f0ea8 100644 --- a/src/abg-diff-utils.cc +++ b/src/abg-diff-utils.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index db09958c..719e4bc0 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-elf-based-reader.cc b/src/abg-elf-based-reader.cc index d13175dc..aa5eb53e 100644 --- a/src/abg-elf-based-reader.cc +++ b/src/abg-elf-based-reader.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-elf-helpers.cc b/src/abg-elf-helpers.cc index 7730ce05..e283b0a0 100644 --- a/src/abg-elf-helpers.cc +++ b/src/abg-elf-helpers.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. /// @file /// diff --git a/src/abg-elf-helpers.h b/src/abg-elf-helpers.h index bd6c127d..26c10465 100644 --- a/src/abg-elf-helpers.h +++ b/src/abg-elf-helpers.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. /// @file /// diff --git a/src/abg-elf-reader.cc b/src/abg-elf-reader.cc index 48618e01..00f42ee0 100644 --- a/src/abg-elf-reader.cc +++ b/src/abg-elf-reader.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-fe-iface.cc b/src/abg-fe-iface.cc index 18388dbe..3187acae 100644 --- a/src/abg-fe-iface.cc +++ b/src/abg-fe-iface.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-hash.cc b/src/abg-hash.cc index 71a3a45a..2e1d2b08 100644 --- a/src/abg-hash.cc +++ b/src/abg-hash.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/src/abg-ini.cc b/src/abg-ini.cc index 6e83e34f..e30f38ea 100644 --- a/src/abg-ini.cc +++ b/src/abg-ini.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-internal.h b/src/abg-internal.h index bf2286c2..7620a2e9 100644 --- a/src/abg-internal.h +++ b/src/abg-internal.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-ir-priv.h b/src/abg-ir-priv.h index b9e2d63e..9df9d4ca 100644 --- a/src/abg-ir-priv.h +++ b/src/abg-ir-priv.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 8ae643fd..2e9d2084 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // //Author: Dodji Seketeli diff --git a/src/abg-leaf-reporter.cc b/src/abg-leaf-reporter.cc index 6294fd4a..28fda641 100644 --- a/src/abg-leaf-reporter.cc +++ b/src/abg-leaf-reporter.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2017-2025 Red Hat, Inc. +// Copyright (C) 2017-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-libxml-utils.cc b/src/abg-libxml-utils.cc index 7cc35d8d..6d47d1bd 100644 --- a/src/abg-libxml-utils.cc +++ b/src/abg-libxml-utils.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 3ffbedc7..7faaa4f0 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file /// diff --git a/src/abg-regex.cc b/src/abg-regex.cc index 0bc8e3c1..534cef82 100644 --- a/src/abg-regex.cc +++ b/src/abg-regex.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. /// @file /// diff --git a/src/abg-reporter-priv.cc b/src/abg-reporter-priv.cc index 07533e9b..dbbe49e0 100644 --- a/src/abg-reporter-priv.cc +++ b/src/abg-reporter-priv.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2017-2025 Red Hat, Inc. +// Copyright (C) 2017-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-reporter-priv.h b/src/abg-reporter-priv.h index 018c8583..08ba6c22 100644 --- a/src/abg-reporter-priv.h +++ b/src/abg-reporter-priv.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-suppression-priv.h b/src/abg-suppression-priv.h index 47622248..8ee16c82 100644 --- a/src/abg-suppression-priv.h +++ b/src/abg-suppression-priv.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-suppression.cc b/src/abg-suppression.cc index 15785ac5..b1b5bcc7 100644 --- a/src/abg-suppression.cc +++ b/src/abg-suppression.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-symtab-reader.cc b/src/abg-symtab-reader.cc index b09655e7..ea6b9954 100644 --- a/src/abg-symtab-reader.cc +++ b/src/abg-symtab-reader.cc @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. +// Copyright (C) 2020-2026 Google, Inc. // // Author: Matthias Maennich diff --git a/src/abg-symtab-reader.h b/src/abg-symtab-reader.h index 645d5efd..02835ec2 100644 --- a/src/abg-symtab-reader.h +++ b/src/abg-symtab-reader.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. // // Author: Matthias Maennich diff --git a/src/abg-tools-utils.cc b/src/abg-tools-utils.cc index 980c3540..2dd9fed3 100644 --- a/src/abg-tools-utils.cc +++ b/src/abg-tools-utils.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. ///@file diff --git a/src/abg-traverse.cc b/src/abg-traverse.cc index d68a6dae..aaf287c0 100644 --- a/src/abg-traverse.cc +++ b/src/abg-traverse.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file diff --git a/src/abg-viz-common.cc b/src/abg-viz-common.cc index 3dfef06d..e9bd8839 100644 --- a/src/abg-viz-common.cc +++ b/src/abg-viz-common.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include #include diff --git a/src/abg-viz-dot.cc b/src/abg-viz-dot.cc index ae75aa03..6866af5a 100644 --- a/src/abg-viz-dot.cc +++ b/src/abg-viz-dot.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include #include diff --git a/src/abg-viz-svg.cc b/src/abg-viz-svg.cc index 5798934d..d4390b77 100644 --- a/src/abg-viz-svg.cc +++ b/src/abg-viz-svg.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include #include diff --git a/src/abg-workers.cc b/src/abg-workers.cc index 91a2c96f..c217540f 100644 --- a/src/abg-workers.cc +++ b/src/abg-workers.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/src/abg-writer.cc b/src/abg-writer.cc index d3f7e7bd..098ad8ac 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file /// diff --git a/tests/print-diff-tree.cc b/tests/print-diff-tree.cc index 9e638628..b34b8b3d 100644 --- a/tests/print-diff-tree.cc +++ b/tests/print-diff-tree.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-abicompat.cc b/tests/test-abicompat.cc index ca97884a..3a701a8e 100644 --- a/tests/test-abicompat.cc +++ b/tests/test-abicompat.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2014-2025 Red Hat, Inc. +// Copyright (C) 2014-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-abidiff-exit.cc b/tests/test-abidiff-exit.cc index 99368876..51805942 100644 --- a/tests/test-abidiff-exit.cc +++ b/tests/test-abidiff-exit.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2016-2025 Red Hat, Inc. +// Copyright (C) 2016-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-abidiff.cc b/tests/test-abidiff.cc index b83d492d..26c66a78 100644 --- a/tests/test-abidiff.cc +++ b/tests/test-abidiff.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-alt-dwarf-file.cc b/tests/test-alt-dwarf-file.cc index 9bf80bed..dc511f71 100644 --- a/tests/test-alt-dwarf-file.cc +++ b/tests/test-alt-dwarf-file.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-core-diff.cc b/tests/test-core-diff.cc index c3f298f4..ec908fc5 100644 --- a/tests/test-core-diff.cc +++ b/tests/test-core-diff.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-cxx-compat.cc b/tests/test-cxx-compat.cc index 5f09ec12..6859ee6d 100644 --- a/tests/test-cxx-compat.cc +++ b/tests/test-cxx-compat.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. // // Author: Matthias Maennich diff --git a/tests/test-diff-dwarf-abixml.cc b/tests/test-diff-dwarf-abixml.cc index 3e4b83a1..3f5f5ddc 100644 --- a/tests/test-diff-dwarf-abixml.cc +++ b/tests/test-diff-dwarf-abixml.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-diff-dwarf.cc b/tests/test-diff-dwarf.cc index 34b18897..ce5d8f4d 100644 --- a/tests/test-diff-dwarf.cc +++ b/tests/test-diff-dwarf.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-diff-filter.cc b/tests/test-diff-filter.cc index 0bf2eb81..4d848129 100644 --- a/tests/test-diff-filter.cc +++ b/tests/test-diff-filter.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-diff-pkg.cc b/tests/test-diff-pkg.cc index a53829d2..de3dbecd 100644 --- a/tests/test-diff-pkg.cc +++ b/tests/test-diff-pkg.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Sinny Kumari diff --git a/tests/test-diff-suppr.cc b/tests/test-diff-suppr.cc index 42ea5051..bda4be3e 100644 --- a/tests/test-diff-suppr.cc +++ b/tests/test-diff-suppr.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-diff2.cc b/tests/test-diff2.cc index 09ec77db..caeae9cf 100644 --- a/tests/test-diff2.cc +++ b/tests/test-diff2.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-dot.cc b/tests/test-dot.cc index 5bc72641..d5ff680a 100644 --- a/tests/test-dot.cc +++ b/tests/test-dot.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include "abg-viz-dot.h" diff --git a/tests/test-elf-helpers.cc b/tests/test-elf-helpers.cc index 013eaadd..70ed8cc4 100644 --- a/tests/test-elf-helpers.cc +++ b/tests/test-elf-helpers.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. // // Author: Matthias Maennich diff --git a/tests/test-ini.cc b/tests/test-ini.cc index bf1ad942..e7fc4274 100644 --- a/tests/test-ini.cc +++ b/tests/test-ini.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-ir-walker.cc b/tests/test-ir-walker.cc index 5eca6cd3..899099c0 100644 --- a/tests/test-ir-walker.cc +++ b/tests/test-ir-walker.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include #include diff --git a/tests/test-kmi-whitelist.cc b/tests/test-kmi-whitelist.cc index 3edb2397..444943d2 100644 --- a/tests/test-kmi-whitelist.cc +++ b/tests/test-kmi-whitelist.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. // // Author: Matthias Maennich diff --git a/tests/test-lookup-syms.cc b/tests/test-lookup-syms.cc index 06fd6f6d..5b966ee2 100644 --- a/tests/test-lookup-syms.cc +++ b/tests/test-lookup-syms.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-read-btf.cc b/tests/test-read-btf.cc index abadca29..ecbcd91e 100644 --- a/tests/test-read-btf.cc +++ b/tests/test-read-btf.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2022-2025 Red Hat, Inc. +// Copyright (C) 2022-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-read-ctf.cc b/tests/test-read-ctf.cc index 52e2e9c9..27c41e6e 100644 --- a/tests/test-read-ctf.cc +++ b/tests/test-read-ctf.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2021-2025 Oracle, Inc. +// Copyright (C) 2021-2026 Oracle, Inc. // // Author: Guillermo E. Martinez diff --git a/tests/test-read-dwarf.cc b/tests/test-read-dwarf.cc index 8703496f..046859cf 100644 --- a/tests/test-read-dwarf.cc +++ b/tests/test-read-dwarf.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-read-write.cc b/tests/test-read-write.cc index 799a2643..189ed44c 100644 --- a/tests/test-read-write.cc +++ b/tests/test-read-write.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file read an XML corpus file (in the native Abigail XML format), /// save it back and diff the resulting XML file against the input diff --git a/tests/test-svg.cc b/tests/test-svg.cc index 172a4246..b6f56abc 100644 --- a/tests/test-svg.cc +++ b/tests/test-svg.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include "abg-viz-svg.h" diff --git a/tests/test-symtab-reader.cc b/tests/test-symtab-reader.cc index 7bfeb28a..7bd4af1d 100644 --- a/tests/test-symtab-reader.cc +++ b/tests/test-symtab-reader.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. // // Author: Matthias Maennich diff --git a/tests/test-symtab.cc b/tests/test-symtab.cc index 135c0310..f5bb3f86 100644 --- a/tests/test-symtab.cc +++ b/tests/test-symtab.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2020-2025 Google, Inc. +// Copyright (C) 2020-2026 Google, Inc. // // Author: Matthias Maennich diff --git a/tests/test-tools-utils.cc b/tests/test-tools-utils.cc index 38ce9c88..1fc745a4 100644 --- a/tests/test-tools-utils.cc +++ b/tests/test-tools-utils.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. /// @file /// diff --git a/tests/test-types-stability.cc b/tests/test-types-stability.cc index 1954d0f2..354c9b16 100644 --- a/tests/test-types-stability.cc +++ b/tests/test-types-stability.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tests/test-utils.cc b/tests/test-utils.cc index 4ebf59f1..64ae3074 100644 --- a/tests/test-utils.cc +++ b/tests/test-utils.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #include #include "test-utils.h" diff --git a/tests/test-utils.h b/tests/test-utils.h index 5b980b02..04228100 100644 --- a/tests/test-utils.h +++ b/tests/test-utils.h @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. #ifndef __TEST_UTILS_H__ #define __TEST_UTILS_H__ diff --git a/tools/abicompat.cc b/tools/abicompat.cc index 820ea129..3b7e511d 100644 --- a/tools/abicompat.cc +++ b/tools/abicompat.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2014-2025 Red Hat, Inc. +// Copyright (C) 2014-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tools/abidiff.cc b/tools/abidiff.cc index 56c2966a..7ad4d650 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tools/abidw.cc b/tools/abidw.cc index 652e2956..4cc60f84 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tools/abilint.cc b/tools/abilint.cc index 55014328..22ac20ae 100644 --- a/tools/abilint.cc +++ b/tools/abilint.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index 61573f89..3bb90dfb 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2015-2025 Red Hat, Inc. +// Copyright (C) 2015-2026 Red Hat, Inc. // // Author: Sinny Kumari diff --git a/tools/abisym.cc b/tools/abisym.cc index 8c5f3d2b..9b37ca1a 100644 --- a/tools/abisym.cc +++ b/tools/abisym.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tools/binilint.cc b/tools/binilint.cc index fa01ed99..c410256e 100644 --- a/tools/binilint.cc +++ b/tools/binilint.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2013-2025 Red Hat, Inc. +// Copyright (C) 2013-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/tools/kmidiff.cc b/tools/kmidiff.cc index 1490c720..1fa524f6 100644 --- a/tools/kmidiff.cc +++ b/tools/kmidiff.cc @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -*- Mode: C++ -*- // -// Copyright (C) 2017-2025 Red Hat, Inc. +// Copyright (C) 2017-2026 Red Hat, Inc. // // Author: Dodji Seketeli diff --git a/update-copyright.sh b/update-copyright.sh index 366cb9de..c4874816 100644 --- a/update-copyright.sh +++ b/update-copyright.sh @@ -1,8 +1,8 @@ #!/bin/sh # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -oldyear=2024 -newyear=2025 +oldyear=2025 +newyear=2026 for dir in src include tools tests; do for ext in cc h; do From patchwork Thu Jul 30 18:17:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140289 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6178C4BBC0D6 for ; Thu, 30 Jul 2026 18:17:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6178C4BBC0D6 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by sourceware.org (Postfix) with ESMTPS id AC9AB4BB8F4A for ; Thu, 30 Jul 2026 18:17:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AC9AB4BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AC9AB4BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435470; cv=none; b=UBLIW6wwbqJUJEJ3sDfr6C5aTE/4/Yv9xSy4Of5/8S6aUuuquypvYsfeJlfBn5JMY34PtTUBfSUnmg/Y/bwwHMTpHx9x4iOGWInKg9sVUkGqabIia85JDZ7tJCEtwuPjYB5HukU6QSz2hopVZFwpQo0SsnizgYEQx9klAStnLVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435470; c=relaxed/simple; bh=0CZITu83PRT3To6cNs33ZQltY7YGOY7+VyO36Uzq9Sg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=rv6HVvN4fb4MQgupepayo98W8eX4IQe6stmMPjJK/6dIFsRwhlxU4Wbt98IsXhy9TE6vqI+zf8Qoe5ilclK/kV/g50gmk+WvN3QKOQl0VxJDNMKngIZZ+7MIXiBuwc3kvXAtq4ZfpzB7jm5sirb0gzN3dUrZf0rF/i9GaxpF5J8= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC9AB4BB8F4A Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-49557167508so682535e9.1 for ; Thu, 30 Jul 2026 11:17:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435469; x=1786040269; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=obOTgOLUmv2wPBQz8MphW/2ffoSBBuUYCh85KcwPlwM=; b=DITqUcVv0gWpLcdRw0BE7bxFjdM50FGdohH6wcnJMK6cssPhqp5XNz+ls1kng7ddmw 6es8DRmILlbVZKkYQv2ZzlDc+p1T0A4YLlslAz0e44V/umx8KMtbYzjW4V+0KrFp7dPB MoCShaZtRxT8k/IymhKvWJ2Qa/XgnMf3uXEsnkUs/y52f8FB7TsvwyuKKR19iP7qtYA/ V9GiN/wdIe0SpgfGbW9Jxr7Lj8V8EVuFK6s4R1uB/PEEwQpfoCno4LL3MfShLuuYrhKz YsZH0gwVj7MpnWC3bnrl7TFN0ZrGxk/RYPHPJTR6hlSood0KkMML44nGO9kEphcXwx5Z tyKw== X-Gm-Message-State: AOJu0YzvkCTBxzWnODsjcQldGW/SfenP89Dd0RyycXJxvPmvA8PGY9sg 1ZIaF9fR4QfMIIoopT6qxYixyV4FQVVp4QdOgcOE/m2HTs9C1pDLPFUGv0kx6lRm X-Gm-Gg: AR+sD10Bm0J1+TSf+i4Am/NCXG9bzwHRsEXjnHuR4LtQEWQWdi8ZqeCDWJUWMf8r4Ig QZP8EC/iVkaDFiy+NGSBLuzN+3qpwTNgLxSaRnulNy96Wf7xj4XxeocNjoDXNYhm5G7jlAZ+iTI UXlCn14qD3mmQl5zg6VsOTkEAF8Es+/wcY+NjAi2b7cPIcGrcKwjZ8DgZf4k9aCcNrmU5K7Y97J PmsYNfR7Me9ygjEpij/Ub2UA2rCgaHOyzwGJ322P4OXGIS//wwpWZAipXNCJQ+1IzhsqLFYLLL4 mHMPxazTsRCeqjK1nLhUop90U1zPDhJnw9sbTsQYAxEynOiMzB03au9Bp5KG10Q8Sma5Utu4usv QgTf27z0NZo/vAOQRKRHJdHaU6u8rk/2CQso412ZzNFWDa3c5+Ue335xSLLn5w4OwY3xkUiW5i6 trWovDOOSP3VqkJ1mWN62a3Mtrw1/pv9KShCTjAgu4w40y2zmKdH8Uk719ztftAH+fnvq0YY4rJ U3+3PLCgmRYQVf6xpVtfhVVOTQyiXfDQj2TaHeLGqA= X-Received: by 2002:a05:600c:8b26:b0:496:c06b:9fb4 with SMTP id 5b1f17b1804b1-49800e93e81mr50409475e9.14.1785435469538; Thu, 30 Jul 2026 11:17:49 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-498011fd5fesm71735665e9.7.2026.07.30.11.17.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:17:48 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 3956C601E7FD; Thu, 30 Jul 2026 20:17:48 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 5/9] tools/abilint: Fix --annotate when reading free form translation units Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:17:48 +0200 Message-ID: <877bmcpcj7.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, It turned out "abilint --annotate" does not annotate the emitted ABIXML if it is a free-form translation unit rather than a full-blown ABI corpus. Fixed thus. * tools/abilint.cc (main): When reading free form translation units, call set_annotate on the write context before calling write_translation_unit, so that the --annotate option is properly honoured. Signed-off-by: Dodji Seketeli Applied to the master branch. --- tools/abilint.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/abilint.cc b/tools/abilint.cc index 22ac20ae..811d72e7 100644 --- a/tools/abilint.cc +++ b/tools/abilint.cc @@ -893,7 +893,10 @@ main(int argc, char* argv[]) if (tu) { if (!opts.noout) - is_ok = write_translation_unit(*ctxt, *tu, 0); + { + set_annotate(*ctxt, opts.annotate); + is_ok = write_translation_unit(*ctxt, *tu, 0); + } } else { From patchwork Thu Jul 30 18:18:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140290 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F73E4BBC0E9 for ; Thu, 30 Jul 2026 18:19:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F73E4BBC0E9 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by sourceware.org (Postfix) with ESMTPS id BC0BB4BB8F4A for ; Thu, 30 Jul 2026 18:18:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC0BB4BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BC0BB4BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435534; cv=none; b=L3YRiDyz0aWSfXKFTUZJT7H/H6B8joH0s+3SBPOnVFUwoW9d9zy+s5+PbQImfIszP5tgrr4cW02k8AIi7zECdUIMt6gT1OXaJVr2Lpys3SWrHg2BWvxowUDiuNHU2EfbF0Q5z36dF2hIK0+65vzZ05CwlubALt8LJDQE6yWATIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435534; c=relaxed/simple; bh=SH/px/zQ8KuYeELHGxgUWiwaqNWbkZjBezycLzF+IcI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=CI6QN4Lq5XI3uxmfiRhRxWSRBr6nddIW5NvX/bWWKLbcuVatgcICBK54n2n4o1czGeCMRWq93KMbbGckZ6imktL2M0Mxu4+XtvJnFf6hbDl5mRhriEBQPPAJKlzW6afytapN84a9ifi2FT+xWiyc81Uk2z5kXzrxRrEeCNoUmm4= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC0BB4BB8F4A Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-47c2b362ee2so17675f8f.1 for ; Thu, 30 Jul 2026 11:18:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435533; x=1786040333; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bORmjbekmsh0FgsIURCDsf4+gYbUnISd1BJc9WWUgsM=; b=cDfCV3QmtAE1xYkwdTdJLux4bWT2cXocAcggwK83L5vahX4F8IBISQkQOLYcYx5SEa aZVymLmtNjudoSgV+0jt8SEqHhOKG+f8wBAey8N948irfuGjx+n55YTKvpaHKSelqHCd XbutNhQZzf1fIPpm5oN30Y7TXblNCGzJDE0Uv1l23Z6ue7suUOFFLDhljUk6nCleol7Y oFR4m13xCJp8mMsMsugph2LvfBm2fbEZUlhdOiUHfUDvdYQj/TttuQKI0bxfw+cJ7eVY ioQqiiuhXMToSLQMTESkIjSgVQQLeYqRYR7IbcfDS1Q969KtPp4VgpaX8vd0CWjMhcF8 OeKQ== X-Gm-Message-State: AOJu0YxdzZZh2o69szObTknCGYMAbmwjfT7Y90+Yhop3upauJTmcXuI0 AfvVtiGiuoqV2Eli/5BVgZFF5ARRqxA+7UTJdAkj/y1ckpAz4zLGAOoxhsYMTdUi X-Gm-Gg: AR+sD12RyHS0kkFIsx7IT056dCqrv1otyYAIOMOWCGNjqpmvno0qNmBNIIJGnUS9wa4 647qDPiGdhTXjnKbUAG7/m2TmmME/AuzLaGbcXng2r8/7NOxeljg3dRyJnWgX6J4sWopIKpLX/s PVNZVsyeTLnDMIYLiXJtViWoJdn7EnEEmnc8e6+5zviect1C34XC8zaX0ngziq45hm12jJ8UO7s DOPtCJswOjE6PHTFCQ3uS+OesTE3EW+uLVCX9+JW28bXDfX6VVRGW0ZuD0m79MmzLJiBWYhm6W4 EW7P9/Mgj1l0jksVFmVFOv3h1HxNqoSJUM+5AwD3PldieaCEYqLbtPJs41Ky5P07DZ6usloWlwD 8dvbQ0Deq6v/ApAuLXh0/+7/tJypEjPi55/bu+mxbHUYC8zaSfcTGXRgtbIL9YzzEgXk2c0aSrZ hvsNoJ/C+y/nng+gKYyLStqDth2uYNSlgfN/as01G6Mneh4VyNuX9C5P2NDnDEqHRNzPdXkc8SX tZfoh8dYnAatYYpqcn1b2/L9t7xeqgP/jBz3x7aq6I= X-Received: by 2002:a05:6000:2911:b0:47f:7005:285e with SMTP id ffacd0b85a97d-47fc820c165mr5576796f8f.53.1785435532575; Thu, 30 Jul 2026 11:18:52 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fc892cc49sm8224756f8f.17.2026.07.30.11.18.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:18:51 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 48074601E7FD; Thu, 30 Jul 2026 20:18:51 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 6/9] abi{lint,diff}: Fix build configured with --enable-show-type-use-in-abilint Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:18:51 +0200 Message-ID: <8733x0pchg.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, For some reason, building with --enable-show-type-use-in-abilint has been broken for a while. This patch fixes that. * include/abg-reader.h (reader): Forward declare the class. (reader_sptr): Declare typedef for shared_ptr. (is_reader): Declare new function. * src/abg-reader.cc (reader): Remove duplicate forward declarations. (reader::m_types_map): Make it public, by removing the erroneous 'private:' label before it. (is_reader): Define new function to convert a fe_iface_sptr to an abixml::reader_sptr. (reader_sptr): Remove the now redundant typedef. (consider_types_not_reachable_from_public_interfaces): Reformat. (get_types_from_type_id): Use reader& instead of xml_reader::reader& in the dynamic_cast. (get_artifact_used_by_relation_map): Likewise. * tools/abidiff.cc (set_native_xml_reader_options): Reformat call to consider_types_not_reachable_from_public_interfaces. * tools/abilint.cc (build_type_use_tree): Take an abigail::fe_iface& instead of an abigail::abixml::reader&. Adjust calls to get_types_from_type_id and get_artifact_used_by_relation_map accordingly. (show_how_type_is_used): Take an abigail::fe_iface& instead of an abigail::abixml::reader&. Adjust call to build_type_use_tree accordingly. (main): Declare rdr as abigail::fe_iface_sptr outside the switch statement so it's accessible in the WITH_SHOW_TYPE_USE_IN_ABILINT section. Use it in place of abixml_read_ctxt when calling show_how_type_is_used. Signed-off-by: Dodji Seketeli Applied to the master branch. --- include/abg-reader.h | 6 ++++++ src/abg-reader.cc | 25 +++++++++++++------------ tools/abidiff.cc | 3 +-- tools/abilint.cc | 30 +++++++++++++----------------- 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/include/abg-reader.h b/include/abg-reader.h index 6cc67657..cfaf13ca 100644 --- a/include/abg-reader.h +++ b/include/abg-reader.h @@ -71,6 +71,12 @@ void consider_types_not_reachable_from_public_interfaces(fe_iface& ctxt, bool flag); +class reader; +typedef shared_ptr reader_sptr; + +reader_sptr +is_reader(fe_iface_sptr); + #ifdef WITH_SHOW_TYPE_USE_IN_ABILINT vector* get_types_from_type_id(fe_iface&, const string&); diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 7faaa4f0..c550b018 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -62,8 +62,6 @@ using std::istream; /// strings. typedef unordered_map> string_strings_map_type; -class reader; - static bool read_is_declaration_only(xmlNodePtr, bool&); static bool read_is_artificial(xmlNodePtr, bool&); static bool read_tracking_non_reachable_types(xmlNodePtr, bool&); @@ -85,8 +83,6 @@ static bool maybe_map_type_with_type_id(const type_base_sptr&, static void maybe_set_naming_typedef(reader& rdr, xmlNodePtr, const decl_base_sptr &); -class reader; - static int advance_cursor(reader& rdr); static void @@ -165,7 +161,6 @@ public: friend unordered_map>* get_artifact_used_by_relation_map(reader& rdr); -private: types_map_type m_types_map; unordered_map > m_fn_tmpl_map; unordered_map > m_class_tmpl_map; @@ -1471,7 +1466,14 @@ public: } };// end class reader -typedef shared_ptr reader_sptr; +/// Convert a @ref abigail:fe_iface into an abigail::abixml::reader. +/// +/// @param f the interface to convert. +/// +/// @return the resulting abigail::abixml::reader. +reader_sptr +is_reader(fe_iface_sptr iface) +{return dynamic_pointer_cast(iface);} static int advance_cursor(reader&); static bool read_translation_unit(fe_iface&, translation_unit&, xmlNodePtr); @@ -2291,8 +2293,7 @@ add_reader_suppressions(reader& rdr, /// @param flag if yes, then types not reachable from public interface /// are taken into account when the abixml file is read. void -consider_types_not_reachable_from_public_interfaces(fe_iface& iface, - bool flag) +consider_types_not_reachable_from_public_interfaces(fe_iface& iface, bool flag) { abixml::reader& rdr = dynamic_cast(iface); rdr.tracking_non_reachable_types(flag); @@ -2304,13 +2305,13 @@ consider_types_not_reachable_from_public_interfaces(fe_iface& iface, /// This function is available only if the project has been configured /// with --enable-show-type-use-in-abilint. /// -/// @param rdr the abixml text reader context to use. +/// @param rdr the abixml reader to use. /// /// @param type_id the type-id to consider. vector* get_types_from_type_id(fe_iface& iface, const string& type_id) { - xml_reader::reader& rdr = dynamic_cast(iface); + reader& rdr = dynamic_cast(iface); auto it = rdr.m_types_map.find(type_id); if (it == rdr.m_types_map.end()) return nullptr; @@ -2326,7 +2327,7 @@ get_types_from_type_id(fe_iface& iface, const string& type_id) unordered_map>* get_artifact_used_by_relation_map(fe_iface& iface) { - xml_reader::reader& rdr = dynamic_cast(iface); + reader& rdr = dynamic_cast(iface); return &rdr.m_artifact_used_by_map; } #endif @@ -6959,7 +6960,7 @@ struct array_deleter };//end array_deleter -/// Create an xml_reader::reader to read a native XML ABI file. +/// Create an abixml::reader to read a native XML ABI file. /// /// @param path the path to the native XML file to read. /// diff --git a/tools/abidiff.cc b/tools/abidiff.cc index 7ad4d650..f9c98b01 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -1026,8 +1026,7 @@ static void set_native_xml_reader_options(abigail::fe_iface& rdr, const options& opts) { - abixml::consider_types_not_reachable_from_public_interfaces(rdr, - opts.show_all_types); + abixml::consider_types_not_reachable_from_public_interfaces(rdr, opts.show_all_types); rdr.options().do_log = opts.do_log; } diff --git a/tools/abilint.cc b/tools/abilint.cc index 811d72e7..4799d429 100644 --- a/tools/abilint.cc +++ b/tools/abilint.cc @@ -306,16 +306,16 @@ fill_artifact_use_tree(const std::unordered_map -build_type_use_tree(abigail::abixml::reader &ctxt, +build_type_use_tree(abigail::fe_iface &iface, const string& type_id) { unique_ptr result; - vector* types = get_types_from_type_id(ctxt, type_id); + vector* types = get_types_from_type_id(iface, type_id); if (!types) return result; std::unordered_map>* - artifact_use_rel = get_artifact_used_by_relation_map(ctxt); + artifact_use_rel = get_artifact_used_by_relation_map(iface); if (!artifact_use_rel) return result; @@ -452,18 +452,17 @@ emit_artifact_use_trace(const artifact_use_relation_tree& artifact_use_tree, /// The type to consider is designated by a type-id string that is /// carried by the options data structure. /// -/// @param ctxt the abixml read context to consider. +/// @param iface the abixml reader interface to consider. /// /// @param the type_id of the type which usage to analyse. static bool -show_how_type_is_used(abigail::abixml::reader &ctxt, - const string& type_id) +show_how_type_is_used(abigail::fe_iface &iface, const string& type_id) { if (type_id.empty()) return false; unique_ptr use_tree = - build_type_use_tree(ctxt, type_id); + build_type_use_tree(iface, type_id); if (!use_tree) return false; @@ -780,6 +779,7 @@ main(int argc, char* argv[]) abigail::fe_iface::status s = abigail::fe_iface::STATUS_OK; string di_root_path; file_type type = guess_file_type(opts.file_path); + abigail::fe_iface_sptr rdr; switch (type) { @@ -790,9 +790,8 @@ main(int argc, char* argv[]) return 1; case abigail::tools_utils::FILE_TYPE_NATIVE_BI: { - abigail::fe_iface_sptr rdr = - abigail::abixml::create_reader(opts.file_path, - env); + rdr = abigail::abixml::create_reader(opts.file_path, + env); set_reader_options(*rdr, opts); tu = abigail::abixml::read_translation_unit(*rdr); } @@ -803,7 +802,6 @@ main(int argc, char* argv[]) di_root_path = opts.di_root_path; vector di_roots; di_roots.push_back(di_root_path); - abigail::elf_based_reader_sptr rdr; #ifdef WITH_CTF if (opts.use_ctf) rdr = @@ -821,8 +819,7 @@ main(int argc, char* argv[]) break; case abigail::tools_utils::FILE_TYPE_XML_CORPUS: { - abigail::fe_iface_sptr rdr = - abigail::abixml::create_reader(opts.file_path, env); + rdr = abigail::abixml::create_reader(opts.file_path, env); assert(rdr); set_reader_options(*rdr, opts); corp = rdr->read_corpus(s); @@ -830,8 +827,7 @@ main(int argc, char* argv[]) } case abigail::tools_utils::FILE_TYPE_XML_CORPUS_GROUP: { - abigail::fe_iface_sptr rdr = - abigail::abixml::create_reader(opts.file_path, env); + rdr = abigail::abixml::create_reader(opts.file_path, env); assert(rdr); set_reader_options(*rdr, opts); group = read_corpus_group_from_input(*rdr); @@ -941,8 +937,8 @@ main(int argc, char* argv[]) if (is_ok && !opts.type_id_to_show.empty()) { - ABG_ASSERT(abixml_read_ctxt); - show_how_type_is_used(*abixml_read_ctxt, opts.type_id_to_show); + ABG_ASSERT(rdr); + show_how_type_is_used(*rdr, opts.type_id_to_show); } #endif return is_ok ? 0 : 1; From patchwork Thu Jul 30 18:19:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140291 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 32A6B4BBCDA6 for ; Thu, 30 Jul 2026 18:19:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32A6B4BBCDA6 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by sourceware.org (Postfix) with ESMTPS id C21134BB8F4A for ; Thu, 30 Jul 2026 18:19:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C21134BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C21134BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435591; cv=none; b=XpB7KiS45KwrmkAK7f53kIRdruykjLZSMbTOZUnf85oaXzj1hBCLtzW35xI7O+14DXvCekbndFRdHeVUWaHpR/1wRgfXzRLygHrhaXyFwT66fEYb2GYMGasjeXI9G1szu39eqj5fuR3tpoQdjv9A271fUP2pFz2U4h/9CVOT92c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435591; c=relaxed/simple; bh=ZUzQzHY2ldQ8v4hMjGY+ixq/3KxORjG/HD9AaFNTfu4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=WRV55jsE556qEN7vUt7JsPqdyJq9egaseXhNjJ1S63pvjDc4I0WFNnf+mUTOyeufvhOZqiq+wMGTcvZd53PVZ6GuY29Tv+Y/fUZbyfrBs9y9Tos3YpZMzegYTl+rfDoohTj2/31ldwCISFRynLQNStP/juPzDr6IkqTsUhUrQfU= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C21134BB8F4A Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4921eed3fa2so661425e9.0 for ; Thu, 30 Jul 2026 11:19:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435590; x=1786040390; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=vBP8LH+JArmotd3WJz7ew/8U2PBg6UW/8xIwVLvpjZQ=; b=epuHY49R8cErgz3PpBeHzyNepFXGpHxXh4rkmZeiBzqrtx5Zul0uon+vYwZfZ2M3dJ MUkHH8tg9Fx4oLyKa0JWr6x3VA+M24VvFXRJeqUE1NsYu8sTsIpPmtfGVDGzR6ZHi/4D BtIEo+5lbD57XLxVRGMqgjlsHFJ6Pys9JJ+LHhBdyWpFF8ijul4MApXhULNtob68hn+h qb1FyQ3HuXxD1lpWil4xjSzreXeoTNX4HoO9EVs+AWfBl0r4j/LqVLZz4ATwh6afnDph yq+jCA8DuJQc6pk2OmqQvAVedtkXZD8f8HKtK2J8e6JusZS/2cVJKdgHnN+MiON8TZ2c Dfjw== X-Gm-Message-State: AOJu0YzSlY6b/sIeKn9E1Y7WcuU0hibmFhvFXEjvcWiGM5k6TboSr7D0 RtVvBIanpsFATKw5/8Q2VIMc9kswxcC5owrNAaE1vzGu3wVyBniFRfGITLWvEgs+ X-Gm-Gg: AR+sD11lYeqnMMowvbo13ZIyxe3ogGn6svpygVh6AogAcNqBqW7X/Eld6v3N+381yHv Jcy26ntG4udjoJfXiOcORdwOUZx7y59i73eNLiu4nP5C6s79uYY0VBCyTBWnKR4E5xaQUjIfUGj gUaIaOxOFpOiTWYIQM5kSMF6teytja2/HLTTjMMl7XKXfkyid2s+2pVUHVf/0ospHbQ/Elu3hMT fpXY3N304Y3EeECPQCuSDrxLdmrmg/f2tt+oDtnT24EzfVQL/AtxpkZXWdIbCqz7mRPTnlUygyL 0HpiVns0zIq4krMhv7+4+sf1IiEUIss98h66C/NgPmdybsHspmV5UFcsDO65Y5O/R1EYuqKKs6Q 6MX5+P8K0yiooYW3MZyhWWCzTVeIXK5fqZ+0qdFZX0Ke8ohfGaTs2mgzpXOgw28N2Yme0fL5ZSn Cv0Uc+c7Vut38L4I5rYoWOKRo2+usgn5rL24BhOjbqO534SA81dUcmWfgzQOXqCbjVW6NMfKaOp upoHZayvRBiCpaWNc8+kYyPAABn7gu5A/u1nOOxVvk= X-Received: by 2002:a05:600c:500d:b0:495:4e17:cad5 with SMTP id 5b1f17b1804b1-49800eac18amr54084525e9.26.1785435589680; Thu, 30 Jul 2026 11:19:49 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fc894c994sm8384533f8f.37.2026.07.30.11.19.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:19:49 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 8CA2E601E7FD; Thu, 30 Jul 2026 20:19:48 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 7/9] abidiff: Fix a thinko Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:19:48 +0200 Message-ID: <87y0esnxvf.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, This one fixes an unfortunate thinko. * tools/abidiff.cc (main): Add the proper ABI corpus to the proper corpus group. Signed-off-by: Dodji Seketeli Applied to the master branch. --- tools/abidiff.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/abidiff.cc b/tools/abidiff.cc index f9c98b01..f263f755 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -1575,7 +1575,7 @@ main(int argc, char* argv[]) // it. g2.reset(new corpus_group(c2->get_environment(), c2->get_path())); - g2->add_corpus(c1); + g2->add_corpus(c2); } } From patchwork Thu Jul 30 18:21:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140292 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24EA94BB8F71 for ; Thu, 30 Jul 2026 18:21:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24EA94BB8F71 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by sourceware.org (Postfix) with ESMTPS id 114EF4BB8F4A for ; Thu, 30 Jul 2026 18:21:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 114EF4BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 114EF4BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435684; cv=none; b=bYQwuNUiyH+FxtwWONchn7NPxgkZYmerY05GcOc1MjlLZgKtb7Xr7njumMgw4X26pDyRtt0UcZBEs/NXK5kWeOAQSaPTVNLRrWQHoN8+WKfsIldIVDJSMLOPKLkqO25TxdP/rSO4VdQEqwA9CJsaSi6eYB5bn5HmKWkX0p/Hnww= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435684; c=relaxed/simple; bh=0BwZlIDW9ltOcq5aaWGjUtQqf1ayWQwpvygdqd03zks=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=fTtmYdj0vt24UXcUjcja2OfsiYDleP+uQa+DdmEPEe7lTRAvp4LHgvh9MaenWBPKtBagjm8/bizZ/7GUll4k3lCSVP6gEarF2Em5BXWxNfjtifKf2gjG4i/QauueIge4WeK4A8z7u3OXap+zO9VuyXF2rfa4mS0YwKSwCNU1ljc= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 114EF4BB8F4A Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-49557167508so708795e9.1 for ; Thu, 30 Jul 2026 11:21:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435683; x=1786040483; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=8vPr8sKqH5dVGT6OwCXhcEG/ltlqLLVwmsk7YuirUOs=; b=VME5rlmnx7av2hFDI8u9kGec6B0UXW9B1N0Svy7zqVl6+NqIK5dSAMQlUgJAcMBv7g wFrzCsC/MGdOvWpDAeryy54+nsiO6rrkjlKGdT9ayMwxP8ahIwcBWy1zv5xXHecD5fzS 95EdScXURvfHtiiS98GH2YEfYAmrpyd5RqrbizKCjrwyTRk0sNVtMV1r9Y19n6VS5KCV kbGpjt8mpMckRTT+y8BiQtcLtlzqB7QN2vpZakUVDETeTHsHIOJCTawOUFdr4QRRGWJN 9MWvOHJX9++cBlrTKgy/pEhvf2JYjiX44eh8EjCSnWrJeU3osUaP9xTK0j48osRfrMui 28fw== X-Gm-Message-State: AOJu0YzsOmJ5gp++V7PTG9/qoR+wqVyFVhCUTkyiICUfdwBKb//IyzFy xruX4CJwC+iocc+6JrYYxLrsz+EUDxO2/Vz+GyeLZzYR9bXzWY+fjxOU6Bc4fPv+ X-Gm-Gg: AR+sD10b9goQcNQPoKTq5+A6weVHIlzSlnykrMcdCn1/sXu8cvYOfZZ2vw+64q8ErS6 W3IwY2vnB/e1l0hF501HeOu7ElMa3gu2vQ7QsJsGPbIDhEGTghU3ZEOtI9YSovPxJYxsiZIsZCB F0GbyntWPY7SqWyYYuJ7d3wUl4IBhm/qjBCTs3qmSB9SLaR99vPLJrS6fIXcwG0GsAVoBa7peqm hgijcX8djEjYWi9RXffuHRIe5dIyOTyJm3L2LFte12YlpPd348lrIsV+GUzf+QEDor5fGxLKlGV vNBH78ET4vFozE5x9mwtdoG2lzYeNPimsDm1RfvWERl9Ww7zb/FYwHstyXd68Xj1RKaEKUZ1p+D cXYruFT1jceZYplGkS8gm6MrwZYdWIroUXqffEtQARE+Ly73vu+IYM2pmprfKzY/ulj7SDMKfNs u+RPJj8qphKQmL0KIO9cBOh+Ji1eQ53Jay28muSAO5d1HFec1eXAGpTGguHZ8kAh9x+jVjb0SYF 8vm0HzNiZnrX4UXYLCEQIgpXd4yeZzMQzSRUDywo7o= X-Received: by 2002:a05:600c:e557:10b0:493:f140:c3fb with SMTP id 5b1f17b1804b1-49800e898e4mr38807215e9.7.1785435682834; Thu, 30 Jul 2026 11:21:22 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49800ebd7a7sm67290495e9.0.2026.07.30.11.21.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:21:22 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 94EA3601E7FD; Thu, 30 Jul 2026 20:21:21 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 8/9] tools/abicompat: Fix a thinko Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:21:21 +0200 Message-ID: <87tspgnxsu.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, This one fixes a thinko that is a remnant of a previous re-factoring. * tools/abicompat.cc (read_corpus): Do not wrongly pass the status as last parameter to create_best_elf_based_reader. Signed-off-by: Dodji Seketeli Applied to the master branch. --- tools/abicompat.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/abicompat.cc b/tools/abicompat.cc index 3b7e511d..cb6bfffe 100644 --- a/tools/abicompat.cc +++ b/tools/abicompat.cc @@ -872,9 +872,8 @@ read_corpus(options opts, requested_fe_kind = corpus::BTF_ORIGIN; #endif - rdr = create_best_elf_based_reader (path, di_roots, env, requested_fe_kind, - /*load_all_types=*/opts.weak_mode, - status); + rdr = create_best_elf_based_reader(path, di_roots, env, requested_fe_kind, + /*load_all_types=*/opts.weak_mode); ABG_ASSERT(rdr); rdr->options().load_undefined_interfaces = true; retval = rdr->read_corpus(status); From patchwork Thu Jul 30 18:22:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 140293 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C7074BBC0E9 for ; Thu, 30 Jul 2026 18:22:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C7074BBC0E9 X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by sourceware.org (Postfix) with ESMTPS id 319274BB8F4A for ; Thu, 30 Jul 2026 18:22:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 319274BB8F4A Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=seketeli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 319274BB8F4A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435735; cv=none; b=IveoSh0j06yJsdXCPsvLcx73UTfS9nIidM2PqWvsjs8UO5dV5eIa/0PUEgUphZZPQ1AK2wcNoEM0MMoaGX0dhhNxkdbI3SXYMtMGtVhBCHzJf7VsTx/5OPvYEsWkZtQ2dnpk0nNzA2uWAsWKIatjagXED5kGMuoosh/RVp8aujw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785435735; c=relaxed/simple; bh=pgJsEorY8glKpIJye7gIvVabqPPDtwyg3zEDPlHNS/I=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=XaWMbZvJv1YYzCYOPU1O5CesBICqf38G2Zmcqu6agIfymGP30RC6M+wfMywtjtJUI1FmPhfyBGRIXe4GjtBmV2QbRHOcQQUBuoA0Vgu5/rR4KzE6YlOjJOdh/WwkWi3QBrnyy8JdZu7v4XyCDWMVfUcA30WE4OStUw+H4v4eh6E= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 319274BB8F4A Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4954df200ddso672145e9.0 for ; Thu, 30 Jul 2026 11:22:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785435734; x=1786040534; h=content-type:mime-version:user-agent:message-id:date:organization :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pz0SxRk2V5J19s4Z7HX1aL5XA++dSPrFT002B/Dw7hg=; b=pPQl2kS1OjGLDfHo9wsTGbS4OL5+Ek+gudLtd2AYdPnxLVR9uxsxQ+RJJ9BeW3uea6 VuZ4JytDmiM3rYV/2iKN6uLSKCfBuy8b8nO5BP7OdtHfb5Yrq8Y+0p6KjNS/wepTKO5n BI35Ic2tLSHBJATnyFIyjV4tUJrsk9y0ZmMeciOyMT/Hj9A+CFCLbvLvVBjKBorMoayi 32z+IlGrifvt7h26afIOi+ppLaLMLjKwwcLD4indvsCNOcxf0tUjNv31w9jIu39Cq+Yv mwZJo6UOithLpvHayHr4/QRzBV1F+prkwAd6rEqbLyAj+v0BFVDwh6bWBBhaTEBkqSID MGLg== X-Gm-Message-State: AOJu0Yz8lY0YY60cIoUgeIfIgNpdGhUuC4X8PPs9A+etZJYeoXNACiXK f22r0XHHVAS0PseKQIxnnPT6NG1YLopn7q9aERPg049cRgEsgtLQ1kIY/bIwemLA X-Gm-Gg: AR+sD10lexHKfoz8TLNnpq6QjU+KSlVxsLZFphcHwnRGeliceOli0PycPimunS7kIQI 1H/ZORrKDJ/lUSqw4CmH1nevT9QhkmQvkHcfRw6T3iqFXVrkXDcHiIm9prq14K6h3bZIvxwIBLa ANVsaoNYbZ+lI6ZNkUOMdtVNBDvFy/AvxsUN0IySERSNxW2sP7VJL9FAl7/9FGW1Ip6Lf1nDGi6 BfAXKptmVDWY3Ls+RQdTdeLZRYLhTvd6GyTk7KarwUdT+VwO/9PrNvkytfTJjbfP7RXbzc7xi1C OuoWTvQqFfidIGd1siKooVTHkXNopzMAzuo0d9CP2MmQiPcawFhmdMozZXRqFJtTNgeC0wTBDqC /qOC3V/7Vn2l7PWNdTxLYuNqHzsjzXpx9c0L8UntfFscVzBF3KTflUDC+ymJ9Ayc1RpENjg0Q0K FF4k4Aq+wHDHm11FqudBU5vZ6B99VHX6WeNmEWnkDHPPElVsF5vfLdj54JSMqYfAbb4BRK//e+k 6veuNBF0DoswfA27BerYdcs8yV2XP3FTNNzB0fs7LwfUU6OT1hKBg== X-Received: by 2002:a05:600c:45d5:b0:497:ffd4:ee3e with SMTP id 5b1f17b1804b1-49800ea001bmr53412225e9.20.1785435733072; Thu, 30 Jul 2026 11:22:13 -0700 (PDT) Received: from localhost ([82.67.74.110]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-498056625c4sm2611345e9.3.2026.07.30.11.22.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 11:22:12 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id 88C6E601E7FD; Thu, 30 Jul 2026 20:22:11 +0200 (CEST) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH 9/9] tools: switch to argp for command-line parsing Organization: Me, myself and I X-Operating-System: Fedora 45 X-URL: http://www.seketeli.net/~dodji Date: Thu, 30 Jul 2026 20:22:11 +0200 Message-ID: <87pl04nxrg.fsf@seketeli.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, LOCAL_AUTHENTICATION_FAIL_DMARC, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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, This commit replaces the hand-written command-line parsers in all the abigail tools with the argp facility from glibc. This provides automatic --help and --version handling, better error messages, and a more consistent user interface across all tools. * tools/abicompat.cc: (options): Remove unknow_option, display_help and display_version data members. (display_usage): Remove. (enum option_key): New enum. (argp_options): New array of argp_option. (parse_opt): New function. (argp_args_doc, argp_doc, abicompat_argp) (argp_program_version_hook, argp_program_bug_address): New global variables. (parse_command_line): Overhaul to use argp_parse. (main): Update to use argp_help and remove handling of display_help, display_version and unknow_option. * tools/abidiff.cc (options): Remove display_usage, display_version, missing_operand and wrong_option data members. (enum option_key): New enum. (argp_options): New array of argp_option. (parse_opt): New function. (argp_args_doc, argp_doc, abidiff_argp, argp_program_version_hook) ((argp_program_bug_address): New variable. (print_abidiff_version): New function. (parse_command_line): Rewrite to use argp_parse. (display_usage): Remove. (main): Update to use argp_help when no files are given, and remove handling of display_usage, display_version, missing_operand and wrong_option. * tools/abidw.cc (options::{wrong_option, display_version}): Remove data members. (display_usage): Remove function. (option_key): New enum. (argp_options): New array of argp_option. (parse_opt): New function. (argp_args_doc, argp_doc, abidw_argp, argp_program_version_hook) (argp_program_bug_address, argp_program_bug_address): New global variables. (print_abidw_version): New function. (parse_command_line): Overhaul to use argp_parse. (main): Update to use argp_help and remove handling of wrong_option, display_version and display_usage. * tools/abilint.cc (options::{wrong_option, display_version}): Remove data members. (display_usage): Remove function. (option_key): New enum. (argp_options): New array of argp_option. (parse_opt): New function. (argp_args_doc, argp_doc, abilint_argp, argp_program_version_hook) (argp_program_bug_address, argp_program_bug_address): New global variables. (print_abilint_version): New function. (parse_command_line): Overhaul to use argp_parse. (main): Update to use argp_help and remove handling of wrong_option and display_version. * tools/abipkgdiff.cc (options::{wrong_option, wrong_arg, display_usage, display_version, missing_operand}): Remove data members. (options::wrong_args): Add new data member. (display_usage): Remove function. (enum option_key): New enum. (argp_options): New array of argp_option. (parse_opt): New function. Make --set{1,2} accept comma separated list of packages, in addition to the white space separated list it was taking previously. (argp_doc, argp_args_doc, abipkgdiff_argp) (argp_program_version_hook) (argp_program_bug_address, argp_program_bug_address): New global variables. (print_abipkgdiff_version): New function. (parse_command_line): Overhaul to use argp_parse. (main): Update to use argp_help, handle wrong_args instead of wrong_arg/wrong_option, and remove handling of display_usage, display_version and missing_operand. * tools/abisym.cc (options): Change elf_path and symbol_name from char* to string. Remove show_help and display_version data members. (display_usage): Remove. (enum option_key): New enum. (argp_options): New array of argp_option. (parse_opt): New function. (argp_args_doc, argp_doc, abisym_argp, argp_program_version_hook) (argp_program_bug_address): New variable. (print_abisym_version): New function. (parse_command_line): Rewrite to use argp_parse. (main): Update to remove handling of show_help and display_version, and use base_name instead of basename for elf_path. * tools/binilint.cc (options::{display_usage, wrong_command_line_usage}): Remove data members. (options::options): Adjust. (enum option_key): New enum. (argp_options, binilint_argp): New global variables. (parse_opt, print_binilint_version): New function definitions. (parse_command_line): Overhaul to use the new parse_opt and set the global variables used by argp. * doc/manuals/abipkgdiff.rst: Adjust the documentation to reflect the fact that --set{1,2} can now accept comma separated values arguments. (main): Cleanup. * tests/data/test-diff-pkg/test-nonexistent-report-0.txt: Adjust. Signed-off-by: Dodji Seketeli Applied to the master branch. --- doc/manuals/abipkgdiff.rst | 6 + .../test-nonexistent-report-0.txt | 2 +- tools/abicompat.cc | 410 +++--- tools/abidiff.cc | 1150 +++++++++-------- tools/abidw.cc | 778 ++++++----- tools/abilint.cc | 368 +++--- tools/abipkgdiff.cc | 895 +++++++------ tools/abisym.cc | 168 +-- tools/binilint.cc | 127 +- 9 files changed, 2130 insertions(+), 1774 deletions(-) diff --git a/doc/manuals/abipkgdiff.rst b/doc/manuals/abipkgdiff.rst index 170b87db..8efbffd4 100644 --- a/doc/manuals/abipkgdiff.rst +++ b/doc/manuals/abipkgdiff.rst @@ -49,10 +49,16 @@ An alternate invocation style would be: abipkgdiff [options] --set1 \ --set2 +or + + abipkgdiff [options] --set1 ,, \ + --set2 ,, where the ABI of binaries contained in the second set of packages are compared against binaries contained in the first set of packages. +Packages in a set are delimited either by a white spaces or by a +comma. Environment =========== diff --git a/tests/data/test-diff-pkg/test-nonexistent-report-0.txt b/tests/data/test-diff-pkg/test-nonexistent-report-0.txt index 8c2f0f76..cb5df908 100644 --- a/tests/data/test-diff-pkg/test-nonexistent-report-0.txt +++ b/tests/data/test-diff-pkg/test-nonexistent-report-0.txt @@ -1,2 +1,2 @@ -abipkgdiff: The input file nonexistent-0.rpm doesn't exist +abipkgdiff: Input files nonexistent-0.rpm nonexistent-1.rpm don't exist try the --help option for more information diff --git a/tools/abicompat.cc b/tools/abicompat.cc index cb6bfffe..4546ca37 100644 --- a/tools/abicompat.cc +++ b/tools/abicompat.cc @@ -26,6 +26,7 @@ /// library provides. #include +#include #include #include #include @@ -93,7 +94,6 @@ class options public: string prog_name; - string unknow_option; string app_path; string lib1_path; string lib2_path; @@ -101,8 +101,6 @@ public: string lib1_di_root_path; string lib2_di_root_path; vector suppression_paths; - bool display_help; - bool display_version; bool weak_mode; bool list_undefined_symbols_only; bool show_base_names; @@ -121,8 +119,6 @@ public: options(const char* program_name) :prog_name(program_name), - display_help(), - display_version(), weak_mode(), list_undefined_symbols_only(), show_base_names(), @@ -218,170 +214,6 @@ perform_compat_check_in_weak_mode(options& opts, corpus_sptr app_corpus, corpus_sptr lib_corpus); -static void -display_usage(const string& prog_name, ostream& out) -{ - emit_prefix(prog_name, out) - << "usage: " << prog_name - << " [options] [application-path] [lib-v1-path] [lib-v2-path]" - << "\n" - << " where options can be: \n" - << " --help|-h display this help message\n" - << " --version|-v show program version information and exit\n" - << " --list-undefined-symbols|-u display the list of " - "undefined symbols of the application\n" - << " --show-base-names|b in the report, only show the base names " - " of the files; not the full paths\n" - << " --app-debug-info-dir|--appd set the path " - "to the debug information directory for the application\n" - << " --lib-debug-info-dir1|--libd1 set the path " - "to the debug information directory for the first library\n" - << " --lib-debug-info-dir2|--libd2 set the path " - "to the debug information directory for the second library\n" - << " --suppressions|--suppr specify a suppression file\n" - << " --no-redundant do not display redundant changes\n" - << " --no-show-locs do now show location information\n" - << " --ignore-soname do not take the SONAMEs into account\n" - << " --fail-no-debug-info bail out if no debug info was found\n" - << " --redundant display redundant changes (this is the default)\n" - << " --weak-mode check compatibility between the application and " - "just one version of the library.\n" -#ifdef WITH_CTF - << " --ctf use CTF instead of DWARF in ELF files\n" -#endif -#ifdef WITH_BTF - << " --btf use BTF instead of DWARF in ELF files\n" -#endif - ; -} - -static bool -parse_command_line(int argc, char* argv[], options& opts) -{ - if (argc < 2) - return false; - - for (int i = 1; i < argc; ++i) - { - if (argv[i][0] != '-') - { - if (opts.app_path.empty()) - opts.app_path = argv[i]; - else if (opts.lib1_path.empty()) - opts.lib1_path = argv[i]; - else if (opts.lib2_path.empty()) - opts.lib2_path = argv[i]; - else - return false; - } - else if (!strcmp(argv[i], "--version") - || !strcmp(argv[i], "-v")) - { - opts.display_version = true; - return true; - } - else if (!strcmp(argv[i], "--list-undefined-symbols") - || !strcmp(argv[i], "-u")) - opts.list_undefined_symbols_only = true; - else if (!strcmp(argv[i], "--show-base-names") - || !strcmp(argv[i], "-b")) - opts.show_base_names = true; - else if (!strcmp(argv[i], "--app-debug-info-dir") - || !strcmp(argv[i], "--appd")) - { - if (argc <= i + 1 - || argv[i + 1][0] == '-') - return false; - // elfutils wants the root path to the debug info to be - // absolute. - opts.app_di_root_path = - abigail::tools_utils::make_path_absolute(string(argv[i + 1])); - ++i; - } - else if (!strcmp(argv[i], "--lib-debug-info-dir1") - || !strcmp(argv[i], "--libd1")) - { - if (argc <= i + 1 - || argv[i + 1][0] == '-') - return false; - // elfutils wants the root path to the debug info to be - // absolute. - opts.lib1_di_root_path = - abigail::tools_utils::make_path_absolute(string(argv[i + 1])); - ++i; - } - else if (!strcmp(argv[i], "--lib-debug-info-dir2") - || !strcmp(argv[i], "--libd2")) - { - if (argc <= i + 1 - || argv[i + 1][0] == '-') - return false; - // elfutils wants the root path to the debug info to be - // absolute. - opts.lib2_di_root_path = - abigail::tools_utils::make_path_absolute(string(argv[i + 1])); - ++i; - } - else if (!strcmp(argv[i], "--suppressions") - || !strcmp(argv[i], "--suppr")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.suppression_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--redundant")) - { - opts.show_redundant = true; - opts.redundant_opt_set = true; - } - else if (!strcmp(argv[i], "--no-redundant")) - { - opts.show_redundant = false; - opts.no_redundant_opt_set = true; - } - else if (!strcmp(argv[i], "--no-show-locs")) - opts.show_locs = false; - else if (!strcmp(argv[i], "--ignore-soname")) - opts.ignore_soname=true; - else if (!strcmp(argv[i], "--fail-no-debug-info")) - opts.fail_no_debug_info = true; - else if (!strcmp(argv[i], "--help") - || !strcmp(argv[i], "-h")) - { - opts.display_help = true; - return true; - } - else if (!strcmp(argv[i], "--weak-mode")) - opts.weak_mode = true; -#ifdef WITH_CTF - else if (!strcmp(argv[i], "--ctf")) - opts.use_ctf = true; -#endif -#ifdef WITH_BTF - else if (!strcmp(argv[i], "--btf")) - opts.use_btf = true; -#endif - else - { - opts.unknow_option = argv[i]; - return false; - } - } - - if (!opts.list_undefined_symbols_only) - { - if (opts.app_path.empty() - || opts.lib1_path.empty()) - return false; - if (!opts.weak_mode && opts.lib2_path.empty()) - opts.weak_mode = true; - } - - return true; -} - /// Create the context of a diff. /// /// Create the diff context, initialize it and return a smart pointer @@ -904,45 +736,225 @@ read_corpus(options opts, return retval; } -int -main(int argc, char* argv[]) +enum option_key { - options opts(argv[0]); - - abigail::tools_utils::initialize(); + OPT_APP_DEBUG_INFO_DIR = 256, + OPT_BTF, + OPT_CTF, + OPT_FAIL_NO_DEBUG_INFO, + OPT_IGNORE_SONAME, + OPT_LIB_DEBUG_INFO_DIR1, + OPT_LIB_DEBUG_INFO_DIR2, + OPT_LIST_UNDEFINED_SYMBOLS, + OPT_NO_REDUNDANT, + OPT_NO_SHOW_LOCS, + OPT_REDUNDANT, + OPT_SHOW_BASE_NAMES, + OPT_SUPPR, + OPT_WEAK_MODE, +}; + +static const struct argp_option argp_options[] = +{ + { "app-debug-info-dir", OPT_APP_DEBUG_INFO_DIR, "PATH", 0, + "set the path to the debug information directory for the application", 0 }, + { "appd", OPT_APP_DEBUG_INFO_DIR, "PATH", OPTION_ALIAS, 0, 0 }, +#ifdef WITH_BTF + { "btf", OPT_BTF, 0, 0, + "use BTF instead of DWARF in ELF files", 0 }, +#endif +#ifdef WITH_CTF + { "ctf", OPT_CTF, 0, 0, + "use CTF instead of DWARF in ELF files", 0 }, +#endif + { "fail-no-debug-info", OPT_FAIL_NO_DEBUG_INFO, 0, 0, + "bail out if no debug info was found", 0 }, + { "ignore-soname", OPT_IGNORE_SONAME, 0, 0, + "do not take the SONAMEs into account", 0 }, + { "lib-debug-info-dir1", OPT_LIB_DEBUG_INFO_DIR1, "PATH", 0, + "set the path to the debug information directory for the first library", 0 }, + { "libd1", OPT_LIB_DEBUG_INFO_DIR1, "PATH", OPTION_ALIAS, 0, 0 }, + { "lib-debug-info-dir2", OPT_LIB_DEBUG_INFO_DIR2, "PATH", 0, + "set the path to the debug information directory for the second library", 0 }, + { "libd2", OPT_LIB_DEBUG_INFO_DIR2, "PATH", OPTION_ALIAS, 0, 0 }, + { "list-undefined-symbols", OPT_LIST_UNDEFINED_SYMBOLS, 0, 0, + "display the list of undefined symbols of the application", 0 }, + { "u", OPT_LIST_UNDEFINED_SYMBOLS, 0, OPTION_ALIAS, 0, 0 }, + { "no-redundant", OPT_NO_REDUNDANT, 0, 0, + "do not display redundant changes", 0 }, + { "no-show-locs", OPT_NO_SHOW_LOCS, 0, 0, + "do not show location information", 0 }, + { "redundant", OPT_REDUNDANT, 0, 0, + "display redundant changes (this is the default)", 0 }, + { "show-base-names", OPT_SHOW_BASE_NAMES, 0, 0, + "in the report, only show the base names of the files; not the full paths", + 0 }, + { "b", OPT_SHOW_BASE_NAMES, 0, OPTION_ALIAS, 0, 0 }, + { "suppressions", OPT_SUPPR, "PATH", 0, + "specify a suppression file", 0 }, + { "suppr", OPT_SUPPR, "PATH", OPTION_ALIAS, 0, 0 }, + { "weak-mode", OPT_WEAK_MODE, 0, 0, + "check compatibility between the application and just one version of " + "the library", 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +static error_t +parse_opt(int key, char* arg, struct argp_state* state) +{ + options& opts = *static_cast(state->input); + const string argument = arg ? string(arg) : string(); - if (!parse_command_line(argc, argv, opts)) + switch (key) { - if (!opts.unknow_option.empty()) + case OPT_APP_DEBUG_INFO_DIR: + opts.app_di_root_path = + abigail::tools_utils::make_path_absolute(argument); + break; + +#ifdef WITH_BTF + case OPT_BTF: + opts.use_btf = true; + break; +#endif + +#ifdef WITH_CTF + case OPT_CTF: + opts.use_ctf = true; + break; +#endif + + case OPT_FAIL_NO_DEBUG_INFO: + opts.fail_no_debug_info = true; + break; + + case OPT_IGNORE_SONAME: + opts.ignore_soname = true; + break; + + case OPT_LIB_DEBUG_INFO_DIR1: + opts.lib1_di_root_path = + abigail::tools_utils::make_path_absolute(argument); + break; + + case OPT_LIB_DEBUG_INFO_DIR2: + opts.lib2_di_root_path = + abigail::tools_utils::make_path_absolute(argument); + break; + + case OPT_LIST_UNDEFINED_SYMBOLS: + opts.list_undefined_symbols_only = true; + break; + + case OPT_NO_REDUNDANT: + opts.show_redundant = false; + opts.no_redundant_opt_set = true; + break; + + case OPT_NO_SHOW_LOCS: + opts.show_locs = false; + break; + + case OPT_REDUNDANT: + opts.show_redundant = true; + opts.redundant_opt_set = true; + break; + + case OPT_SHOW_BASE_NAMES: + opts.show_base_names = true; + break; + + case OPT_SUPPR: + opts.suppression_paths.push_back(argument); + break; + + case OPT_WEAK_MODE: + opts.weak_mode = true; + break; + + case ARGP_KEY_ARG: + if (opts.app_path.empty()) + opts.app_path = argument; + else if (opts.lib1_path.empty()) + opts.lib1_path = argument; + else if (opts.lib2_path.empty()) + opts.lib2_path = argument; + else + argp_usage(state); + break; + + case ARGP_KEY_END: + if (!opts.list_undefined_symbols_only) { - emit_prefix(argv[0], cerr) - << "unrecognized option: " << opts.unknow_option << "\n" - << "try the --help option for more information\n"; - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); + if (opts.app_path.empty() || opts.lib1_path.empty()) + argp_usage(state); + if (!opts.weak_mode && opts.lib2_path.empty()) + opts.weak_mode = true; } + break; - emit_prefix(argv[0], cerr) - << "wrong invocation\n" - << "try the --help option for more information\n"; - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); + default: + return ARGP_ERR_UNKNOWN; } - if (opts.display_help) - { - display_usage(argv[0], cout); - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); - } + return 0; +} - if (opts.display_version) - { - emit_prefix(argv[0], cout) - << abigail::tools_utils::get_library_version_string() - << "\n"; - return 0; - } +static const char* argp_args_doc = "[] [] []"; +static const char* argp_doc = + "Check ABI compatibility of an application against two versions of a library."; + +static const struct argp abicompat_argp = +{ + argp_options, + parse_opt, + argp_args_doc, + argp_doc, + 0, + 0, + 0 +}; + +/// Version printing hook to be passed to ARGP. +/// +/// @param stream the output stream. +/// +/// @param state the ARGP state. +static void +print_abicompat_version(FILE *stream, struct argp_state* /*state*/) +{ + fprintf(stream, "abicompat %s\n", + abigail::tools_utils::get_library_version_string().c_str()); +} + +/// Parse the command line +/// +/// @param argc number of args +/// +/// @param argv the array of arguments. +/// +/// @param opts the options set as result of command line parsing. +static bool +parse_command_line(int argc, char* argv[], options& opts) +{ + argp_program_bug_address = ""; + argp_program_version_hook = print_abicompat_version; + + if (argp_parse(&abicompat_argp, argc, argv, 0, 0, &opts) != 0) + return false; + return true; +} + +int +main(int argc, char* argv[]) +{ + options opts(argv[0]); + + abigail::tools_utils::initialize(); + + if (!parse_command_line(argc, argv, opts)) + return (abigail::tools_utils::ABIDIFF_USAGE_ERROR + | abigail::tools_utils::ABIDIFF_ERROR); if (opts.weak_mode && !opts.lib2_path.empty()) { diff --git a/tools/abidiff.cc b/tools/abidiff.cc index f263f755..e51a81ce 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -8,6 +8,7 @@ /// @file #include "config.h" +#include #include #include #include @@ -71,10 +72,6 @@ using namespace abigail; struct options { - bool display_usage; - bool display_version; - bool missing_operand; - string wrong_option; string file1; string file2; vector suppression_paths; @@ -145,10 +142,7 @@ struct options vector added_bins1; vector added_bins2; - options() - : display_usage(), - display_version(), - missing_operand(), + options() : drop_private_types(false), linux_kernel_mode(true), no_default_supprs(), @@ -210,104 +204,581 @@ struct options } };//end struct options; -static void -display_usage(const string& prog_name, ostream& out) + +enum option_key { - emit_prefix(prog_name, out) - << "usage: " << prog_name << " [options] [ ]\n" - << " where options can be:\n" - << " --help|-h display this message\n " - << " --version|-v display program version information and exit\n" - << " --debug-info-dir1|--d1 the root for the debug info of file1\n" - << " --debug-info-dir2|--d2 the root for the debug info of file2\n" - << " --headers-dir1|--hd1 the path to headers of file1\n" - << " --header-file1|--hf1 the path to one header of file1\n" - << " --headers-dir2|--hd2 the path to headers of file2\n" - << " --header-file2|--hf2 the path to one header of file2\n" - << " --added-binaries-dir1 the path to the dependencies of file1\n" - << " --added-binaries-dir2 the path to the dependencies of file2\n" - << " --add-binaries1 . build corpus groups with " - "extra binaries added to the first one and compare them\n" - << " --add-binaries2 build corpus groups with " - "extra binaries added to the second one and compare them\n" - << " --follow-dependencies|--fdeps build corpus groups with the " - "dependencies of the input files\n" - << " --list-dependencies|--ldeps show the dependencies of the input files\n" - << " --drop-private-types drop private types from " - "internal representation\n" - << " --exported-interfaces-only analyze exported interfaces only\n" - << " --allow-non-exported-interfaces analyze interfaces that " - "might not be exported\n" - << " --no-linux-kernel-mode don't consider the input binaries as " - "linux kernel binaries\n" - << " --kmi-whitelist|-w path to a " - "linux kernel abi whitelist\n" - << " --stat only display the diff stats\n" - << " --symtabs only display the symbol tables of the corpora\n" - << " --no-default-suppression don't load any " - "default suppression specification\n" - << " --no-architecture do not take architecture in account\n" - << " --no-corpus-path do not take the path to the corpora into account\n" - << " --ignore-soname do not take the SONAMEs into account\n" - << " --fail-no-debug-info bail out if no debug info was found\n" - << " --leaf-changes-only|-l only show leaf changes, " - "so no change impact analysis (implies --redundant)\n" - << " --deleted-fns display deleted public functions\n" - << " --changed-fns display changed public functions\n" - << " --added-fns display added public functions\n" - << " --deleted-vars display deleted global public variables\n" - << " --changed-vars display changed global public variables\n" - << " --added-vars display added global public variables\n" - << " --non-reachable-types|-t consider types non reachable" - " from public interfaces\n" - << " --no-added-syms do not display added functions or variables\n" - << " --no-linkage-name do not display linkage names of " - "added/removed/changed\n" - << " --no-unreferenced-symbols do not display changes " - "about symbols not referenced by debug info\n" - << " --no-show-locs do now show location information\n" - << " --show-bytes show size and offsets in bytes\n" - << " --show-bits show size and offsets in bits\n" - << " --show-hex show size and offset in hexadecimal\n" - << " --show-dec show size and offset in decimal\n" - << " --no-show-relative-offset-changes do not show relative" - " offset changes\n" - << " --suppressions|--suppr specify a suppression file\n" - << " --drop drop functions and variables matching a regexp\n" - << " --drop-fn drop functions matching a regexp\n" - << " --drop-var drop variables matching a regexp\n" - << " --keep keep only functions and variables matching a regex\n" - << " --keep-fn keep only functions matching a regex\n" - << " --keep-var keep only variables matching a regex\n" - << " --harmless display the harmless changes\n" - << " --no-harmful do not display the harmful changes\n" - << " --redundant display redundant changes\n" - << " --no-redundant do not display redundant changes " - "(this is the default)\n" - << " --impacted-interfaces display interfaces impacted by leaf changes\n" - << " --no-leverage-dwarf-factorization do not use DWZ optimisations to " - "speed-up the analysis of the binary\n" - << " --no-change-categorization | -x don't perform categorization " - "of changes, for speed purposes\n" - << " --no-assume-odr-for-cplusplus do not assume the ODR to speed-up the " - "analysis of the binary\n" - << " --dump-diff-tree emit a debug dump of the internal diff tree to " - "the error output stream\n" - << " --stats show statistics about various internal stuff\n" + OPT_ADDED_BINS_DIR1 = 256, + OPT_ADDED_BINS_DIR2, + OPT_ADDED_BINS1, + OPT_ADDED_BINS2, + OPT_ALLOW_NON_EXPORTED_INTERFACES, + OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS, + OPT_BTF, + OPT_CTF, + OPT_D1, + OPT_D2, + OPT_DEBUG_SELF_COMPARISON, + OPT_DEBUG_TC, + OPT_DELETED_FNS, + OPT_DELETED_VARS, + OPT_CHANGED_FNS, + OPT_CHANGED_VARS, + OPT_ADDED_FNS, + OPT_ADDED_VARS, + OPT_DROP, + OPT_DROP_FN, + OPT_DROP_PRIVATE_TYPES, + OPT_DROP_VAR, + OPT_DUMP_DIFF_TREE, + OPT_EXPORTED_INTERFACES_ONLY, + OPT_FAIL_NO_DEBUG_INFO, + OPT_FDEPS, + OPT_HD1, + OPT_HD2, + OPT_HF1, + OPT_HF2, + OPT_HARMLESS, + OPT_IGNORE_SONAME, + OPT_IMPACTED_INTERFACES, + OPT_KEEP, + OPT_KEEP_FN, + OPT_KEEP_VAR, + OPT_KMI_WHITELIST, + OPT_LDEPS, + OPT_LEAF_CHANGES_ONLY, + OPT_NO_ADDED_SYMS, + OPT_NO_ARCH, + OPT_NO_CHANGE_CATEGORIZATION, + OPT_NO_CORPUS_PATH, + OPT_NO_DEFAULT_SUPPRESSION, + OPT_NO_HARMFUL, + OPT_NO_LEVERAGE_DWARF_FACTORIZATION, + OPT_NO_LINKAGE_NAME, + OPT_NO_LINUX_KERNEL_MODE, + OPT_NO_REDUNDANT, + OPT_NO_SHOW_LOCS, + OPT_NO_SHOW_RELATIVE_OFFSET_CHANGES, + OPT_NO_UNREFERENCED_SYMBOLS, + OPT_NON_REACHABLE_TYPES, + OPT_REDUNDANT, + OPT_SHOW_BITS, + OPT_SHOW_BYTES, + OPT_SHOW_DEC, + OPT_SHOW_HEX, + OPT_STAT, + OPT_STATS, + OPT_SUPPR, + OPT_SYMTABS, + OPT_VERBOSE, +}; + +static const struct argp_option argp_options[] = +{ + { "add-binaries1", OPT_ADDED_BINS1, "BIN1,BIN2,..", 0, + "build corpus groups with extra binaries added to the first one " + "and compare them", 0 }, + { "add-binaries2", OPT_ADDED_BINS2, "BIN1,BIN2,..", 0, + "build corpus groups with extra binaries added to the second one " + "and compare them", 0 }, + { "added-binaries-dir1", OPT_ADDED_BINS_DIR1, "PATH", 0, + "the path to the dependencies of file1", 0 }, + { "abd1", OPT_ADDED_BINS_DIR1, "PATH", OPTION_ALIAS, 0, 0 }, + { "added-binaries-dir2", OPT_ADDED_BINS_DIR2, "PATH", 0, + "the path to the dependencies of file2", 0 }, + { "abd2", OPT_ADDED_BINS_DIR2, "PATH", OPTION_ALIAS, 0, 0 }, + { "added-fns", OPT_ADDED_FNS, 0, 0, + "display added public functions", 0 }, + { "added-vars", OPT_ADDED_VARS, 0, 0, + "display added global public variables", 0 }, + { "allow-non-exported-interfaces", OPT_ALLOW_NON_EXPORTED_INTERFACES, 0, 0, + "analyze interfaces that might not be exported", 0 }, +#ifdef WITH_BTF + { "btf", OPT_BTF, 0, 0, + "use BTF instead of DWARF in ELF files", 0 }, +#endif + { "changed-fns", OPT_CHANGED_FNS, 0, 0, + "display changed public functions", 0 }, + { "changed-vars", OPT_CHANGED_VARS, 0, 0, + "display changed global public variables", 0 }, #ifdef WITH_CTF - << " --ctf use CTF instead of DWARF in ELF files\n" + { "ctf", OPT_CTF, 0, 0, + "use CTF instead of DWARF in ELF files", 0 }, +#endif + { "debug-info-dir1", OPT_D1, "PATH", 0, + "the root for the debug info of file1", 0 }, + { "d1", OPT_D1, "PATH", OPTION_ALIAS, 0, 0 }, + { "debug-info-dir2", OPT_D2, "PATH", 0, + "the root for the debug info of file2", 0 }, + { "d2", OPT_D2, "PATH", OPTION_ALIAS, 0, 0 }, +#ifdef WITH_DEBUG_SELF_COMPARISON + { "debug-self-comparison", OPT_DEBUG_SELF_COMPARISON, 0, 0, + "debug the process of comparing an ABI corpus against itself", 0 }, #endif +#ifdef WITH_DEBUG_TYPE_CANONICALIZATION + { "debug-tc", OPT_DEBUG_TC, 0, 0, + "debug the type canonicalization process", 0 }, +#endif + { "deleted-fns", OPT_DELETED_FNS, 0, 0, + "display deleted public functions", 0 }, + { "deleted-vars", OPT_DELETED_VARS, 0, 0, + "display deleted global public variables", 0 }, + { "drop", OPT_DROP, "REGEX", 0, + "drop functions and variables matching a regexp", 0 }, + { "drop-fn", OPT_DROP_FN, "REGEX", 0, + "drop functions matching a regexp", 0 }, + { "drop-private-types", OPT_DROP_PRIVATE_TYPES, 0, 0, + "drop private types from internal representation", 0 }, + { "drop-var", OPT_DROP_VAR, "REGEX", 0, + "drop variables matching a regexp", 0 }, + { "dump-diff-tree", OPT_DUMP_DIFF_TREE, 0, 0, + "emit a debug dump of the internal diff tree to the error output stream", + 0 }, + { "exported-interfaces-only", OPT_EXPORTED_INTERFACES_ONLY, 0, 0, + "analyze exported interfaces only", 0 }, + { "fail-no-debug-info", OPT_FAIL_NO_DEBUG_INFO, 0, 0, + "bail out if no debug info was found", 0 }, + { "follow-dependencies", OPT_FDEPS, 0, 0, + "build corpus groups with the dependencies of the input files", 0 }, + { "fdeps", OPT_FDEPS, 0, OPTION_ALIAS, 0, 0 }, + { "harmless", OPT_HARMLESS, 0, 0, + "display the harmless changes", 0 }, + { "header-file1", OPT_HF1, "PATH", 0, + "the path to one header of file1", 0 }, + { "hf1", OPT_HF1, "PATH", OPTION_ALIAS, 0, 0 }, + { "header-file2", OPT_HF2, "PATH", 0, + "the path to one header of file2", 0 }, + { "hf2", OPT_HF2, "PATH", OPTION_ALIAS, 0, 0 }, + { "headers-dir1", OPT_HD1, "PATH", 0, + "the path to headers of file1", 0 }, + { "hd1", OPT_HD1, "PATH", OPTION_ALIAS, 0, 0 }, + { "headers-dir2", OPT_HD2, "PATH", 0, + "the path to headers of file2", 0 }, + { "hd2", OPT_HD2, "PATH", OPTION_ALIAS, 0, 0 }, + { "ignore-soname", OPT_IGNORE_SONAME, 0, 0, + "do not take the SONAMEs into account", 0 }, + { "impacted-interfaces", OPT_IMPACTED_INTERFACES, 0, 0, + "display interfaces impacted by leaf changes", 0 }, + { "keep", OPT_KEEP, "REGEX", 0, + "keep only functions and variables matching a regex", 0 }, + { "keep-fn", OPT_KEEP_FN, "REGEX", 0, + "keep only functions matching a regex", 0 }, + { "keep-var", OPT_KEEP_VAR, "REGEX", 0, + "keep only variables matching a regex", 0 }, + { "kmi-whitelist", OPT_KMI_WHITELIST, "PATH", 0, + "path to a linux kernel abi whitelist", 0 }, + { "w", OPT_KMI_WHITELIST, "PATH", OPTION_ALIAS, 0, 0 }, + { "leaf-changes-only", OPT_LEAF_CHANGES_ONLY, 0, 0, + "only show leaf changes, so no change impact analysis " + "(implies --redundant)", 0 }, + { "l", OPT_LEAF_CHANGES_ONLY, 0, OPTION_ALIAS, 0, 0 }, + { "list-dependencies", OPT_LDEPS, 0, 0, + "show the dependencies of the input files", 0 }, + { "ldeps", OPT_LDEPS, 0, OPTION_ALIAS, 0, 0 }, + { "no-added-syms", OPT_NO_ADDED_SYMS, 0, 0, + "do not display added functions or variables", 0 }, + { "no-architecture", OPT_NO_ARCH, 0, 0, + "do not take architecture in account", 0 }, + { "no-assume-odr-for-cplusplus", OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS, 0, 0, + "do not assume the ODR to speed-up the analysis of the binary", 0 }, + { "no-change-categorization", OPT_NO_CHANGE_CATEGORIZATION, 0, 0, + "don't perform categorization of changes, for speed purposes", 0 }, + { "x", OPT_NO_CHANGE_CATEGORIZATION, 0, OPTION_ALIAS, 0, 0 }, + { "no-corpus-path", OPT_NO_CORPUS_PATH, 0, 0, + "do not take the path to the corpora into account", 0 }, + { "no-default-suppression", OPT_NO_DEFAULT_SUPPRESSION, 0, 0, + "don't load any default suppression specification", 0 }, + { "no-harmful", OPT_NO_HARMFUL, 0, 0, + "do not display the harmful changes", 0 }, + { "no-leverage-dwarf-factorization", OPT_NO_LEVERAGE_DWARF_FACTORIZATION, + 0, 0, + "do not use DWZ optimisations to speed-up the analysis of the binary", + 0 }, + { "no-linkage-name", OPT_NO_LINKAGE_NAME, 0, 0, + "do not display linkage names of added/removed/changed", 0 }, + { "no-linux-kernel-mode", OPT_NO_LINUX_KERNEL_MODE, 0, 0, + "don't consider the input binaries as linux kernel binaries", 0 }, + { "no-redundant", OPT_NO_REDUNDANT, 0, 0, + "do not display redundant changes (this is the default)", 0 }, + { "no-show-locs", OPT_NO_SHOW_LOCS, 0, 0, + "do not show location information", 0 }, + { "no-show-relative-offset-changes", OPT_NO_SHOW_RELATIVE_OFFSET_CHANGES, + 0, 0, + "do not show relative offset changes", 0 }, + { "no-unreferenced-symbols", OPT_NO_UNREFERENCED_SYMBOLS, 0, 0, + "do not display changes about symbols not referenced by debug info", 0 }, + { "non-reachable-types", OPT_NON_REACHABLE_TYPES, 0, 0, + "consider types non reachable from public interfaces", 0 }, + { "t", OPT_NON_REACHABLE_TYPES, 0, OPTION_ALIAS, 0, 0 }, + { "redundant", OPT_REDUNDANT, 0, 0, + "display redundant changes", 0 }, + { "show-bits", OPT_SHOW_BITS, 0, 0, + "show size and offsets in bits", 0 }, + { "show-bytes", OPT_SHOW_BYTES, 0, 0, + "show size and offsets in bytes", 0 }, + { "show-dec", OPT_SHOW_DEC, 0, 0, + "show size and offset in decimal", 0 }, + { "show-hex", OPT_SHOW_HEX, 0, 0, + "show size and offset in hexadecimal", 0 }, + { "stat", OPT_STAT, 0, 0, + "only display the diff stats", 0 }, + { "stats", OPT_STATS, 0, 0, + "show statistics about various internal stuff", 0 }, + { "suppressions", OPT_SUPPR, "PATH", 0, + "specify a suppression file", 0 }, + { "suppr", OPT_SUPPR, "PATH", OPTION_ALIAS, 0, 0 }, + { "symtabs", OPT_SYMTABS, 0, 0, + "only display the symbol tables of the corpora", 0 }, + { "verbose", OPT_VERBOSE, 0, 0, + "show verbose messages about internal stuff", 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +static error_t +parse_opt(int key, char* arg, struct argp_state* state) +{ + options& opts = *static_cast(state->input); + const string argument = arg ? string(arg) : string(); + + switch (key) + { + case OPT_ADDED_BINS1: + if (argument.find(',') != string::npos) + tools_utils::split_string(argument, ",", opts.added_bins1); + else + opts.added_bins1.push_back(argument); + break; + + case OPT_ADDED_BINS2: + if (argument.find(',') != string::npos) + tools_utils::split_string(argument, ",", opts.added_bins2); + else + opts.added_bins2.push_back(argument); + break; + + case OPT_ADDED_BINS_DIR1: + opts.added_bins_dirs1.push_back(argument); + break; + + case OPT_ADDED_BINS_DIR2: + opts.added_bins_dirs2.push_back(argument); + break; + + case OPT_ADDED_FNS: + opts.show_added_fns = true; + opts.show_all_fns = false; + opts.show_all_vars = false; + break; + + case OPT_ADDED_VARS: + opts.show_added_vars = true; + opts.show_all_fns = false; + opts.show_all_vars = false; + break; + + case OPT_ALLOW_NON_EXPORTED_INTERFACES: + opts.exported_interfaces_only = false; + break; + + case OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS: + opts.assume_odr_for_cplusplus = false; + break; + #ifdef WITH_BTF - << " --btf use BTF instead of DWARF in ELF files\n" + case OPT_BTF: + opts.use_btf = true; + break; #endif + + case OPT_CHANGED_FNS: + opts.show_changed_fns = true; + opts.show_all_fns = false; + opts.show_all_vars = false; + break; + + case OPT_CHANGED_VARS: + opts.show_changed_vars = true; + opts.show_all_fns = false; + opts.show_all_vars = false; + break; + +#ifdef WITH_CTF + case OPT_CTF: + opts.use_ctf = true; + break; +#endif + + case OPT_D1: + opts.di_root_paths1.push_back + (abigail::tools_utils::make_path_absolute(argument)); + break; + + case OPT_D2: + opts.di_root_paths2.push_back + (abigail::tools_utils::make_path_absolute(argument)); + break; + #ifdef WITH_DEBUG_SELF_COMPARISON - << " --debug-self-comparison debug the process of comparing " - "an ABI corpus against itself" + case OPT_DEBUG_SELF_COMPARISON: + opts.do_debug_self_comparison = true; + break; #endif + #ifdef WITH_DEBUG_TYPE_CANONICALIZATION - << " --debug-tc debug the type canonicalization process" + case OPT_DEBUG_TC: + opts.do_debug_type_canonicalization = true; + break; #endif - << " --verbose show verbose messages about internal stuff\n"; + + case OPT_DELETED_FNS: + opts.show_deleted_fns = true; + opts.show_all_fns = false; + opts.show_all_vars = false; + break; + + case OPT_DELETED_VARS: + opts.show_deleted_vars = true; + opts.show_all_fns = false; + opts.show_all_vars = false; + break; + + case OPT_DROP: + opts.drop_fn_regex_patterns.push_back(argument); + opts.drop_var_regex_patterns.push_back(argument); + break; + + case OPT_DROP_FN: + opts.drop_fn_regex_patterns.push_back(argument); + break; + + case OPT_DROP_PRIVATE_TYPES: + opts.drop_private_types = true; + break; + + case OPT_DROP_VAR: + opts.drop_var_regex_patterns.push_back(argument); + break; + + case OPT_DUMP_DIFF_TREE: + opts.dump_diff_tree = true; + break; + + case OPT_EXPORTED_INTERFACES_ONLY: + opts.exported_interfaces_only = true; + break; + + case OPT_FAIL_NO_DEBUG_INFO: + opts.fail_no_debug_info = true; + break; + + case OPT_FDEPS: + opts.follow_dependencies = true; + break; + + case OPT_HARMLESS: + opts.show_harmless_changes = true; + break; + + case OPT_HD1: + opts.headers_dirs1.push_back(argument); + break; + + case OPT_HD2: + opts.headers_dirs2.push_back(argument); + break; + + case OPT_HF1: + opts.header_files1.push_back(argument); + break; + + case OPT_HF2: + opts.header_files2.push_back(argument); + break; + + case OPT_IGNORE_SONAME: + opts.ignore_soname = true; + break; + + case OPT_IMPACTED_INTERFACES: + opts.show_impacted_interfaces = true; + break; + + case OPT_KEEP: + opts.keep_fn_regex_patterns.push_back(argument); + opts.keep_var_regex_patterns.push_back(argument); + break; + + case OPT_KEEP_FN: + opts.keep_fn_regex_patterns.push_back(argument); + break; + + case OPT_KEEP_VAR: + opts.keep_var_regex_patterns.push_back(argument); + break; + + case OPT_KMI_WHITELIST: + opts.kernel_abi_whitelist_paths.push_back(argument); + break; + + case OPT_LDEPS: + opts.list_dependencies = true; + break; + + case OPT_LEAF_CHANGES_ONLY: + opts.leaf_changes_only = true; + break; + + case OPT_NO_ADDED_SYMS: + opts.show_added_syms = false; + opts.show_added_vars = false; + opts.show_added_fns = false; + if (!(opts.show_changed_fns + || opts.show_changed_vars + || opts.show_deleted_fns + || opts.show_deleted_vars)) + { + opts.show_changed_fns = true; + opts.show_changed_vars = true; + opts.show_deleted_vars = true; + opts.show_deleted_fns = true; + } + opts.show_all_fns = false; + opts.show_all_vars = false; + break; + + case OPT_NO_ARCH: + opts.no_arch = true; + break; + + case OPT_NO_CHANGE_CATEGORIZATION: + opts.perform_change_categorization = false; + break; + + case OPT_NO_CORPUS_PATH: + opts.no_corpus = true; + break; + + case OPT_NO_DEFAULT_SUPPRESSION: + opts.no_default_supprs = true; + break; + + case OPT_NO_HARMFUL: + opts.show_harmful_changes = false; + break; + + case OPT_NO_LEVERAGE_DWARF_FACTORIZATION: + opts.leverage_dwarf_factorization = false; + break; + + case OPT_NO_LINKAGE_NAME: + opts.show_linkage_names = false; + break; + + case OPT_NO_LINUX_KERNEL_MODE: + opts.linux_kernel_mode = false; + break; + + case OPT_NO_REDUNDANT: + opts.show_redundant_changes = false; + break; + + case OPT_NO_SHOW_LOCS: + opts.show_locs = false; + break; + + case OPT_NO_SHOW_RELATIVE_OFFSET_CHANGES: + opts.show_relative_offset_changes = false; + break; + + case OPT_NO_UNREFERENCED_SYMBOLS: + opts.show_symbols_not_referenced_by_debug_info = false; + break; + + case OPT_NON_REACHABLE_TYPES: + opts.show_all_types = true; + break; + + case OPT_REDUNDANT: + opts.show_redundant_changes = true; + break; + + case OPT_SHOW_BITS: + opts.show_offsets_sizes_in_bits = true; + break; + + case OPT_SHOW_BYTES: + opts.show_offsets_sizes_in_bits = false; + break; + + case OPT_SHOW_DEC: + opts.show_hexadecimal_values = false; + break; + + case OPT_SHOW_HEX: + opts.show_hexadecimal_values = true; + break; + + case OPT_STAT: + opts.show_stats_only = true; + break; + + case OPT_STATS: + opts.show_stats = true; + break; + + case OPT_SUPPR: + opts.suppression_paths.push_back(argument); + break; + + case OPT_SYMTABS: + opts.show_symtabs = true; + break; + + case OPT_VERBOSE: + opts.do_log = true; + break; + + case ARGP_KEY_ARG: + if (opts.file1.empty()) + opts.file1 = argument; + else if (opts.file2.empty()) + opts.file2 = argument; + else + argp_usage(state); + break; + + default: + return ARGP_ERR_UNKNOWN; + } + + return 0; +} + +static const char* argp_args_doc = "[ ]"; +static const char* argp_doc = + "Compare the ABI of two ELF files, returning 0 if they are identical, " + "or non-zero if they differ."; + +static const struct argp abidiff_argp = +{ + argp_options, + parse_opt, + argp_args_doc, + argp_doc, + 0, + 0, + 0 +}; + +/// Version printing hook to be passed to ARGP. +/// +/// @param stream the output stream. +/// +/// @param state the ARGP state. +static void +print_abidiff_version(FILE *stream, struct argp_state* /*state*/) +{ + fprintf(stream, "abidiff %s\n", + abigail::tools_utils::get_library_version_string().c_str()); } /// Parse the command line and set the options accordingly. @@ -324,445 +795,11 @@ display_usage(const string& prog_name, ostream& out) bool parse_command_line(int argc, char* argv[], options& opts) { - if (argc < 2) - return false; - - for (int i = 1; i < argc; ++i) - { - if (argv[i][0] != '-') - { - if (opts.file1.empty()) - opts.file1 = argv[i]; - else if (opts.file2.empty()) - opts.file2 = argv[i]; - else - return false; - } - else if (!strcmp(argv[i], "--version") - || !strcmp(argv[i], "-v")) - { - opts.display_version = true; - return true; - } - else if (!strcmp(argv[i], "--debug-info-dir1") - || !strcmp(argv[i], "--d1")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - // elfutils wants the root path to the debug info to be - // absolute. - opts.di_root_paths1.push_back - (abigail::tools_utils::make_path_absolute(string(argv[j]))); - ++i; - } - else if (!strcmp(argv[i], "--debug-info-dir2") - || !strcmp(argv[i], "--d2")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - // elfutils wants the root path to the debug info to be - // absolute. - opts.di_root_paths2.push_back - (abigail::tools_utils::make_path_absolute(string(argv[j]))); - ++i; - } - else if (!strcmp(argv[i], "--headers-dir1") - || !strcmp(argv[i], "--hd1")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - // The user can specify several header files directories for - // the first binary. - opts.headers_dirs1.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--header-file1") - || !strcmp(argv[i], "--hf1")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.header_files1.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--headers-dir2") - || !strcmp(argv[i], "--hd2")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - // The user can specify several header files directories for - // the first binary. - opts.headers_dirs2.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--header-file2") - || !strcmp(argv[i], "--hf2")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.header_files2.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--follow-dependencies") - || !strcmp(argv[i], "--fdeps")) - opts.follow_dependencies = true; - else if (!strcmp(argv[i], "--list-dependencies") - || !strcmp(argv[i], "--ldeps")) - opts.list_dependencies = true; - else if (!strcmp(argv[i], "--added-binaries-dir1") - || !strcmp(argv[i], "--abd1")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.added_bins_dirs1.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--added-binaries-dir2") - || !strcmp(argv[i], "--abd2")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.added_bins_dirs2.push_back(argv[j]); - ++i; - } - else if (!strncmp(argv[i], "--add-binaries1=", - strlen("--add-binaries1="))) - tools_utils::get_comma_separated_args_of_option(argv[i], - "--add-binaries1=", - opts.added_bins1); - else if (!strcmp(argv[i], "--add-binaries1")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - string s = argv[j]; - if (s.find(',')) - tools_utils::split_string(s, ",", opts.added_bins1); - else - opts.added_bins1.push_back(s); - ++i; - } - else if (!strncmp(argv[i], "--add-binaries2=", - strlen("--add-binaries2="))) - tools_utils::get_comma_separated_args_of_option(argv[i], - "--add-binaries2=", - opts.added_bins2); - else if (!strcmp(argv[i], "--add-binaries2")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - string s = argv[j]; - if (s.find(',')) - tools_utils::split_string(s, ",", opts.added_bins2); - else - opts.added_bins2.push_back(s); - ++i; - } - else if (!strcmp(argv[i], "--kmi-whitelist") - || !strcmp(argv[i], "-w")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.kernel_abi_whitelist_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--stat")) - opts.show_stats_only = true; - else if (!strcmp(argv[i], "--symtabs")) - opts.show_symtabs = true; - else if (!strcmp(argv[i], "--help") - || !strcmp(argv[i], "-h")) - { - opts.display_usage = true; - return true; - } - else if (!strcmp(argv[i], "--drop-private-types")) - opts.drop_private_types = true; - else if (!strcmp(argv[i], "--exported-interfaces-only")) - opts.exported_interfaces_only = true; - else if (!strcmp(argv[i], "--allow-non-exported-interfaces")) - opts.exported_interfaces_only = false; - else if (!strcmp(argv[i], "--no-linux-kernel-mode")) - opts.linux_kernel_mode = false; - else if (!strcmp(argv[i], "--no-default-suppression")) - opts.no_default_supprs = true; - else if (!strcmp(argv[i], "--no-architecture")) - opts.no_arch = true; - else if (!strcmp(argv[i], "--no-corpus-path")) - opts.no_corpus = true; - else if (!strcmp(argv[i], "--ignore-soname")) - opts.ignore_soname = true; - else if (!strcmp(argv[i], "--fail-no-debug-info")) - opts.fail_no_debug_info = true; - else if (!strcmp(argv[i], "--leaf-changes-only") - ||!strcmp(argv[i], "-l")) - opts.leaf_changes_only = true; - else if (!strcmp(argv[i], "--deleted-fns")) - { - opts.show_deleted_fns = true; - opts.show_all_fns = false; - opts.show_all_vars = false; - } - else if (!strcmp(argv[i], "--changed-fns")) - { - opts.show_changed_fns = true; - opts.show_all_fns = false; - opts.show_all_vars = false; - } - else if (!strcmp(argv[i], "--added-fns")) - { - opts.show_added_fns = true; - opts.show_all_fns = false; - opts.show_all_vars = false; - } - else if (!strcmp(argv[i], "--deleted-vars")) - { - opts.show_deleted_vars = true; - opts.show_all_fns = false; - opts.show_all_vars = false; - } - else if (!strcmp(argv[i], "--changed-vars")) - { - opts.show_changed_vars = true; - opts.show_all_fns = false; - opts.show_all_vars = false; - } - else if (!strcmp(argv[i], "--added-vars")) - { - opts.show_added_vars = true; - opts.show_all_fns = false; - opts.show_all_vars = false; - } - else if (!strcmp(argv[i], "--non-reachable-types") - || !strcmp(argv[i], "-t")) - opts.show_all_types = true; - else if (!strcmp(argv[i], "--no-added-syms")) - { - opts.show_added_syms = false; - opts.show_added_vars = false; - opts.show_added_fns = false; - - // If any of the {changed,deleted}_{vars,fns} is already - // specified, --no-added-syms has no further effect. If it - // is the only option specified (as of the time of parsing - // it), it shall mean "show everything, except added vars, - // fns and unreferenced symbols. - if (!(opts.show_changed_fns - || opts.show_changed_vars - || opts.show_deleted_fns - || opts.show_deleted_vars)) - { - opts.show_changed_fns = true; - opts.show_changed_vars = true; - - opts.show_deleted_vars = true; - opts.show_deleted_fns = true; - } - - opts.show_all_fns = false; - opts.show_all_vars = false; - } - else if (!strcmp(argv[i], "--no-linkage-name")) - opts.show_linkage_names = false; - else if (!strcmp(argv[i], "--no-unreferenced-symbols")) - opts.show_symbols_not_referenced_by_debug_info = false; - else if (!strcmp(argv[i], "--no-show-locs")) - opts.show_locs = false; - else if (!strcmp(argv[i], "--show-bytes")) - opts.show_offsets_sizes_in_bits = false; - else if (!strcmp(argv[i], "--show-bits")) - opts.show_offsets_sizes_in_bits = true; - else if (!strcmp(argv[i], "--show-hex")) - opts.show_hexadecimal_values = true; - else if (!strcmp(argv[i], "--show-dec")) - opts.show_hexadecimal_values = false; - else if (!strcmp(argv[i], "--no-show-relative-offset-changes")) - opts.show_relative_offset_changes = false; - else if (!strcmp(argv[i], "--suppressions") - || !strcmp(argv[i], "--suppr")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.suppression_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--drop")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.drop_fn_regex_patterns.push_back(argv[j]); - opts.drop_var_regex_patterns.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--drop-fn")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.drop_fn_regex_patterns.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--drop-var")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.drop_var_regex_patterns.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--keep")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.keep_fn_regex_patterns.push_back(argv[j]); - opts.keep_var_regex_patterns.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--keep-fn")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.keep_fn_regex_patterns.push_back(argv[j]); - } - else if (!strcmp(argv[i], "--keep-var")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.keep_var_regex_patterns.push_back(argv[j]); - } - else if (!strcmp(argv[i], "--harmless")) - opts.show_harmless_changes = true; - else if (!strcmp(argv[i], "--no-harmful")) - opts.show_harmful_changes = false; - else if (!strcmp(argv[i], "--redundant")) - opts.show_redundant_changes = true; - else if (!strcmp(argv[i], "--no-redundant")) - opts.show_redundant_changes = false; - else if (!strcmp(argv[i], "--impacted-interfaces")) - opts.show_impacted_interfaces = true; - else if (!strcmp(argv[i], "--no-leverage-dwarf-factorization")) - opts.leverage_dwarf_factorization = false; - else if (!strcmp(argv[i], "--no-change-categorization") - || !strcmp(argv[i], "-x")) - opts.perform_change_categorization = false; - else if (!strcmp(argv[i], "--no-assume-odr-for-cplusplus")) - opts.leverage_dwarf_factorization = false; - else if (!strcmp(argv[i], "--dump-diff-tree")) - opts.dump_diff_tree = true; - else if (!strcmp(argv[i], "--stats")) - opts.show_stats = true; - else if (!strcmp(argv[i], "--verbose")) - opts.do_log = true; -#ifdef WITH_CTF - else if (!strcmp(argv[i], "--ctf")) - opts.use_ctf = true; -#endif -#ifdef WITH_BTF - else if (!strcmp(argv[i], "--btf")) - opts.use_btf = true; -#endif -#ifdef WITH_DEBUG_SELF_COMPARISON - else if (!strcmp(argv[i], "--debug-self-comparison")) - opts.do_debug_self_comparison = true; -#endif -#ifdef WITH_DEBUG_TYPE_CANONICALIZATION - else if (!strcmp(argv[i], "--debug-tc")) - opts.do_debug_type_canonicalization = true; -#endif - else - { - if (strlen(argv[i]) >= 2 && argv[i][0] == '-' && argv[i][1] == '-') - opts.wrong_option = argv[i]; - return false; - } - } + argp_program_version_hook = print_abidiff_version; + argp_program_bug_address = ""; + if (argp_parse(&abidiff_argp, argc, argv, 0, 0, &opts) != 0) + return false; return true; } @@ -1287,38 +1324,8 @@ main(int argc, char* argv[]) options opts; if (!parse_command_line(argc, argv, opts)) - { - emit_prefix(argv[0], cerr) - << "unrecognized option: " - << opts.wrong_option << "\n" - << "try the --help option for more information\n"; - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); - } - - if (opts.missing_operand) - { - emit_prefix(argv[0], cerr) - << "missing operand to option: " << opts.wrong_option <<"\n" - << "try the --help option for more information\n"; - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); - } - - if (opts.display_usage) - { - display_usage(argv[0], cout); - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); - } - - if (opts.display_version) - { - emit_prefix(argv[0], cout) - << abigail::tools_utils::get_library_version_string() - << "\n"; - return 0; - } + return (abigail::tools_utils::ABIDIFF_USAGE_ERROR + | abigail::tools_utils::ABIDIFF_ERROR); if (!maybe_check_suppression_files(opts)) return (abigail::tools_utils::ABIDIFF_USAGE_ERROR @@ -1859,6 +1866,15 @@ main(int argc, char* argv[]) else status = abigail::tools_utils::ABIDIFF_ERROR; } + else + { + char* prog_name = (char*) "abidiff"; + emit_prefix(prog_name, cerr) + << "At least one of the files to compare is missing\n"; + argp_help(&abidiff_argp, stderr, ARGP_HELP_USAGE, prog_name); + return (abigail::tools_utils::ABIDIFF_USAGE_ERROR + | abigail::tools_utils::ABIDIFF_ERROR); + } return status; } diff --git a/tools/abidw.cc b/tools/abidw.cc index 4cc60f84..fd466638 100644 --- a/tools/abidw.cc +++ b/tools/abidw.cc @@ -12,6 +12,7 @@ /// libabigail XML format. #include "config.h" +#include #include #include #include @@ -84,7 +85,6 @@ using namespace abigail; struct options { - string wrong_option; string in_file_path; string out_file_path; vector di_root_paths; @@ -96,7 +96,6 @@ struct options vector suppression_paths; vector kabi_whitelist_paths; suppressions_type kabi_whitelist_supprs; - bool display_version; bool display_abixml_version; bool fail_no_debug_info; bool check_alt_debug_info_path; @@ -145,8 +144,7 @@ struct options #endif options() - : display_version(), - display_abixml_version(), + : display_abixml_version(), fail_no_debug_info(), check_alt_debug_info_path(), show_base_name_alt_debug_info_path(), @@ -195,324 +193,6 @@ struct options } }; -static void -display_usage(const string& prog_name, ostream& out) -{ - emit_prefix(prog_name, out) - << "usage: " << prog_name << " [options] []\n" - << " where options can be: \n" - << " --abidiff compare the loaded ABI against itself\n" - << " --abixml-version display the version of the ABIXML ABI format\n" - << " --add-binaries build a corpus group with " - "the added inaries\n" - << " --allow-non-exported-interfaces analyze interfaces that" - "might not be exported\n" - << " --annotate annotate the ABI artifacts emitted in the output\n" -#ifdef WITH_BTF - << " --btf use BTF instead of DWARF in ELF files\n" -#endif - << " --check-alternate-debug-info check alternate debug info " - "of \n" - << " --check-alternate-debug-info-base-name check alternate " - "debug info of , and show its base name\n" -#ifdef WITH_CTF - << " --ctf use CTF instead of DWARF in ELF files\n" -#endif -#ifdef WITH_DEBUG_SELF_COMPARISON - << " --debug-abidiff debug the process of comparing the loaded ABI against itself\n" -#endif - << " --debug-info-dir|-d look for debug info under 'dir-path'\n" -#ifdef WITH_DEBUG_TYPE_CANONICALIZATION - << " --debug-tc debug the type canonicalization process\n" - << " --debug-dc debug the DIE canonicalization process\n" -#endif - << " --drop-undefined-syms drop undefined symbols from representation\n" - << " --exported-interfaces-only analyze exported interfaces only\n" - << " --follow-dependencies build a corpus group with the dependencies\n" - << " --follow-dependencies build a corpus group with the dependencies\n" - << " --force-early-suppression drop IR nodes that match suppression specifications\n" - << " --headers-dir|--hd the path to headers of the elf file\n" - << " --header-file|--hf the path one header of the elf file\n" - << " --help|-h display this message\n" - << " --kmi-whitelist|--kmi-stablelist|-w path to a linux kernel " - "abi whitelist\n" - << " --list-dependencies list the dependencies of a given binary\n" - << " --added-binaries-dir|--abd where to look for dependencies " - "or added binaries\n" - << " --linux-tree|--lt emit the ABI for the union of a " - "vmlinux and its modules\n" - << " --load-all-types read all types including those not reachable from " - "exported declarations\n" - << " --no-architecture do not emit architecture info in the output\n" - << " --no-assume-odr-for-cplusplus do not assume the ODR to speed-up the " - "analysis of the binary\n" - << " --no-comp-dir-path do not show compilation path information\n" - << " --no-corpus-path do not take the path to the corpora into account\n" - << " --no-elf-needed do not show the DT_NEEDED information\n" - << " --no-leverage-dwarf-factorization do not use DWZ optimisations to " - "speed-up the analysis of the binary\n" - << " --no-linux-kernel-mode don't consider the input binary as " - "a Linux Kernel binary\n" - << " --no-load-undefined-interfaces do not consider undefined " - "interfaces from the binary" - << " --no-parameter-names do not show names of function parameters\n" - << " --no-show-locs do not show location information\n" - << " --no-write-default-sizes do not emit pointer size when it equals" - " the default address size of the translation unit\n" - << " --noout do not emit anything after reading the binary\n" - << " --out-file|-o write the output to 'file-path'\n" - << " --short-locs only print filenames rather than paths\n" - << " --suppressions|--suppr specify a suppression file\n" - << " --type-id-style type id style (sequence(default): " - "\"type-id-\" + number; hash: hex-digits)\n" - << " --stats show statistics about various internal stuff\n" - << " --verbose show verbose messages about internal stuff\n" - << " --version|-v display program version information and exit\n" - << " --vmlinux the path to the vmlinux binary to consider to emit " - "the ABI of the union of vmlinux and its modules\n" ; -} - -static bool -parse_command_line(int argc, char* argv[], options& opts) -{ - if (argc < 2) - return false; - - for (int i = 1; i < argc; ++i) - { - if (argv[i][0] != '-') - { - if (opts.in_file_path.empty()) - opts.in_file_path = argv[i]; - else - return false; - } - else if (!strcmp(argv[i], "--version") - || !strcmp(argv[i], "-v")) - opts.display_version = true; - else if (!strcmp(argv[i], "--abixml-version") - || !strcmp(argv[i], "-v")) - opts.display_abixml_version = true; - else if (!strcmp(argv[i], "--fail-no-debug-info")) - opts.fail_no_debug_info = true; - else if (!strcmp(argv[i], "--debug-info-dir") - || !strcmp(argv[i], "-d")) - { - if (argc <= i + 1 - || argv[i + 1][0] == '-') - return false; - // elfutils wants the root path to the debug info to be - // absolute. - opts.di_root_paths.push_back - (abigail::tools_utils::make_path_absolute(string(argv[i + 1]))); - ++i; - } - else if (!strcmp(argv[i], "--headers-dir") - || !strcmp(argv[i], "--hd")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.headers_dirs.push_back(argv[j]); - // The user is indirectly defining private types so she - // really wants those types to be removed from the ABIXML. - // So let's drop them from the IR. - opts.drop_private_types = true; - ++i; - } - else if (!strcmp(argv[i], "--added-binaries-dir") - || !strcmp(argv[i], "--abd")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.added_bins_dirs.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--header-file") - || !strcmp(argv[i], "--hf")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.header_files.push_back(argv[j]); - // The user is indirectly defining private types so she - // really wants those types to be removed from the ABIXML. - // So let's drop them from the IR. - opts.drop_private_types = true; - ++i; - } - else if (!strcmp(argv[i], "--out-file") - || !strcmp(argv[i], "-o")) - { - if (argc <= i + 1 - || argv[i + 1][0] == '-' - || !opts.out_file_path.empty()) - return false; - - opts.out_file_path = argv[i + 1]; - ++i; - } - else if (!strcmp(argv[i], "--suppressions") - || !strcmp(argv[i], "--suppr")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.suppression_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--kmi-whitelist") - || !strcmp(argv[i], "--kmi-stablelist") - || !strcmp(argv[i], "-w")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.kabi_whitelist_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--linux-tree") - || !strcmp(argv[i], "--lt")) - opts.corpus_group_for_linux = true; - else if (!strcmp(argv[i], "--vmlinux")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.vmlinux = argv[j]; - ++i; - } - else if (!strcmp(argv[i], "--noout")) - opts.noout = true; - else if (!strcmp(argv[i], "--follow-dependencies")) - opts.follow_dependencies = true; - else if (!strcmp(argv[i], "--list-dependencies")) - opts.list_dependencies = true; - else if (!strncmp(argv[i], "--add-binaries=", - strlen("--add-binaries="))) - tools_utils::get_comma_separated_args_of_option(argv[i], - "--add-binaries=", - opts.added_bins); - else if (!strcmp(argv[i], "--add-binaries")) - { - int j = i + 1; - if (j >= argc) - return false; - - string s = argv[j]; - if (s.find(',')) - tools_utils::split_string(s, ",", opts.added_bins); - else - opts.added_bins.push_back(s); - ++i; - } -#ifdef WITH_CTF - else if (!strcmp(argv[i], "--ctf")) - opts.use_ctf = true; -#endif -#ifdef WITH_BTF - else if (!strcmp(argv[i], "--btf")) - opts.use_btf = true; -#endif - else if (!strcmp(argv[i], "--no-architecture")) - opts.write_architecture = false; - else if (!strcmp(argv[i], "--no-corpus-path")) - opts.write_corpus_path = false; - else if (!strcmp(argv[i], "--no-show-locs")) - opts.show_locs = false; - else if (!strcmp(argv[i], "--short-locs")) - opts.short_locs = true; - else if (!strcmp(argv[i], "--no-comp-dir-path")) - opts.write_comp_dir = false; - else if (!strcmp(argv[i], "--no-elf-needed")) - opts.write_elf_needed = false; - else if (!strcmp(argv[i], "--no-write-default-sizes")) - opts.default_sizes = false; - else if (!strcmp(argv[i], "--no-parameter-names")) - opts.write_parameter_names = false; - else if (!strcmp(argv[i], "--type-id-style")) - { - ++i; - if (i >= argc) - return false; - if (!strcmp(argv[i], "sequence")) - opts.type_id_style = SEQUENCE_TYPE_ID_STYLE; - else if (!strcmp(argv[i], "hash")) - opts.type_id_style = HASH_TYPE_ID_STYLE; - else - return false; - } - else if (!strcmp(argv[i], "--check-alternate-debug-info") - || !strcmp(argv[i], "--check-alternate-debug-info-base-name")) - { - if (argc <= i + 1 - || argv[i + 1][0] == '-' - || !opts.in_file_path.empty()) - return false; - if (!strcmp(argv[i], "--check-alternate-debug-info-base-name")) - opts.show_base_name_alt_debug_info_path = true; - opts.check_alt_debug_info_path = true; - opts.in_file_path = argv[i + 1]; - ++i; - } - else if (!strcmp(argv[i], "--load-all-types")) - opts.load_all_types = true; - else if (!strcmp(argv[i], "--no-load-undefined-interfaces")) - opts.load_undefined_interfaces = false; - else if (!strcmp(argv[i], "--drop-private-types")) - opts.drop_private_types = true; - else if (!strcmp(argv[i], "--force-early-suppression")) - opts.force_early_suppression = true; - else if (!strcmp(argv[i], "--drop-undefined-syms")) - opts.drop_undefined_syms = true; - else if (!strcmp(argv[i], "--exported-interfaces-only")) - opts.exported_interfaces_only = true; - else if (!strcmp(argv[i], "--allow-non-exported-interfaces")) - opts.exported_interfaces_only = false; - else if (!strcmp(argv[i], "--no-linux-kernel-mode")) - opts.linux_kernel_mode = false; - else if (!strcmp(argv[i], "--abidiff")) - opts.abidiff = true; -#ifdef WITH_DEBUG_SELF_COMPARISON - else if (!strcmp(argv[i], "--debug-abidiff")) - { - opts.abidiff = true; - opts.debug_abidiff = true; - } -#endif -#ifdef WITH_DEBUG_TYPE_CANONICALIZATION - else if (!strcmp(argv[i], "--debug-tc") - || !strcmp(argv[i], "debug-type-canonicalization")) - opts.debug_type_canonicalization = true; - else if (!strcmp(argv[i], "--debug-dc") - || !strcmp(argv[i], "debug-die-canonicalization")) - opts.debug_die_canonicalization = true; -#endif - else if (!strcmp (argv[i], "--no-assume-odr-for-cplusplus")) - opts.assume_odr_for_cplusplus = false; - else if (!strcmp (argv[i], "--no-leverage-dwarf-factorization")) - opts.leverage_dwarf_factorization = false; - else if (!strcmp(argv[i], "--annotate")) - opts.annotate = true; - else if (!strcmp(argv[i], "--stats")) - opts.show_stats = true; - else if (!strcmp(argv[i], "--verbose")) - opts.do_log = true; - else if (!strcmp(argv[i], "--help") - || !strcmp(argv[i], "--h")) - return false; - else - { - if (strlen(argv[i]) >= 2 && argv[i][0] == '-' && argv[i][1] == '-') - opts.wrong_option = argv[i]; - return false; - } - } - - return true; -} - /// Initialize the context use for driving ABI comparison. /// /// @param ctxt the context to initialize. @@ -1159,6 +839,445 @@ load_kernel_corpus_group_and_write_abixml(char* argv[], return exit_code; } +enum option_key +{ + OPT_ABIDIFF = 256, + OPT_ABIXML_VERSION, + OPT_ADD_BINARIES, + OPT_ADDED_BINS_DIR, + OPT_ALLOW_NON_EXPORTED_INTERFACES, + OPT_ANNOTATE, + OPT_BTF, + OPT_CHECK_ALT_DEBUG_INFO, + OPT_CHECK_ALT_DEBUG_INFO_BASE_NAME, + OPT_CTF, + OPT_DEBUG_ABIDIFF, + OPT_DEBUG_DC, + OPT_DEBUG_TC, + OPT_DEBUG_INFO_DIR, + OPT_DROP_PRIVATE_TYPES, + OPT_DROP_UNDEFINED_SYMS, + OPT_EXPORTED_INTERFACES_ONLY, + OPT_FAIL_NO_DEBUG_INFO, + OPT_FDEPS, + OPT_FORCE_EARLY_SUPPRESSION, + OPT_HD, + OPT_HF, + OPT_KMI_WHITELIST, + OPT_LDEPS, + OPT_LINUX_TREE, + OPT_LOAD_ALL_TYPES, + OPT_NO_ARCH, + OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS, + OPT_NO_COMP_DIR_PATH, + OPT_NO_CORPUS_PATH, + OPT_NO_ELF_NEEDED, + OPT_NO_LEVERAGE_DWARF_FACTORIZATION, + OPT_NO_LINUX_KERNEL_MODE, + OPT_NO_LOAD_UNDEFINED_INTERFACES, + OPT_NO_PARAMETER_NAMES, + OPT_NO_SHOW_LOCS, + OPT_NO_WRITE_DEFAULT_SIZES, + OPT_NOOUT, + OPT_OUT_FILE, + OPT_SHORT_LOCS, + OPT_SHOW_STATS, + OPT_SUPPR, + OPT_TYPE_ID_STYLE, + OPT_VERBOSE, + OPT_VMLINUX, +}; + +static const struct argp_option argp_options[] = +{ + { "abidiff", OPT_ABIDIFF, 0, 0, + "compare the loaded ABI against itself", 0 }, + { "abixml-version", OPT_ABIXML_VERSION, 0, 0, + "display the version of the ABIXML ABI format", 0 }, + { "add-binaries", OPT_ADD_BINARIES, "BIN1,BIN2,..", 0, + "build a corpus group with the added binaries", 0 }, + { "added-binaries-dir", OPT_ADDED_BINS_DIR, "PATH", 0, + "where to look for dependencies or added binaries", 0 }, + { "abd", OPT_ADDED_BINS_DIR, "PATH", OPTION_ALIAS, 0, 0 }, + { "allow-non-exported-interfaces", OPT_ALLOW_NON_EXPORTED_INTERFACES, 0, 0, + "analyze interfaces that might not be exported", 0 }, + { "annotate", OPT_ANNOTATE, 0, 0, + "annotate the ABI artifacts emitted in the output", 0 }, +#ifdef WITH_BTF + { "btf", OPT_BTF, 0, 0, + "use BTF instead of DWARF in ELF files", 0 }, +#endif + { "check-alternate-debug-info", OPT_CHECK_ALT_DEBUG_INFO, "ELF-PATH", 0, + "check alternate debug info of ", 0 }, + { "check-alternate-debug-info-base-name", + OPT_CHECK_ALT_DEBUG_INFO_BASE_NAME, "ELF-PATH", 0, + "check alternate debug info of , and show its base name", 0 }, +#ifdef WITH_CTF + { "ctf", OPT_CTF, 0, 0, + "use CTF instead of DWARF in ELF files", 0 }, +#endif +#ifdef WITH_DEBUG_SELF_COMPARISON + { "debug-abidiff", OPT_DEBUG_ABIDIFF, 0, 0, + "debug the process of comparing the loaded ABI against itself", 0 }, +#endif +#ifdef WITH_DEBUG_TYPE_CANONICALIZATION + { "debug-dc", OPT_DEBUG_DC, 0, 0, + "debug the DIE canonicalization process", 0 }, + { "debug-tc", OPT_DEBUG_TC, 0, 0, + "debug the type canonicalization process", 0 }, +#endif + { "debug-info-dir", OPT_DEBUG_INFO_DIR, "PATH", 0, + "look for debug info under 'dir-path'", 0 }, + { "d", OPT_DEBUG_INFO_DIR, "PATH", OPTION_ALIAS, 0, 0 }, + { "drop-private-types", OPT_DROP_PRIVATE_TYPES, 0, 0, + "drop private types from internal representation", 0 }, + { "drop-undefined-syms", OPT_DROP_UNDEFINED_SYMS, 0, 0, + "drop undefined symbols from representation", 0 }, + { "exported-interfaces-only", OPT_EXPORTED_INTERFACES_ONLY, 0, 0, + "analyze exported interfaces only", 0 }, + { "fail-no-debug-info", OPT_FAIL_NO_DEBUG_INFO, 0, 0, + "bail out if no debug info was found", 0 }, + { "follow-dependencies", OPT_FDEPS, 0, 0, + "build a corpus group with the dependencies", 0 }, + { "force-early-suppression", OPT_FORCE_EARLY_SUPPRESSION, 0, 0, + "drop IR nodes that match suppression specifications", 0 }, + { "headers-dir", OPT_HD, "PATH", 0, + "the path to headers of the elf file", 0 }, + { "hd", OPT_HD, "PATH", OPTION_ALIAS, 0, 0 }, + { "header-file", OPT_HF, "PATH", 0, + "the path to one header of the elf file", 0 }, + { "hf", OPT_HF, "PATH", OPTION_ALIAS, 0, 0 }, + { "kmi-whitelist", OPT_KMI_WHITELIST, "PATH", 0, + "path to a linux kernel abi whitelist", 0 }, + { "kmi-stablelist", OPT_KMI_WHITELIST, "PATH", OPTION_ALIAS, 0, 0 }, + { "w", OPT_KMI_WHITELIST, "PATH", OPTION_ALIAS, 0, 0 }, + { "list-dependencies", OPT_LDEPS, 0, 0, + "list the dependencies of a given binary", 0 }, + { "linux-tree", OPT_LINUX_TREE, 0, 0, + "emit the ABI for the union of a vmlinux and its modules", 0 }, + { "lt", OPT_LINUX_TREE, 0, OPTION_ALIAS, 0, 0 }, + { "load-all-types", OPT_LOAD_ALL_TYPES, 0, 0, + "read all types including those not reachable from exported declarations", + 0 }, + { "no-architecture", OPT_NO_ARCH, 0, 0, + "do not emit architecture info in the output", 0 }, + { "no-assume-odr-for-cplusplus", OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS, 0, 0, + "do not assume the ODR to speed-up the analysis of the binary", 0 }, + { "no-comp-dir-path", OPT_NO_COMP_DIR_PATH, 0, 0, + "do not show compilation path information", 0 }, + { "no-corpus-path", OPT_NO_CORPUS_PATH, 0, 0, + "do not take the path to the corpora into account", 0 }, + { "no-elf-needed", OPT_NO_ELF_NEEDED, 0, 0, + "do not show the DT_NEEDED information", 0 }, + { "no-leverage-dwarf-factorization", OPT_NO_LEVERAGE_DWARF_FACTORIZATION, + 0, 0, + "do not use DWZ optimisations to speed-up the analysis of the binary", 0 }, + { "no-linux-kernel-mode", OPT_NO_LINUX_KERNEL_MODE, 0, 0, + "don't consider the input binary as a Linux Kernel binary", 0 }, + { "no-load-undefined-interfaces", OPT_NO_LOAD_UNDEFINED_INTERFACES, 0, 0, + "do not consider undefined interfaces from the binary", 0 }, + { "no-parameter-names", OPT_NO_PARAMETER_NAMES, 0, 0, + "do not show names of function parameters", 0 }, + { "no-show-locs", OPT_NO_SHOW_LOCS, 0, 0, + "do not show location information", 0 }, + { "no-write-default-sizes", OPT_NO_WRITE_DEFAULT_SIZES, 0, 0, + "do not emit pointer size when it equals the default address size of " + "the translation unit", 0 }, + { "noout", OPT_NOOUT, 0, 0, + "do not emit anything after reading the binary", 0 }, + { "out-file", OPT_OUT_FILE, "PATH", 0, + "write the output to 'file-path'", 0 }, + { "o", OPT_OUT_FILE, "PATH", OPTION_ALIAS, 0, 0 }, + { "short-locs", OPT_SHORT_LOCS, 0, 0, + "only print filenames rather than paths", 0 }, + { "stats", OPT_SHOW_STATS, 0, 0, + "show statistics about various internal stuff", 0 }, + { "suppressions", OPT_SUPPR, "PATH", 0, + "specify a suppression file", 0 }, + { "suppr", OPT_SUPPR, "PATH", OPTION_ALIAS, 0, 0 }, + { "type-id-style", OPT_TYPE_ID_STYLE, "STYLE", 0, + "type id style (sequence(default): \"type-id-\" + number; hash: " + "hex-digits)", 0 }, + { "verbose", OPT_VERBOSE, 0, 0, + "show verbose messages about internal stuff", 0 }, + { "vmlinux", OPT_VMLINUX, "PATH", 0, + "the path to the vmlinux binary to consider to emit the ABI of the union " + "of vmlinux and its modules", 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +static error_t +parse_opt(int key, char* arg, struct argp_state* state) +{ + options& opts = *static_cast(state->input); + const string argument = arg ? string(arg) : string(); + + switch (key) + { + case OPT_ABIDIFF: + opts.abidiff = true; + break; + + case OPT_ABIXML_VERSION: + opts.display_abixml_version = true; + break; + + case OPT_ADD_BINARIES: + if (argument.find(',') != string::npos) + tools_utils::split_string(argument, ",", opts.added_bins); + else + opts.added_bins.push_back(argument); + break; + + case OPT_ADDED_BINS_DIR: + opts.added_bins_dirs.push_back(argument); + break; + + case OPT_ALLOW_NON_EXPORTED_INTERFACES: + opts.exported_interfaces_only = false; + break; + + case OPT_ANNOTATE: + opts.annotate = true; + break; + +#ifdef WITH_BTF + case OPT_BTF: + opts.use_btf = true; + break; +#endif + + case OPT_CHECK_ALT_DEBUG_INFO: + if (opts.in_file_path.empty()) + opts.in_file_path = argument; + else + argp_usage(state); + opts.check_alt_debug_info_path = true; + break; + + case OPT_CHECK_ALT_DEBUG_INFO_BASE_NAME: + if (opts.in_file_path.empty()) + opts.in_file_path = argument; + else + argp_usage(state); + opts.check_alt_debug_info_path = true; + opts.show_base_name_alt_debug_info_path = true; + break; + +#ifdef WITH_CTF + case OPT_CTF: + opts.use_ctf = true; + break; +#endif + +#ifdef WITH_DEBUG_SELF_COMPARISON + case OPT_DEBUG_ABIDIFF: + opts.abidiff = true; + opts.debug_abidiff = true; + break; +#endif + +#ifdef WITH_DEBUG_TYPE_CANONICALIZATION + case OPT_DEBUG_DC: + opts.debug_die_canonicalization = true; + break; + + case OPT_DEBUG_TC: + opts.debug_type_canonicalization = true; + break; +#endif + + case OPT_DEBUG_INFO_DIR: + opts.di_root_paths.push_back + (abigail::tools_utils::make_path_absolute(argument)); + break; + + case OPT_DROP_PRIVATE_TYPES: + opts.drop_private_types = true; + break; + + case OPT_DROP_UNDEFINED_SYMS: + opts.drop_undefined_syms = true; + break; + + case OPT_EXPORTED_INTERFACES_ONLY: + opts.exported_interfaces_only = true; + break; + + case OPT_FAIL_NO_DEBUG_INFO: + opts.fail_no_debug_info = true; + break; + + case OPT_FDEPS: + opts.follow_dependencies = true; + break; + + case OPT_FORCE_EARLY_SUPPRESSION: + opts.force_early_suppression = true; + break; + + case OPT_HD: + opts.headers_dirs.push_back(argument); + opts.drop_private_types = true; + break; + + case OPT_HF: + opts.header_files.push_back(argument); + opts.drop_private_types = true; + break; + + case OPT_KMI_WHITELIST: + opts.kabi_whitelist_paths.push_back(argument); + break; + + case OPT_LDEPS: + opts.list_dependencies = true; + break; + + case OPT_LINUX_TREE: + opts.corpus_group_for_linux = true; + break; + + case OPT_LOAD_ALL_TYPES: + opts.load_all_types = true; + break; + + case OPT_NO_ARCH: + opts.write_architecture = false; + break; + + case OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS: + opts.assume_odr_for_cplusplus = false; + break; + + case OPT_NO_COMP_DIR_PATH: + opts.write_comp_dir = false; + break; + + case OPT_NO_CORPUS_PATH: + opts.write_corpus_path = false; + break; + + case OPT_NO_ELF_NEEDED: + opts.write_elf_needed = false; + break; + + case OPT_NO_LEVERAGE_DWARF_FACTORIZATION: + opts.leverage_dwarf_factorization = false; + break; + + case OPT_NO_LINUX_KERNEL_MODE: + opts.linux_kernel_mode = false; + break; + + case OPT_NO_LOAD_UNDEFINED_INTERFACES: + opts.load_undefined_interfaces = false; + break; + + case OPT_NO_PARAMETER_NAMES: + opts.write_parameter_names = false; + break; + + case OPT_NO_SHOW_LOCS: + opts.show_locs = false; + break; + + case OPT_NO_WRITE_DEFAULT_SIZES: + opts.default_sizes = false; + break; + + case OPT_NOOUT: + opts.noout = true; + break; + + case OPT_OUT_FILE: + if (!opts.out_file_path.empty()) + argp_usage(state); + opts.out_file_path = argument; + break; + + case OPT_SHORT_LOCS: + opts.short_locs = true; + break; + + case OPT_SHOW_STATS: + opts.show_stats = true; + break; + + case OPT_SUPPR: + opts.suppression_paths.push_back(argument); + break; + + case OPT_TYPE_ID_STYLE: + if (argument == "sequence") + opts.type_id_style = SEQUENCE_TYPE_ID_STYLE; + else if (argument == "hash") + opts.type_id_style = HASH_TYPE_ID_STYLE; + else + argp_usage(state); + break; + + case OPT_VERBOSE: + opts.do_log = true; + break; + + case OPT_VMLINUX: + opts.vmlinux = argument; + break; + + case ARGP_KEY_ARG: + if (opts.in_file_path.empty()) + opts.in_file_path = argument; + else + argp_usage(state); + break; + + default: + return ARGP_ERR_UNKNOWN; + } + + return 0; +} + +static const char* argp_args_doc = "[]"; +static const char* argp_doc = + "Read an ELF file, load its debug info and emit it in the native " + "libabigail XML format."; + +static const struct argp abidw_argp = +{ + argp_options, + parse_opt, + argp_args_doc, + argp_doc, + 0, + 0, + 0 +}; + +static void +print_abidw_version(FILE *stream, struct argp_state* /*state*/) +{ + fprintf(stream, "abidw %s\n", + abigail::tools_utils::get_library_version_string().c_str()); +} + +/// Version printing hook to be passed to ARGP. +/// +/// @param stream the output stream. +/// +/// @param state the ARGP state. +static bool +parse_command_line(int argc, char* argv[], options& opts) +{ + argp_program_version_hook = print_abidw_version; + argp_program_bug_address = ""; + + if (argp_parse(&abidw_argp, argc, argv, 0, 0, &opts) != 0) + return false; + return true; +} + int main(int argc, char* argv[]) { @@ -1168,24 +1287,13 @@ main(int argc, char* argv[]) if (!parse_command_line(argc, argv, opts) || (opts.in_file_path.empty() - && !opts.display_version && !opts.display_abixml_version)) { - if (!opts.wrong_option.empty()) - emit_prefix(argv[0], cerr) - << "unrecognized option: " << opts.wrong_option << "\n"; - display_usage(argv[0], cerr); + char* prog_name = (char*) "abidw"; + argp_help(&abidw_argp, stderr, ARGP_HELP_USAGE, prog_name); return 1; } - if (opts.display_version) - { - emit_prefix(argv[0], cout) - << abigail::tools_utils::get_library_version_string() - << "\n"; - return 0; - } - if (opts.display_abixml_version) { emit_prefix(argv[0], cout) diff --git a/tools/abilint.cc b/tools/abilint.cc index 4799d429..85d10789 100644 --- a/tools/abilint.cc +++ b/tools/abilint.cc @@ -14,6 +14,7 @@ /// be empty. #include "config.h" +#include #include #include #include @@ -74,9 +75,7 @@ using abigail::xml_writer::write_corpus_to_archive; struct options { - string wrong_option; string file_path; - bool display_version; bool read_from_stdin; bool read_tu; bool diff; @@ -95,8 +94,7 @@ struct options #endif options() - : display_version(false), - read_from_stdin(false), + : read_from_stdin(false), read_tu(false), diff(false), noout(false), @@ -480,157 +478,6 @@ show_how_type_is_used(abigail::fe_iface &iface, const string& type_id) } #endif // WITH_SHOW_TYPE_USE_IN_ABILINT -static void -display_usage(const string& prog_name, ostream& out) -{ - emit_prefix(prog_name, out) - << "usage: " << prog_name << " [options] []\n" - << " where options can be:\n" - << " --annotate annotate the ABI artifacts emitted in the output\n" - << " --verbose show verbose messages about internal stuff\n" -#ifdef WITH_CTF - << " --ctf use CTF instead of DWARF in ELF files\n" -#endif - << " --debug-info-dir the path under which to look for " - "debug info for the elf \n" - << " --diff for xml inputs, perform a text diff between " - "the input and the memory model saved back to disk\n" - << " --header-file|--hf the path to one header of the elf file\n" - << " --headers-dir|--hd the path to headers of the elf file\n" - << " --help display this message\n" - << " --noout do not display anything on stdout\n" -#ifdef WITH_SHOW_TYPE_USE_IN_ABILINT - << " --show-type-use show how a type is used from the abixml file\n" -#endif - << " --stdin read abi-file content from stdin\n" - << " --suppressions|--suppr specify a suppression file\n" - << " --tu expect a single translation unit file\n" - << " --version|-v display program version information and exit\n" - ; -} - -bool -parse_command_line(int argc, char* argv[], options& opts) -{ - if (argc < 2) - { - opts.read_from_stdin = true; - return true; - } - - for (int i = 1; i < argc; ++i) - { - if (argv[i][0] != '-') - { - if (opts.file_path.empty()) - opts.file_path = argv[i]; - else - return false; - } - else if (!strcmp(argv[i], "--help")) - return false; - else if (!strcmp(argv[i], "--version") - || !strcmp(argv[i], "-v")) - { - opts.display_version = true; - return true; - } - else if (!strcmp(argv[i], "--debug-info-dir")) - { - if (argc <= i + 1 - || argv[i + 1][0] == '-') - return false; - // elfutils wants the root path to the debug info to be - // absolute. - opts.di_root_path = - abigail::tools_utils::make_path_absolute(string(argv[i + 1])); - ++i; - } - else if (!strcmp(argv[i], "--headers-dir") - || !strcmp(argv[i], "--hd")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.headers_dir = argv[j]; - ++i; - } - else if (!strcmp(argv[i], "--header-file") - || !strcmp(argv[i], "--hf")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.header_files.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--suppressions") - || !strcmp(argv[i], "--suppr")) - { - int j = i + 1; - if (j >= argc) - { - opts.wrong_option = argv[i]; - return true; - } - opts.suppression_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--stdin")) - opts.read_from_stdin = true; - else if (!strcmp(argv[i], "--tu")) - opts.read_tu = true; -#ifdef WITH_CTF - else if (!strcmp(argv[i], "--ctf")) - opts.use_ctf = true; -#endif - else if (!strcmp(argv[i], "--diff")) - opts.diff = true; - else if (!strcmp(argv[i], "--noout")) - opts.noout = true; - else if (!strcmp(argv[i], "--annotate")) - opts.annotate = true; - else if (!strcmp(argv[i], "--verbose")) - opts.do_log = true; -#ifdef WITH_SHOW_TYPE_USE_IN_ABILINT - else if (!strcmp(argv[i], "--show-type-use")) - { - ++i; - if (i >= argc || argv[i][0] == '-') - return false; - opts.type_id_to_show = argv[i]; - } -#endif - else - { - if (strlen(argv[i]) >= 2 && argv[i][0] == '-' && argv[i][1] == '-') - opts.wrong_option = argv[i]; - return false; - } - } - -#ifdef WITH_SHOW_TYPE_USE_IN_ABILINT - if (!opts.type_id_to_show.empty() - && opts.file_path.empty()) - emit_prefix(argv[0], cout) - << "WARNING: --show-type-use " - "must be accompanied with an abixml file\n"; - - if (opts.file_path.empty() - && opts.type_id_to_show.empty()) - opts.read_from_stdin = true; -#endif - - if (opts.read_from_stdin && !opts.file_path.empty()) - { - emit_prefix(argv[0], cout) - << "WARNING: The \'--stdin\' option is used. The " - << opts.file_path << " will be ignored automatically\n"; - } - - return true; -} - /// Check that the suppression specification files supplied are /// present. If not, emit an error on stderr. /// @@ -696,6 +543,203 @@ set_reader_options(abigail::fe_iface& reader, const options& opts) reader.options().do_log = opts.do_log; } +enum option_key +{ + OPT_ANNOTATE = 256, +#ifdef WITH_CTF + OPT_CTF, +#endif + OPT_DEBUG_INFO_DIR, + OPT_DIFF, + OPT_HD, + OPT_HF, + OPT_NOOUT, +#ifdef WITH_SHOW_TYPE_USE_IN_ABILINT + OPT_SHOW_TYPE_USE, +#endif + OPT_STDIN, + OPT_SUPPR, + OPT_TU, + OPT_VERBOSE +}; + +static const struct argp_option argp_options[] = +{ + { "annotate", OPT_ANNOTATE, 0, 0, + "annotate the ABI artifacts emitted in the output", 0 }, +#ifdef WITH_CTF + { "ctf", OPT_CTF, 0, 0, + "use CTF instead of DWARF in ELF files", 0 }, +#endif + { "debug-info-dir", OPT_DEBUG_INFO_DIR, "PATH", 0, + "the path under which to look for debug info for the elf ", 0 }, + { "diff", OPT_DIFF, 0, 0, + "for xml inputs, perform a text diff between " + "the input and the memory model saved back to disk", 0 }, + { "headers-dir", OPT_HD, "PATH", 0, + "the path to headers of the elf file", 0 }, + { "hd", OPT_HD, "PATH", OPTION_ALIAS, 0, 0 }, + { "header-file", OPT_HF, "PATH", 0, + "the path to one header of the elf file", 0 }, + { "hf", OPT_HF, "PATH", OPTION_ALIAS, 0, 0 }, + { "noout", OPT_NOOUT, 0, 0, + "do not display anything on stdout", 0 }, +#ifdef WITH_SHOW_TYPE_USE_IN_ABILINT + { "show-type-use", OPT_SHOW_TYPE_USE, "TYPE-ID", 0, + "show how a type is used from the abixml file", 0 }, +#endif + { "stdin", OPT_STDIN, 0, 0, + "read abi-file content from stdin", 0 }, + { "suppressions", OPT_SUPPR, "PATH", 0, + "specify a suppression file", 0 }, + { "suppr", OPT_SUPPR, "PATH", OPTION_ALIAS, 0, 0 }, + { "tu", OPT_TU, 0, 0, + "expect a single translation unit file", 0 }, + { "verbose", OPT_VERBOSE, 0, 0, + "show verbose messages about internal stuff", 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +static error_t +parse_opt(int key, char* arg, struct argp_state* state) +{ + options& opts = *static_cast(state->input); + const string argument = arg ? string(arg) : string(); + + switch (key) + { + case OPT_ANNOTATE: + opts.annotate = true; + break; + +#ifdef WITH_CTF + case OPT_CTF: + opts.use_ctf = true; + break; +#endif + + case OPT_DEBUG_INFO_DIR: + opts.di_root_path = + abigail::tools_utils::make_path_absolute(argument); + break; + + case OPT_DIFF: + opts.diff = true; + break; + + case OPT_HD: + opts.headers_dir = argument; + break; + + case OPT_HF: + opts.header_files.push_back(argument); + break; + + case OPT_NOOUT: + opts.noout = true; + break; + +#ifdef WITH_SHOW_TYPE_USE_IN_ABILINT + case OPT_SHOW_TYPE_USE: + opts.type_id_to_show = argument; + break; +#endif + + case OPT_STDIN: + opts.read_from_stdin = true; + break; + + case OPT_SUPPR: + opts.suppression_paths.push_back(argument); + break; + + case OPT_TU: + opts.read_tu = true; + break; + + case OPT_VERBOSE: + opts.do_log = true; + break; + + case ARGP_KEY_ARG: + if (opts.file_path.empty()) + opts.file_path = argument; + else + argp_usage(state); + break; + + case ARGP_KEY_END: +#ifdef WITH_SHOW_TYPE_USE_IN_ABILINT + if (!opts.type_id_to_show.empty() && opts.file_path.empty()) + emit_prefix("abilint", cout) + << "WARNING: --show-type-use " + "must be accompanied with an abixml file\n"; + + if (opts.file_path.empty() && opts.type_id_to_show.empty()) + opts.read_from_stdin = true; +#else + if (opts.file_path.empty()) + opts.read_from_stdin = true; +#endif + if (opts.read_from_stdin && !opts.file_path.empty()) + emit_prefix("abilint", cout) + << "WARNING: The '--stdin' option is used. The " + << opts.file_path << " will be ignored automatically\n"; + break; + + default: + return ARGP_ERR_UNKNOWN; + } + + return 0; +} + +static const char* argp_args_doc = "[]"; +static const char* argp_doc = + "Read an ABI instrumentation file in native XML format and check its " + "integrity."; + +static const struct argp abilint_argp = +{ + argp_options, + parse_opt, + argp_args_doc, + argp_doc, + 0, + 0, + 0 +}; + +/// Version printing hook to be passed to ARGP. +/// +/// @param stream the output stream. +/// +/// @param state the ARGP state. +void +print_abilint_version(FILE *stream, struct argp_state* /*state*/) +{ + fprintf(stream, "abilint %s\n", + abigail::tools_utils::get_library_version_string().c_str()); +} + +/// Parse the command line +/// +/// @param argc number of args +/// +/// @param argv the array of arguments. +/// +/// @param opts the options set as result of command line parsing. +bool +parse_command_line(int argc, char* argv[], options& opts) +{ + argp_program_bug_address = ""; + argp_program_version_hook = print_abilint_version; + + if (argp_parse(&abilint_argp, argc, argv, 0, 0, &opts) != 0) + return false; + return true; +} + /// Reads a bi (binary instrumentation) file, saves it back to a /// temporary file and run a diff on the two versions. int @@ -706,21 +750,11 @@ main(int argc, char* argv[]) options opts; if (!parse_command_line(argc, argv, opts)) { - if (!opts.wrong_option.empty()) - emit_prefix(argv[0], cerr) - << "unrecognized option: " << opts.wrong_option << "\n"; - display_usage(argv[0], cerr); + char* prog_name = (char*)"abilint"; + argp_help(&abilint_argp, stderr, ARGP_HELP_USAGE, prog_name); return 1; } - if (opts.display_version) - { - emit_prefix(argv[0], cout) - << abigail::tools_utils::get_library_version_string() - << "\n"; - return 0; - } - if (!maybe_check_suppression_files(opts)) return 1; diff --git a/tools/abipkgdiff.cc b/tools/abipkgdiff.cc index 3bb90dfb..eb28f4b2 100644 --- a/tools/abipkgdiff.cc +++ b/tools/abipkgdiff.cc @@ -55,6 +55,7 @@ #include "config.h" #include +#include #include #include @@ -178,12 +179,8 @@ class options options(); public: - string wrong_option; - string wrong_arg; + vector wrong_args; string prog_name; - bool display_usage; - bool display_version; - bool missing_operand; bool nonexistent_file; bool abignore; bool parallel; @@ -194,6 +191,7 @@ public: string devel_package1; string devel_package2; size_t num_workers; + unsigned last_seen_set; bool verbose; bool verbose_diff; bool drop_private_types; @@ -238,12 +236,10 @@ public: options(const string& program_name) : prog_name(program_name), - display_usage(), - display_version(), - missing_operand(), nonexistent_file(), abignore(true), parallel(true), + last_seen_set(0), verbose(), verbose_diff(), drop_private_types(), @@ -971,82 +967,6 @@ package::extracted_packages_parent_dir() /// A convenience typedef for shared_ptr of package. typedef shared_ptr package_sptr; -/// Show the usage of this program. -/// -/// @param prog_name the name of the program. -/// -/// @param out the output stream to emit the usage to . -static void -display_usage(const string& prog_name, ostream& out) -{ - emit_prefix(prog_name, out) - << "usage: " << prog_name << " [options] \n" - << " where options can be:\n" - << " --debug-info-pkg1|--d1 path of debug-info package of package1\n" - << " --debug-info-pkg2|--d2 path of debug-info package of package2\n" - << " --devel-pkg1|--devel1 path of devel package of pakage1\n" - << " --devel-pkg2|--devel2 path of devel package of pakage1\n" - << " --drop-private-types drop private types from " - "internal representation\n" - << " --no-default-suppression don't load any default " - "suppression specifications\n" - << " --suppressions|--suppr specify supression specification path\n" - << " --linux-kernel-abi-whitelist|-w path to a " - "linux kernel abi whitelist\n" - << " --wp path to a linux kernel abi whitelist package\n" - << " --keep-tmp-files don't erase created temporary files\n" - << " --dso-only compare shared libraries only\n" - << " --private-dso compare DSOs that are private " - "to the package as well\n" - << " --leaf-changes-only|-l only show leaf changes, " - "so no change impact analysis (implies --redundant)\n" - << " --impacted-interfaces|-i display interfaces impacted by leaf changes\n" - << " --full-impact|-f when comparing kernel packages, show the " - "full impact analysis report rather than the default leaf changes reports\n" - << " --non-reachable-types|-t consider types non reachable" - " from public interfaces\n" - << " --exported-interfaces-only analyze exported interfaces only\n" - << " --allow-non-exported-interfaces analyze interfaces that " - "might not be exported\n" - << " --no-linkage-name do not display linkage names of " - "added/removed/changed\n" - << " --redundant display redundant changes\n" - << " --harmless display the harmless changes\n" - << " --no-show-locs do not show location information\n" - << " --ignore-soname do not take the SONAMEs into account\n" - << " --show-bytes show size and offsets in bytes\n" - << " --show-bits show size and offsets in bits\n" - << " --show-hex show size and offset in hexadecimal\n" - << " --show-dec show size and offset in decimal\n" - << " --no-show-relative-offset-changes do not show relative" - " offset changes\n" - << " --no-added-syms do not display added functions or variables\n" - << " --no-unreferenced-symbols do not display changes " - "about symbols not referenced by debug info\n" - << " --no-added-binaries do not display added binaries\n" - << " --no-abignore do not look for *.abignore files\n" - << " --no-parallel do not execute in parallel\n" - << " --fail-no-dbg fail if no debug info was found\n" - << " --show-identical-binaries show the names of identical binaries\n" - << " --no-leverage-dwarf-factorization do not use DWZ optimisations to " - "speed-up the analysis of the binary\n" - << " --no-assume-odr-for-cplusplus do not assume the ODR to speed-up the" - "analysis of the binary\n" - << " --verbose emit verbose progress messages\n" - << " --verbose-diff emit verbose diff progress messages\n" - << " --self-check perform a sanity check by comparing " - "binaries inside the input package against their ABIXML representation\n" -#ifdef WITH_CTF - << " --ctf use CTF instead of DWARF in ELF files\n" -#endif -#ifdef WITH_BTF - << " --btf use BTF instead of DWARF in ELF files\n" -#endif - << " --help|-h display this help message\n" - << " --version|-v display program version information" - " and exit\n"; -} - #ifdef WITH_RPM /// Extract an RPM package. @@ -3759,278 +3679,489 @@ compare(const package_set_sptr& first_ps, return compare(first_ps, second_ps, diff, opts); } -/// Parse the command line of the current program. -/// -/// @param argc the number of arguments in the @p argv parameter. -/// -/// @param argv the array of arguemnts passed to the function. The -/// first argument is the name of this program. -/// -/// @param opts the resulting options. -/// -/// @return true upon successful parsing. -static bool -parse_command_line(int argc, char* argv[], options& opts) -{ - if (argc < 2) - return false; - for (int i = 1; i < argc; ++i) - { - if (argv[i][0] != '-') - { - if (opts.package_set_paths1.empty()) - { - string path = make_path_absolute(argv[i]).get(); - opts.package_set_paths1.insert(path); - opts.nonexistent_file = !file_exists(path); - } - else if (opts.package_set_paths2.empty()) - { - string path = make_path_absolute(argv[i]).get(); - opts.package_set_paths2.insert(path); - opts.nonexistent_file = !file_exists(path); - } - else - { - opts.wrong_arg = argv[i]; - return false; - } +enum option_key +{ + OPT_ALLOW_NON_EXPORTED_INTERFACES = 256, + OPT_BTF, + OPT_CTF, + OPT_D1, + OPT_D2, + OPT_DEVEL1, + OPT_DEVEL2, + OPT_DROP_PRIVATE_TYPES, + OPT_DSO_ONLY, + OPT_EXPORTED_INTERFACES_ONLY, + OPT_FAIL_NO_DBG, + OPT_FULL_IMPACT, + OPT_HARMLESS, + OPT_IGNORE_SONAME, + OPT_IMPACTED_INTERFACES, + OPT_KEEP_TMP_FILES, + OPT_KMI_WHITELIST, + OPT_KMI_WHITELIST_PKG, + OPT_LEAF_CHANGES_ONLY, + OPT_NO_ABIGNORE, + OPT_NO_ADDED_BINARIES, + OPT_NO_ADDED_SYMS, + OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS, + OPT_NO_DEFAULT_SUPPRESSION, + OPT_NO_LEVERAGE_DWARF_FACTORIZATION, + OPT_NO_LINKAGE_NAME, + OPT_NO_PARALLEL, + OPT_NO_SHOW_LOCS, + OPT_NO_SHOW_RELATIVE_OFFSET_CHANGES, + OPT_NO_UNREFERENCED_SYMBOLS, + OPT_NON_REACHABLE_TYPES, + OPT_PRIVATE_DSO, + OPT_REDUNDANT, + OPT_SELF_CHECK, + OPT_SET1, + OPT_SET2, + OPT_SHOW_BITS, + OPT_SHOW_BYTES, + OPT_SHOW_DEC, + OPT_SHOW_HEX, + OPT_SHOW_IDENTICAL_BINARIES, + OPT_SUPPR, + OPT_VERBOSE, + OPT_VERBOSE_DIFF +}; - if (opts.nonexistent_file) - { - opts.wrong_arg = argv[i]; - return true; - } - } - else if (!strcmp(argv[i], "--set1") - || !strcmp(argv[i], "--set2")) - { - bool is_set1 = !strcmp(argv[i], "--set1"); - set& set = - is_set1 ? opts.package_set_paths1 : opts.package_set_paths2; - for (int j = i + 1; j < argc; ++j) - { - if (argv[j][0] == '-') - { - i = j - 1; - break; - } - const char* p = argv[j]; - string pkg_path = make_path_absolute(p).get(); - if (!opts.nonexistent_file) - opts.nonexistent_file = !file_exists(pkg_path); - if (opts.nonexistent_file && opts.wrong_arg.empty()) - opts.wrong_arg = pkg_path; - set.insert(pkg_path); - i = j; - } - if (!opts.wrong_arg.empty()) - return false; - } - else if (!strcmp(argv[i], "--debug-info-pkg1") - || !strcmp(argv[i], "--d1")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.debug_packages1.push_back - (abigail::tools_utils::make_path_absolute(argv[j]).get()); - ++i; - } - else if (!strcmp(argv[i], "--debug-info-pkg2") - || !strcmp(argv[i], "--d2")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.debug_packages2.push_back - (abigail::tools_utils::make_path_absolute(argv[j]).get()); - ++i; - } - else if (!strcmp(argv[i], "--devel-pkg1") - || !strcmp(argv[i], "--devel1")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.devel_package1 = - abigail::tools_utils::make_path_absolute(argv[j]).get(); - ++i; - } - else if (!strcmp(argv[i], "--devel-pkg2") - || !strcmp(argv[i], "--devel2")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.devel_package2 = - abigail::tools_utils::make_path_absolute(argv[j]).get(); - ++i; - } - else if (!strcmp(argv[i], "--drop-private-types")) - opts.drop_private_types = true; - else if (!strcmp(argv[i], "--no-default-suppression")) - opts.no_default_suppression = true; - else if (!strcmp(argv[i], "--keep-tmp-files")) - opts.keep_tmp_files = true; - else if (!strcmp(argv[i], "--dso-only")) - opts.compare_dso_only = true; - else if (!strcmp(argv[i], "--private-dso")) - opts.compare_private_dsos = true; - else if (!strcmp(argv[i], "--leaf-changes-only") - ||!strcmp(argv[i], "-l")) - opts.leaf_changes_only = true; - else if (!strcmp(argv[i], "--impacted-interfaces") - ||!strcmp(argv[i], "-i")) - opts.show_impacted_interfaces = true; - else if (!strcmp(argv[i], "--non-reachable-types") - ||!strcmp(argv[i], "-t")) - opts.show_all_types = true; - else if (!strcmp(argv[i], "--full-impact") - ||!strcmp(argv[i], "-f")) - opts.show_full_impact_report = true; - else if (!strcmp(argv[i], "--exported-interfaces-only")) - opts.exported_interfaces_only = true; - else if (!strcmp(argv[i], "--allow-non-exported-interfaces")) - opts.exported_interfaces_only = false; - else if (!strcmp(argv[i], "--no-linkage-name")) - opts.show_linkage_names = false; - else if (!strcmp(argv[i], "--redundant")) - opts.show_redundant_changes = true; - else if (!strcmp(argv[i], "--harmless")) - opts.show_harmless_changes = true; - else if (!strcmp(argv[i], "--no-show-locs")) - opts.show_locs = false; - else if (!strcmp(argv[i], "--show-bytes")) - opts.show_offsets_sizes_in_bits = false; - else if (!strcmp(argv[i], "--show-bits")) - opts.show_offsets_sizes_in_bits = true; - else if (!strcmp(argv[i], "--show-hex")) - opts.show_hexadecimal_values = true; - else if (!strcmp(argv[i], "--show-dec")) - opts.show_hexadecimal_values = false; - else if (!strcmp(argv[i], "--no-show-relative-offset-changes")) - opts.show_relative_offset_changes = false; - else if (!strcmp(argv[i], "--no-added-syms")) - opts.show_added_syms = false; - else if (!strcmp(argv[i], "--no-unreferenced-symbols")) - opts.show_symbols_not_referenced_by_debug_info = false; - else if (!strcmp(argv[i], "--no-added-binaries")) - opts.show_added_binaries = false; - else if (!strcmp(argv[i], "--fail-no-dbg")) - opts.fail_if_no_debug_info = true; - else if (!strcmp(argv[i], "--no-leverage-dwarf-factorization")) - opts.leverage_dwarf_factorization = false; - else if (!strcmp(argv[i], "--no-assume-odr-for-cplusplus")) - opts.assume_odr_for_cplusplus = false; - else if (!strcmp(argv[i], "--verbose")) - opts.verbose = true; - else if (!strcmp(argv[i], "--verbose-diff")) - { - opts.verbose_diff = true; - opts.verbose = true; - } - else if (!strcmp(argv[i], "--no-abignore")) - opts.abignore = false; - else if (!strcmp(argv[i], "--no-parallel")) - opts.parallel = false; - else if (!strcmp(argv[i], "--show-identical-binaries")) - opts.show_identical_binaries = true; - else if (!strcmp(argv[i], "--self-check")) - opts.self_check = true; - else if (!strcmp(argv[i], "--suppressions") - || !strcmp(argv[i], "--suppr")) - { - int j = i + 1; - if (j >= argc) - return false; - opts.suppression_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--linux-kernel-abi-whitelist") - || !strcmp(argv[i], "-w")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - if (guess_file_type(argv[j]) == abigail::tools_utils::FILE_TYPE_RPM) - // The kernel abi stablelist is actually a stablelist - // *package*. Take that into account. - opts.kabi_stablelist_packages.push_back - (make_path_absolute(argv[j]).get()); - else - // We assume the kernel abi stablelist is a white list - // file. - opts.kabi_stablelist_paths.push_back(argv[j]); - ++i; - } - else if (!strcmp(argv[i], "--wp")) - { - int j = i + 1; - if (j >= argc) - { - opts.missing_operand = true; - opts.wrong_option = argv[i]; - return true; - } - opts.kabi_stablelist_packages.push_back - (make_path_absolute(argv[j]).get()); - ++i; - } +static const struct argp_option argp_options[] = +{ + { "allow-non-exported-interfaces", OPT_ALLOW_NON_EXPORTED_INTERFACES, 0, 0, + "analyze interfaces that might not be exported", 0 }, +#ifdef WITH_BTF + { "btf", OPT_BTF, 0, 0, + "use BTF instead of DWARF in ELF files", 0 }, +#endif #ifdef WITH_CTF - else if (!strcmp(argv[i], "--ctf")) - opts.use_ctf = true; + { "ctf", OPT_CTF, 0, 0, + "use CTF instead of DWARF in ELF files", 0 }, #endif + { "debug-info-pkg1", OPT_D1, "PATH", 0, + "path of debug-info package of package1", 0 }, + { "d1", OPT_D1, "PATH", OPTION_ALIAS, 0, 0 }, + { "debug-info-pkg2", OPT_D2, "PATH", 0, + "path of debug-info package of package2", 0 }, + { "d2", OPT_D2, "PATH", OPTION_ALIAS, 0, 0 }, + { "devel-pkg1", OPT_DEVEL1, "PATH", 0, + "path of devel package of package1", 0 }, + { "devel1", OPT_DEVEL1, "PATH", OPTION_ALIAS, 0, 0 }, + { "devel-pkg2", OPT_DEVEL2, "PATH", 0, + "path of devel package of package2", 0 }, + { "devel2", OPT_DEVEL2, "PATH", OPTION_ALIAS, 0, 0 }, + { "drop-private-types", OPT_DROP_PRIVATE_TYPES, 0, 0, + "drop private types from internal representation", 0 }, + { "dso-only", OPT_DSO_ONLY, 0, 0, + "compare shared libraries only", 0 }, + { "exported-interfaces-only", OPT_EXPORTED_INTERFACES_ONLY, 0, 0, + "analyze exported interfaces only", 0 }, + { "fail-no-dbg", OPT_FAIL_NO_DBG, 0, 0, + "fail if no debug info was found", 0 }, + { "full-impact", OPT_FULL_IMPACT, 0, 0, + "when comparing kernel packages, show the full impact analysis report " + "rather than the default leaf changes reports", 0 }, + { "f", OPT_FULL_IMPACT, 0, OPTION_ALIAS, 0, 0 }, + { "harmless", OPT_HARMLESS, 0, 0, + "display the harmless changes", 0 }, + { "ignore-soname", OPT_IGNORE_SONAME, 0, 0, + "do not take the SONAMEs into account", 0 }, + { "impacted-interfaces", OPT_IMPACTED_INTERFACES, 0, 0, + "display interfaces impacted by leaf changes", 0 }, + { "i", OPT_IMPACTED_INTERFACES, 0, OPTION_ALIAS, 0, 0 }, + { "keep-tmp-files", OPT_KEEP_TMP_FILES, 0, 0, + "don't erase created temporary files", 0 }, + { "linux-kernel-abi-whitelist", OPT_KMI_WHITELIST, "PATH", 0, + "path to a linux kernel abi whitelist", 0 }, + { "w", OPT_KMI_WHITELIST, "PATH", OPTION_ALIAS, 0, 0 }, + { "wp", OPT_KMI_WHITELIST_PKG, "PATH", 0, + "path to a linux kernel abi whitelist package", 0 }, + { "leaf-changes-only", OPT_LEAF_CHANGES_ONLY, 0, 0, + "only show leaf changes, so no change impact analysis " + "(implies --redundant)", 0 }, + { "l", OPT_LEAF_CHANGES_ONLY, 0, OPTION_ALIAS, 0, 0 }, + { "no-abignore", OPT_NO_ABIGNORE, 0, 0, + "do not look for *.abignore files", 0 }, + { "no-added-binaries", OPT_NO_ADDED_BINARIES, 0, 0, + "do not display added binaries", 0 }, + { "no-added-syms", OPT_NO_ADDED_SYMS, 0, 0, + "do not display added functions or variables", 0 }, + { "no-assume-odr-for-cplusplus", OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS, 0, 0, + "do not assume the ODR to speed-up the analysis of the binary", 0 }, + { "no-default-suppression", OPT_NO_DEFAULT_SUPPRESSION, 0, 0, + "don't load any default suppression specifications", 0 }, + { "no-leverage-dwarf-factorization", OPT_NO_LEVERAGE_DWARF_FACTORIZATION, + 0, 0, + "do not use DWZ optimisations to speed-up the analysis of the binary", + 0 }, + { "no-linkage-name", OPT_NO_LINKAGE_NAME, 0, 0, + "do not display linkage names of added/removed/changed", 0 }, + { "no-parallel", OPT_NO_PARALLEL, 0, 0, + "do not execute in parallel", 0 }, + { "no-show-locs", OPT_NO_SHOW_LOCS, 0, 0, + "do not show location information", 0 }, + { "no-show-relative-offset-changes", + OPT_NO_SHOW_RELATIVE_OFFSET_CHANGES, 0, 0, + "do not show relative offset changes", 0 }, + { "no-unreferenced-symbols", OPT_NO_UNREFERENCED_SYMBOLS, 0, 0, + "do not display changes about symbols not referenced by debug info", 0 }, + { "non-reachable-types", OPT_NON_REACHABLE_TYPES, 0, 0, + "consider types non reachable from public interfaces", 0 }, + { "t", OPT_NON_REACHABLE_TYPES, 0, OPTION_ALIAS, 0, 0 }, + { "private-dso", OPT_PRIVATE_DSO, 0, 0, + "compare DSOs that are private to the package as well", 0 }, + { "redundant", OPT_REDUNDANT, 0, 0, + "display redundant changes", 0 }, + { "self-check", OPT_SELF_CHECK, 0, 0, + "perform a sanity check by comparing binaries inside the input package " + "against their ABIXML representation", 0 }, + { "set1", OPT_SET1, "PKG1[,PKG2,..] | PKG1[ PKG2 ..]", 0, + "the first set of packages to compare", 0 }, + { "set2", OPT_SET2, "PKG1[,PKG2,..] | PKG1[ PKG2 ..]", 0, + "the second set of packages to compare", 0 }, + { "show-bits", OPT_SHOW_BITS, 0, 0, + "show size and offsets in bits", 0 }, + { "show-bytes", OPT_SHOW_BYTES, 0, 0, + "show size and offsets in bytes", 0 }, + { "show-dec", OPT_SHOW_DEC, 0, 0, + "show size and offset in decimal", 0 }, + { "show-hex", OPT_SHOW_HEX, 0, 0, + "show size and offset in hexadecimal", 0 }, + { "show-identical-binaries", OPT_SHOW_IDENTICAL_BINARIES, 0, 0, + "show the names of identical binaries", 0 }, + { "suppressions", OPT_SUPPR, "PATH", 0, + "specify a suppression file", 0 }, + { "suppr", OPT_SUPPR, "PATH", OPTION_ALIAS, 0, 0 }, + { "verbose", OPT_VERBOSE, 0, 0, + "emit verbose progress messages", 0 }, + { "verbose-diff", OPT_VERBOSE_DIFF, 0, 0, + "emit verbose diff progress messages", 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +static error_t +parse_opt(int key, char* arg, struct argp_state* state) +{ + options& opts = *static_cast(state->input); + const string argument = arg ? string(arg) : string(); + + if (key != OPT_SET1 + && key != OPT_SET2 + && key != ARGP_KEY_ARG) + // Reset the opts.last_seen_set if we see an option that is neiter + // --set1 not --set2. + opts.last_seen_set = 0; + + + switch (key) + { + case OPT_ALLOW_NON_EXPORTED_INTERFACES: + opts.exported_interfaces_only = false; + break; + #ifdef WITH_BTF - else if (!strcmp(argv[i], "--btf")) - opts.use_btf = true; + case OPT_BTF: + opts.use_btf = true; + break; #endif - else if (!strcmp(argv[i], "--ignore-soname")) - { - opts.ignore_soname = true; - opts.show_identical_binaries = true; - } - else if (!strcmp(argv[i], "--help") - || !strcmp(argv[i], "-h")) - { - opts.display_usage = true; - return true; - } - else if (!strcmp(argv[i], "--version") - || !strcmp(argv[i], "-v")) - { - opts.display_version = true; - return true; - } + +#ifdef WITH_CTF + case OPT_CTF: + opts.use_ctf = true; + break; +#endif + + case OPT_D1: + opts.debug_packages1.push_back + (abigail::tools_utils::make_path_absolute(argument)); + break; + + case OPT_D2: + opts.debug_packages2.push_back + (abigail::tools_utils::make_path_absolute(argument)); + break; + + case OPT_DEVEL1: + opts.devel_package1 = + abigail::tools_utils::make_path_absolute(argument); + break; + + case OPT_DEVEL2: + opts.devel_package2 = + abigail::tools_utils::make_path_absolute(argument); + break; + + case OPT_DROP_PRIVATE_TYPES: + opts.drop_private_types = true; + break; + + case OPT_DSO_ONLY: + opts.compare_dso_only = true; + break; + + case OPT_EXPORTED_INTERFACES_ONLY: + opts.exported_interfaces_only = true; + break; + + case OPT_FAIL_NO_DBG: + opts.fail_if_no_debug_info = true; + break; + + case OPT_FULL_IMPACT: + opts.show_full_impact_report = true; + break; + + case OPT_HARMLESS: + opts.show_harmless_changes = true; + break; + + case OPT_IGNORE_SONAME: + opts.ignore_soname = true; + opts.show_identical_binaries = true; + break; + + case OPT_IMPACTED_INTERFACES: + opts.show_impacted_interfaces = true; + break; + + case OPT_KEEP_TMP_FILES: + opts.keep_tmp_files = true; + break; + + case OPT_KMI_WHITELIST: + if (guess_file_type(argument) == abigail::tools_utils::FILE_TYPE_RPM) + opts.kabi_stablelist_packages.push_back(make_path_absolute(argument)); else - { - if (strlen(argv[i]) >= 2 && argv[i][0] == '-' && argv[i][1] == '-') - opts.wrong_option = argv[i]; - return false; - } + opts.kabi_stablelist_paths.push_back(argument); + break; + + case OPT_KMI_WHITELIST_PKG: + opts.kabi_stablelist_packages.push_back + (make_path_absolute(argument)); + break; + + case OPT_LEAF_CHANGES_ONLY: + opts.leaf_changes_only = true; + break; + + case OPT_NO_ABIGNORE: + opts.abignore = false; + break; + + case OPT_NO_ADDED_BINARIES: + opts.show_added_binaries = false; + break; + + case OPT_NO_ADDED_SYMS: + opts.show_added_syms = false; + break; + + case OPT_NO_ASSUME_ODR_FOR_CPLUSPLUS: + opts.assume_odr_for_cplusplus = false; + break; + + case OPT_NO_DEFAULT_SUPPRESSION: + opts.no_default_suppression = true; + break; + + case OPT_NO_LEVERAGE_DWARF_FACTORIZATION: + opts.leverage_dwarf_factorization = false; + break; + + case OPT_NO_LINKAGE_NAME: + opts.show_linkage_names = false; + break; + + case OPT_NO_PARALLEL: + opts.parallel = false; + break; + + case OPT_NO_SHOW_LOCS: + opts.show_locs = false; + break; + + case OPT_NO_SHOW_RELATIVE_OFFSET_CHANGES: + opts.show_relative_offset_changes = false; + break; + + case OPT_NO_UNREFERENCED_SYMBOLS: + opts.show_symbols_not_referenced_by_debug_info = false; + break; + + case OPT_NON_REACHABLE_TYPES: + opts.show_all_types = true; + break; + + case OPT_PRIVATE_DSO: + opts.compare_private_dsos = true; + break; + + case OPT_REDUNDANT: + opts.show_redundant_changes = true; + break; + + case OPT_SELF_CHECK: + opts.self_check = true; + break; + + case OPT_SET1: + { + opts.last_seen_set = 1; + vector paths; + if (!tools_utils::split_string(argument, ",", paths) + && !argument.empty()) + paths.push_back(argument); + for (auto& p : paths) + { + string abs_p = make_path_absolute(p); + if (!file_exists(abs_p)) + { + opts.nonexistent_file = true; + opts.wrong_args.push_back(abs_p); + } + else + opts.package_set_paths1.insert(abs_p); + } + } + break; + + case OPT_SET2: + { + opts.last_seen_set = 2; + vector paths; + if (!tools_utils::split_string(argument, ",", paths) + && !argument.empty()) + paths.push_back(argument); + for (auto& p : paths) + { + string abs_p = make_path_absolute(p); + if (!file_exists(abs_p)) + { + opts.nonexistent_file = true; + opts.wrong_args.push_back(abs_p); + } + else + opts.package_set_paths2.insert(abs_p); + } + } + break; + + case OPT_SHOW_BITS: + opts.show_offsets_sizes_in_bits = true; + break; + + case OPT_SHOW_BYTES: + opts.show_offsets_sizes_in_bits = false; + break; + + case OPT_SHOW_DEC: + opts.show_hexadecimal_values = false; + break; + + case OPT_SHOW_HEX: + opts.show_hexadecimal_values = true; + break; + + case OPT_SHOW_IDENTICAL_BINARIES: + opts.show_identical_binaries = true; + break; + + case OPT_SUPPR: + opts.suppression_paths.push_back(argument); + break; + + case OPT_VERBOSE: + opts.verbose = true; + break; + + case OPT_VERBOSE_DIFF: + opts.verbose_diff = true; + opts.verbose = true; + break; + + case ARGP_KEY_ARG: + { + string path = make_path_absolute(argument); + if (!file_exists(path)) + { + // This is later handled in the main function so that the + // program can return an appropriate return code from + // there, so we don't need an ARGP_KEY_END case to handle + // it. + opts.nonexistent_file = true; + opts.wrong_args.push_back(path); + } + else if (opts.last_seen_set == 1) + opts.package_set_paths1.insert(path); + else if (opts.last_seen_set == 2) + opts.package_set_paths2.insert(path); + else + { + if (opts.package_set_paths1.empty()) + opts.package_set_paths1.insert(path); + else if (opts.package_set_paths2.empty()) + opts.package_set_paths2.insert(path); + else + argp_usage(state); + } + } + break; + + default: + return ARGP_ERR_UNKNOWN; } + return 0; +} + +static const char* argp_args_doc = "[ ]"; +static const char* argp_doc = + "Compare the ABI of binaries in two packages, returning 0 if they are " + "identical, or non-zero if they differ."; + +static const struct argp abipkgdiff_argp = +{ + argp_options, + parse_opt, + argp_args_doc, + argp_doc, + 0, + 0, + 0 +}; + +/// Version printing hook to be passed to ARGP. +/// +/// @param stream the output stream. +/// +/// @param state the ARGP state. +static void +print_abipkgdiff_version(FILE *stream, struct argp_state* /*state*/) +{ + fprintf(stream, "abipkgdiff %s\n", + abigail::tools_utils::get_library_version_string().c_str()); +} + +typedef void (*program_version_hook_type) (FILE *__restrict __stream, + struct argp_state *__restrict __state); + +/// Parse the command line +/// +/// @param argc number of args +/// +/// @param argv the array of arguments. +/// +/// @param opts the options set as result of command line parsing. +static bool +parse_command_line(int argc, char* argv[], options& opts) +{ + argp_program_version_hook = print_abipkgdiff_version; + argp_program_bug_address = ""; + + if (argp_parse(&abipkgdiff_argp, argc, argv, 0, 0, &opts) != 0) + return false; return true; } @@ -4043,34 +4174,39 @@ main(int argc, char* argv[]) if (!parse_command_line(argc, argv, opts)) { - if (!opts.wrong_option.empty()) - emit_prefix("abipkgdiff", cerr) - << "unrecognized option: " << opts.wrong_option - << "\ntry the --help option for more information\n"; - if (!opts.wrong_arg.empty()) - emit_prefix("abipkgdiff", cerr) - << "unrecognized argument: " << opts.wrong_arg - << "\ntry the --help option for more information\n"; - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); - } - - if (opts.missing_operand) - { - emit_prefix("abipkgdiff", cerr) - << "missing operand\n" - "try the --help option for more information\n"; + char* prog_name = (char*) "abipkgdiff"; + argp_help(&abipkgdiff_argp, stderr, ARGP_HELP_USAGE, prog_name); return (abigail::tools_utils::ABIDIFF_USAGE_ERROR | abigail::tools_utils::ABIDIFF_ERROR); } if (opts.nonexistent_file) { + vector input_files; string input_file; - base_name(opts.wrong_arg, input_file); - emit_prefix("abipkgdiff", cerr) - << "The input file " << input_file << " doesn't exist\n" - "try the --help option for more information\n"; + for (auto& f : opts.wrong_args) + { + base_name(f, input_file); + input_files.push_back(input_file); + } + bool plural = input_files.size() > 1; + + if (plural) + emit_prefix("abipkgdiff", cerr) + << "Input files"; + else + emit_prefix("abipkgdiff", cerr) + << "The input file"; + for (auto& f : input_files) + cerr << " " << f; + + if (plural) + cerr << " don't exist\n"; + else + cerr << " doesn't exist\n"; + + cerr << "try the --help option for more information\n"; + return (abigail::tools_utils::ABIDIFF_USAGE_ERROR | abigail::tools_utils::ABIDIFF_ERROR); } @@ -4083,21 +4219,6 @@ main(int argc, char* argv[]) | abigail::tools_utils::ABIDIFF_ERROR); } - if (opts.display_usage) - { - display_usage(argv[0], cout); - return (abigail::tools_utils::ABIDIFF_USAGE_ERROR - | abigail::tools_utils::ABIDIFF_ERROR); - } - - if (opts.display_version) - { - emit_prefix(argv[0], cout) - << abigail::tools_utils::get_library_version_string() - << "\n"; - return 0; - } - if (!opts.no_default_suppression && opts.suppression_paths.empty()) { // Load the default system and user suppressions. @@ -4129,9 +4250,11 @@ main(int argc, char* argv[]) } if (opts.package_set_paths1.empty()) { + char* prog_name = (char*) "abipkgdiff"; // We need at least one package to work with! emit_prefix("abipkgdiff", cerr) << "missing input package\n"; + argp_help(&abipkgdiff_argp, stderr, ARGP_HELP_USAGE, prog_name); if (bail_out) return (abigail::tools_utils::ABIDIFF_USAGE_ERROR | abigail::tools_utils::ABIDIFF_ERROR); @@ -4139,8 +4262,10 @@ main(int argc, char* argv[]) } else if(opts.package_set_paths1.empty() && opts.package_set_paths2.empty()) { + char* prog_name = (char*) "abipkgdiff"; emit_prefix("abipkgdiff", cerr) << "please enter two packages to compare" << "\n"; + argp_help(&abipkgdiff_argp, stderr, ARGP_HELP_USAGE, prog_name); return (abigail::tools_utils::ABIDIFF_USAGE_ERROR | abigail::tools_utils::ABIDIFF_ERROR); } @@ -4217,9 +4342,11 @@ main(int argc, char* argv[]) if (is_kernel_package(first_package_set) != is_kernel_package(second_package_set)) { + char* prog_name = (char*) "abipkgdiff"; emit_prefix("abipkgdiff", cerr) << "a Linux kernel package can only be compared to another " "Linux kernel package\n"; + argp_help(&abipkgdiff_argp, stderr, ARGP_HELP_USAGE, prog_name); return (abigail::tools_utils::ABIDIFF_USAGE_ERROR | abigail::tools_utils::ABIDIFF_ERROR); } @@ -4228,9 +4355,11 @@ main(int argc, char* argv[]) || (!second_package_set->path().empty() && second_package_set->debug_info_packages().empty())) { + char* prog_name = (char*) "abipkgdiff"; emit_prefix("abipkgdiff", cerr) << "a Linux Kernel package must be accompanied with its " "debug info package\n"; + argp_help(&abipkgdiff_argp, stderr, ARGP_HELP_USAGE, prog_name); return (abigail::tools_utils::ABIDIFF_USAGE_ERROR | abigail::tools_utils::ABIDIFF_ERROR); } diff --git a/tools/abisym.cc b/tools/abisym.cc index 9b37ca1a..1c4a2513 100644 --- a/tools/abisym.cc +++ b/tools/abisym.cc @@ -10,6 +10,7 @@ /// This program takes parameters to open an elf file, lookup a symbol /// in its symbol tables and report what it sees. +#include #include #include #include @@ -34,76 +35,112 @@ using abigail::elf_symbol_sptr; struct options { - bool show_help; - bool display_version; - char* elf_path; - char* symbol_name; + string elf_path; + string symbol_name; bool demangle; bool absolute_path; options() - : show_help(false), - display_version(false), - elf_path(0), - symbol_name(0), - demangle(false), + : demangle(false), absolute_path(true) {} }; + +enum option_key +{ + OPT_DEMANGLE = 256, + OPT_NO_ABSOLUTE_PATH, +}; + +static const struct argp_option argp_options[] = +{ + { "demangle", OPT_DEMANGLE, 0, 0, + "demangle the symbols from the symbol table", 0 }, + { "no-absolute-path", OPT_NO_ABSOLUTE_PATH, 0, 0, + "do not show absolute paths in messages", 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +static error_t +parse_opt(int key, char* arg, struct argp_state* state) +{ + options& opts = *static_cast(state->input); + const string argument = arg ? string(arg) : string(); + + switch (key) + { + case OPT_DEMANGLE: + opts.demangle = true; + break; + + case OPT_NO_ABSOLUTE_PATH: + opts.absolute_path = false; + break; + + case ARGP_KEY_ARG: + if (opts.elf_path.empty()) + opts.elf_path = argument; + else if (opts.symbol_name.empty()) + opts.symbol_name = argument; + else + argp_usage(state); + break; + + case ARGP_KEY_END: + if (opts.elf_path.empty() || opts.symbol_name.empty()) + argp_usage(state); + break; + + default: + return ARGP_ERR_UNKNOWN; + } + + return 0; +} + +static const char* argp_args_doc = " "; +static const char* argp_doc = + "Look up a symbol in the symbol table of an ELF file and report " + "information about it."; + +static const struct argp abisym_argp = +{ + argp_options, + parse_opt, + argp_args_doc, + argp_doc, + 0, + 0, + 0 +}; + +/// Version printing hook to be passed to ARGP. +/// +/// @param stream the output stream. +/// +/// @param state the ARGP state. static void -display_usage(const string& prog_name, ostream &out) +print_abisym_version(FILE *stream, struct argp_state* /*state*/) { - out << "usage: " << prog_name << " [options] \n" - << "where [options] can be:\n" - << " --help display this help string\n" - << " --version|-v display program version information and exit\n" - << " --demangle demangle the symbols from the symbol table\n" - << " --no-absolute-path do not show absolute paths in messages\n"; + fprintf(stream, "abisym %s\n", + abigail::tools_utils::get_library_version_string().c_str()); } +/// Parse the command line +/// +/// @param argc number of args +/// +/// @param argv the array of arguments. +/// +/// @param opts the options set as result of command line parsing. static void parse_command_line(int argc, char* argv[], options& opts) { - if (argc < 2) - { - opts.show_help = true; - return; - } + argp_program_version_hook = print_abisym_version; + argp_program_bug_address = ""; - for (int i = 1; i < argc; ++i) - { - if (argv[i][0] != '-') - { - if (!opts.elf_path) - opts.elf_path = argv[i]; - else if (!opts.symbol_name) - opts.symbol_name = argv[i] ; - else - { - opts.show_help = true; - return; - } - } - else if (!strcmp(argv[i], "--help") - || !strcmp(argv[i], "-h")) - { - opts.show_help = true; - return; - } - else if (!strcmp(argv[i], "--version") - || !strcmp(argv[i], "-v")) - { - opts.display_version = true; - return; - } - else if (!strcmp(argv[i], "--demangle")) - opts.demangle = true; - else if (!strcmp(argv[i], "--no-absolute-path")) - opts.absolute_path = false; - else - opts.show_help = true; - } + argp_parse(&abisym_argp, argc, argv, 0, 0, &opts); } int @@ -112,23 +149,6 @@ main(int argc, char* argv[]) options opts; parse_command_line(argc, argv, opts); - if (opts.show_help) - { - display_usage(argv[0], cout); - return 1; - } - - if (opts.display_version) - { - abigail::tools_utils::emit_prefix(argv[0], cout) - << abigail::tools_utils::get_library_version_string() - << "\n"; - return 0; - } - - assert(opts.elf_path != 0 - && opts.symbol_name != 0); - string p = opts.elf_path, n = opts.symbol_name; environment env; vector syms; @@ -140,7 +160,11 @@ main(int argc, char* argv[]) if (opts.absolute_path) cout << opts.elf_path << "'\n"; else - cout << basename(opts.elf_path); + { + string b; + abigail::tools_utils::base_name(opts.elf_path, b); + cout << b; + } return 0; } diff --git a/tools/binilint.cc b/tools/binilint.cc index c410256e..2958ad0d 100644 --- a/tools/binilint.cc +++ b/tools/binilint.cc @@ -12,9 +12,11 @@ /// abigail::ini::* functions, but one could also use it to make sure /// that an ini file can be handled by the abigail::ini::* facilities +#include #include #include #include "abg-ini.h" +#include "abg-tools-utils.h" using std::cout; using std::cerr; @@ -28,83 +30,108 @@ using abigail::ini::write_config; struct options { - bool display_usage; bool read_from_stdin; bool no_out; - bool wrong_command_line_usage; string path; options () - : display_usage(false), - read_from_stdin(false), - no_out(false), - wrong_command_line_usage(false) + : read_from_stdin(false), + no_out(false) {} }; +enum option_key +{ + OPT_FROM_STDIN = 256, + OPT_NOOUT, +}; + +static const struct argp_option argp_options[] = +{ + { "from-stdin", OPT_FROM_STDIN, 0, 0, + "read the input ini file from stdin", 0 }, + { "noout", OPT_NOOUT, 0, 0, + "do not output anything on stdout", 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +static error_t +parse_opt(int key, char* arg, struct argp_state* state) +{ + options& opts = *static_cast(state->input); + const string argument = arg ? string(arg) : string(); + + switch (key) + { + case OPT_FROM_STDIN: + opts.read_from_stdin = true; + break; + + case OPT_NOOUT: + opts.no_out = true; + break; + + case ARGP_KEY_ARG: + if (opts.path.empty()) + opts.path = argument; + else + argp_usage(state); + break; + + default: + return ARGP_ERR_UNKNOWN; + } + + return 0; +} + +static const char* argp_args_doc = "[]"; +static const char* argp_doc = + "Read an ini file and print it back on standard output."; + +static const struct argp binilint_argp = +{ + argp_options, + parse_opt, + argp_args_doc, + argp_doc, + 0, + 0, + 0 +}; + static void -display_usage(const string& prog_name, ostream& out) +print_binilint_version(FILE *stream, struct argp_state* /*state*/) { - out << "usage: " << prog_name << " [options] \n" - << "where options can be:\n" - << "--help display this help\n" - << "--from-stdin read the input ini file from stdin\n" - << "--noout do not output anything on stdout\n" - ; + fprintf(stream, "abinilint %s\n", + abigail::tools_utils::get_library_version_string().c_str()); } static bool parse_command_line(int argc, char* argv[], options& opts) { - if (argc == 1) - return false; + argp_program_version_hook = print_binilint_version; + argp_program_bug_address = ""; - for (int i = 1; i < argc; ++i) - { - if (argv[i][0] != '-') - { - if (opts.path.empty()) - opts.path = argv[i]; - else - opts.wrong_command_line_usage = true; - } - else if (!strcmp(argv[i], "--help")) - opts.display_usage = true; - else if (!strcmp(argv[i], "--from-stdin")) - opts.read_from_stdin = true; - else if (!strcmp(argv[i], "--noout")) - opts.no_out = true; - else - return false; - } + if (argp_parse(&binilint_argp, argc, argv, 0, 0, &opts) != 0) + return false; return true; } int main(int argc, char* argv[]) { - // First, parse the command line. - options opts; - - if (argc == 1 || !parse_command_line(argc, argv, opts)) + if (!parse_command_line(argc, argv, opts)) { - cerr << argv[0] << ": bad command usage\n" - << "Try " << argv[0] << " --help for more information\n"; + char* prog_name = (char*) "abinilint"; + argp_help(&binilint_argp, stderr, ARGP_HELP_USAGE, prog_name); return 1; } - // Then if we need to display the help, display it and get out. - - if (opts.display_usage) - { - display_usage(argv[0], cout); - return 0; - } - - // Otherwise, do the real work we are supposed to do after all. - // That real work is driven by the options the user set; these - // options are recorded in the opts variable. + // Do the real work we are supposed to do after all. That real work + // is driven by the options the user set; these options are recorded + // in the opts variable. config_sptr conf;