From patchwork Tue Jan 3 10:28:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Pavlu X-Patchwork-Id: 62663 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 34EC73858D39 for ; Tue, 3 Jan 2023 10:32:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 34EC73858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672741925; bh=qZALRWql4qj6xjLZX8sKXU2fIEleFhNWkzdDnLVObgw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Help:List-Subscribe:From:Reply-To:From; b=KgrA4xz5B+Oa1Is9Y6fLrUD24OnwcGaNF6lWhUTfxOmkG0FlR2jAxxA115a1eH8ql TVczO9lAxrR1Ul1xPtL6AEqNqDm3kMYZMXM6VIWYMeFZ8E91QRrCBJJEXtHIKHmDwn kVOLCbWGoZWTycYy62kYK1ub86amoui8CAzmmRpg= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 7BA563858D1E for ; Tue, 3 Jan 2023 10:31:59 +0000 (GMT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9906C61241; Tue, 3 Jan 2023 10:31:58 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 833351392B; Tue, 3 Jan 2023 10:31:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Lf0NHx4EtGM4RQAAMHmgww (envelope-from ); Tue, 03 Jan 2023 10:31:58 +0000 To: libabigail@sourceware.org Cc: petr.pavlu@suse.com Subject: [PATCH] abidiff: Fix handling of linux-kernel-mode Date: Tue, 3 Jan 2023 11:28:55 +0100 Message-Id: <20230103102855.21686-1-petr.pavlu@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Petr Pavlu via Libabigail From: Petr Pavlu Reply-To: Petr Pavlu Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" This fixes 08e76022 ("Support Linux Kernel ABI whitelist files") and 8fd02e0a ("Use the CTF reader by default when applicable"). The first commit removed handling of option --no-linux-kernel-mode. The second one stopped passing opts.linux_kernel_mode down to the library which also caused changing the default linux-kernel-mode of abidiff from true to false. Both changes look unintentional as they are not mentioned in either commit message. Restore handling of the linux-kernel-mode in abidiff to match what is described in doc/manuals/abidiff.rst and make it again consistent with abidw. * tools/abidiff.cc (parse_command_line): Recognize --no-linux-kernel-mode. (main): Pass opts.linux_kernel_mode down to the library. Signed-off-by: Petr Pavlu --- tools/abidiff.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/abidiff.cc b/tools/abidiff.cc index b27d8b08..91a626a9 100644 --- a/tools/abidiff.cc +++ b/tools/abidiff.cc @@ -434,6 +434,8 @@ parse_command_line(int argc, char* argv[], options& opts) 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")) @@ -1235,7 +1237,8 @@ main(int argc, char* argv[]) create_best_elf_based_reader(opts.file1, opts.prepared_di_root_paths1, env, requested_fe_kind, - opts.show_all_types); + opts.show_all_types, + opts.linux_kernel_mode); ABG_ASSERT(rdr); set_generic_options(*rdr, opts); set_suppressions(*rdr, opts); @@ -1307,7 +1310,8 @@ main(int argc, char* argv[]) create_best_elf_based_reader(opts.file2, opts.prepared_di_root_paths2, env, requested_fe_kind, - opts.show_all_types); + opts.show_all_types, + opts.linux_kernel_mode); ABG_ASSERT(rdr); set_generic_options(*rdr, opts);