From patchwork Sat Feb 1 11:31:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 37639 Received: (qmail 72923 invoked by alias); 1 Feb 2020 11:31:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 72915 invoked by uid 89); 1 Feb 2020 11:31:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=25155, ctf, eliz@gnu.org, U*eliz X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 01 Feb 2020 11:31:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7C1711176C6; Sat, 1 Feb 2020 06:31:50 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id R1gsF6beBkGe; Sat, 1 Feb 2020 06:31:50 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 15B7E117672; Sat, 1 Feb 2020 06:31:50 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id B649282C47; Sat, 1 Feb 2020 15:31:45 +0400 (+04) From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Eli Zaretskii , Nick Alcock Subject: [pushed/gdb-9-branch] libctf: compilation failure on MinGW due to missing errno values Date: Sat, 1 Feb 2020 15:31:33 +0400 Message-Id: <20200201113133.28211-1-brobecker@adacore.com> From: Eli Zaretskii Hello, Just a quick email to confirm that I pushed this patch to the gdb-9-branch, to prepare for the GDB 9 release. Initially, we wanted to release this week, but we found last minute an issue which is serious-enough to hold the release. --------------------------------------------------------------------------- This commit fixes a compilation failure in a couple of libctf files due to the use of EOVERFLOW and ENOTSUP, which are not defined when compiling on MinGW. libctf/ChangeLog: PR binutils/25155: * ctf-create.c (EOVERFLOW): If not defined by system header, redirect to ERANGE as a poor man's substitute. * ctf-subr.c (ENOTSUP): If not defined, use ENOSYS instead. This one is how Eli implemented it. I think this implementation has a weakness in the following sense: If other units in libctf start using those constants, we'll get the same error again. Also, I'm wondering whether their use is documented as part of the official libtcf API or not -- users might be writing code that tests for these, and if the system doesn't support them, how would they know what errno code to use in its place. This argues for a having that information in one of libctf's header files. I think it would be nice to have those in ctf-decls.h, but I think we'll need to include in ctf-decls.h if we decide to define those macros there. Rather than second-guess what the CTF developers would prefer, I'm starting by sending Eli's patch, to see what you guys think. --- libctf/ChangeLog | 7 +++++++ libctf/ctf-create.c | 4 ++++ libctf/ctf-subr.c | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 5843cd92e1e..940f4022e15 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,10 @@ +2020-02-01 Eli Zaretskii + + PR binutils/25155: + * ctf-create.c (EOVERFLOW): If not defined by system header, + redirect to ERANGE as a poor man's substitute. + * ctf-subr.c (ENOTSUP): If not defined, use ENOSYS instead. + 2020-01-05 Joel Brobecker PR binutils/25155: diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c index fa40100c770..84aa4526a30 100644 --- a/libctf/ctf-create.c +++ b/libctf/ctf-create.c @@ -23,6 +23,10 @@ #include #include +#ifndef EOVERFLOW +#define EOVERFLOW ERANGE +#endif + #ifndef roundup #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) #endif diff --git a/libctf/ctf-subr.c b/libctf/ctf-subr.c index 6bd7f10aeea..cc275c507c9 100644 --- a/libctf/ctf-subr.c +++ b/libctf/ctf-subr.c @@ -26,6 +26,10 @@ #include #include +#ifndef ENOTSUP +#define ENOTSUP ENOSYS +#endif + int _libctf_version = CTF_VERSION; /* Library client version. */ int _libctf_debug = 0; /* Debugging messages enabled. */