From patchwork Tue Jan 10 09:58:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 62884 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 2F9BF3858404 for ; Tue, 10 Jan 2023 09:58:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F9BF3858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673344734; bh=JofCyPowOEKj79sB3UK4ilXL00dbMGOeP9MtBIIkE+I=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=hr52MV79UzWF0L+dvVPtsoG/VGjNe6tRABOPcLAxuuEn0GDZQxE8n7mIoggv69yxD bEJHyeMc95GW5YZO/j/K/HI5+mZl0BONKOH95dtRuuIw7T45fMUhOSQQSmMQlEN4Gy gnIJ1QG0J2DA1uBXPNx24ee5XFpXrzwY3suHvM1w= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2E2F0385842C for ; Tue, 10 Jan 2023 09:58:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E2F0385842C Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-145-3XSd2I9NMLS9ZrpLs2mMfA-1; Tue, 10 Jan 2023 04:58:46 -0500 X-MC-Unique: 3XSd2I9NMLS9ZrpLs2mMfA-1 Received: by mail-qt1-f199.google.com with SMTP id fp22-20020a05622a509600b003ab920c4c89so5241953qtb.1 for ; Tue, 10 Jan 2023 01:58:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JofCyPowOEKj79sB3UK4ilXL00dbMGOeP9MtBIIkE+I=; b=r2nvlvjHTye0BoQcX5pfuZvFpakptbscOwqC2Bh0/WltG9w1+YqHS0sGjSylaKbbD0 Qh8gqVVZjm1cIatw89txV3oR8pNLYRctEy5PMMrrJJ/TrVjM1JsyT3fDxkxeK6TS2Lex BUY7KhTqCG48BWuP6eeg1YXGb0C3tJnwYphqoOixFD8VNTUEqTG/ghRoORPce4PF3LiR sbbJ+41gbUZkCcb7JeTKwOgeZHFiy6IgZ0ehmDFJLn5D/AlqzG/nkz5wL/OXe+3RMjY4 fdfWG3jrZplOKz5hnnFrJeaBBJlmzmvzFXEcotqkbjo1oV9wIimAqH3QjRErK2E+H2Hd 6IVQ== X-Gm-Message-State: AFqh2krv076tVADvSaERXLcJPx0pHw0eUO6xll6soPyV8gSpwFNe0GXY ZM59ybpQNcQm1WvAOQ/y43i3t9gOvoRhZUGjS/CCNhFMji9CPZIb8zNVAH5tXjbiS+i5wStisol bm4/p1vamOR1/FIRVWFdIBnGtKxL5YNZufNm8rWplGLPhHB4FSShbw6Gk9yOooXimOWVF X-Received: by 2002:ac8:71d8:0:b0:3a9:6908:6d00 with SMTP id i24-20020ac871d8000000b003a969086d00mr98412327qtp.26.1673344725824; Tue, 10 Jan 2023 01:58:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXsfv+GAfnu/gYAu2YeMkyV9wMIbN3s+V3sJk9D8ive5x/fO9WzyMofrrzQhHIY+3s33eOZLMQ== X-Received: by 2002:ac8:71d8:0:b0:3a9:6908:6d00 with SMTP id i24-20020ac871d8000000b003a969086d00mr98412304qtp.26.1673344725409; Tue, 10 Jan 2023 01:58:45 -0800 (PST) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id g16-20020a05620a13d000b00702d1c6e7bbsm6727184qkl.130.2023.01.10.01.58.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 01:58:44 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id 95011C1B80DD; Tue, 10 Jan 2023 10:58:42 +0100 (CET) To: libabigail@sourceware.org Subject: [PATCH, applied] Better detect suitable libctf version Organization: Red Hat / France X-Operating-System: AlmaLinux 9.1 X-URL: http://www.redhat.com Date: Tue, 10 Jan 2023 10:58:42 +0100 Message-ID: <87fscig17x.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, On some el9 distros, the version of libctf installed might not have all the necessary features for the libabigail CTF reader, leading to compilation errors due to missing types from the ctf-api.h header file. For instance, the ctf-api.h on some of those distros lacks the definition of the type struct ctf_dict_t. This patch adds a configure test for that struct and disables the CTF support if that type is absent. * configure.ac: If the "struct ctf_dict_t" type is not present in the version of ctf-api.h that is present, then switch the support of CTF off. Signed-off-by: Dodji Seketeli --- configure.ac | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d2896020..d19c2f96 100644 --- a/configure.ac +++ b/configure.ac @@ -333,6 +333,23 @@ if test x$ENABLE_CTF != xno; then AC_CHECK_LIB(ctf, ctf_open, [LIBCTF=yes], [LIBCTF=no]) fi + if test x$LIBCTF = xyes; then + dnl Test if struct btf_enum64 is present. + AC_CHECK_TYPE([struct ctf_dict_t], + [HAVE_CTF_DICT_T=yes], + [HAVE_CTF_DICT_T=no], + [#include ]) + + if test x$HAVE_CTF_DICT_T = xyes; then + AC_DEFINE([HAVE_CTF_DICT_T], 1, [struct ctf_dict_t is present]) + fi + fi + + if test x$HAVE_CTF_DICT_T = xno; then + AC_MSG_NOTICE([Some needed data structures are missing from ctf-api.h. Disabling CTF support.]) + LIBCTF=no + fi + if test x$LIBCTF = xyes; then AC_MSG_NOTICE([CTF support enabled]) AC_DEFINE([WITH_CTF], 1, @@ -340,7 +357,7 @@ if test x$ENABLE_CTF != xno; then CTF_LIBS=-lctf ENABLE_CTF=yes else - AC_MSG_NOTICE([no libctf found, CTF support was disabled]) + AC_MSG_NOTICE([no suitable libctf found, CTF support was disabled]) ENABLE_CTF=no fi fi