Summary: | libctf directory doesn't compile with MinGW | ||
---|---|---|---|
Product: | binutils | Reporter: | Eli Zaretskii <eliz> |
Component: | libctf | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | cbiesinger, nick.alcock, zhongyunde |
Priority: | P2 | ||
Version: | 2.33 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | Proposed patch to fix the problems with MinGW compilation |
Description
Eli Zaretskii
2019-11-02 13:03:20 UTC
Created attachment 12146 [details]
Proposed patch to fix the problems with MinGW compilation
To perhaps expedite the fix of the MinGW build problems, I propose a patch in the attachment.
Thank you.
Thank you! (And sorry for not noticing this bug flying by.) I'm looking at this now (see recent traffic on the mailing list). All the patches Joel has proposed look good, but I think I have a way to fix the E* class of problems for all time, at the cost of a slight API break affecting no existing users (see the RFC patch I just posted). The master branch has been updated by Joel Brobecker <brobecke@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3a657c600bde2d3bd84870f75968622bbdb69ce8 commit 3a657c600bde2d3bd84870f75968622bbdb69ce8 Author: Eli Zaretskii <eliz@gnu.org> Date: Sun Jan 5 09:50:27 2020 +0400 libctf: Add configure check for asprintf (for MinGW) This commit fixes a compilation warning when compiling libctf on MinGW: libctf/ctf-dump.c:118:8: warning: implicit declaration of function 'asprintf'; did you mean 'vasprintf'? [-Wimplicit-function-declaration] if (asprintf (&bit, " %lx: [slice 0x%x:0x%x]", ^~~~~~~~ vasprintf MinGW doesn't provide that function, so we depend on the one provided by libiberty. However, the declaration is guarded by HAVE_DECL_ASPRINTF, which we do not have in libctf's config.h. libctf/ChangeLog: PR binutils/25155: * configure.ac: Add AC_CHECK_DECLS([asprintf]). * configure, config.h.in: Regenerate. The gdb-9-branch branch has been updated by Joel Brobecker <brobecke@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=84baa6a51500a6e6faf422ab12f61c5c9857cfd0 commit 84baa6a51500a6e6faf422ab12f61c5c9857cfd0 Author: Eli Zaretskii <eliz@gnu.org> Date: Sun Jan 5 09:50:27 2020 +0400 libctf: Add configure check for asprintf (for MinGW) This commit fixes a compilation warning when compiling libctf on MinGW: libctf/ctf-dump.c:118:8: warning: implicit declaration of function 'asprintf'; did you mean 'vasprintf'? [-Wimplicit-function-declaration] if (asprintf (&bit, " %lx: [slice 0x%x:0x%x]", ^~~~~~~~ vasprintf MinGW doesn't provide that function, so we depend on the one provided by libiberty. However, the declaration is guarded by HAVE_DECL_ASPRINTF, which we do not have in libctf's config.h. libctf/ChangeLog: PR binutils/25155: * configure.ac: Add AC_CHECK_DECLS([asprintf]). * configure, config.h.in: Regenerate. (cherry picked from commit 3a657c600bde2d3bd84870f75968622bbdb69ce8) The gdb-9-branch branch has been updated by Joel Brobecker <brobecke@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=50500ecfefd6acc4c7f6c2a95bc0ae1945103220 commit 50500ecfefd6acc4c7f6c2a95bc0ae1945103220 Author: Eli Zaretskii <eliz@gnu.org> Date: Sat Feb 1 15:25:19 2020 +0400 libctf: compilation failure on MinGW due to missing errno values 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 <errno.h> 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. Thanks, -- Joel The master branch has been updated by Joel Brobecker <brobecke@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=555adca2e3bcabdef58abf2f68291e47479bc09d commit 555adca2e3bcabdef58abf2f68291e47479bc09d Author: Eli Zaretskii <eliz@gnu.org> Date: Sun Jul 26 16:06:02 2020 -0700 libctf: compilation failure on MinGW due to missing errno values 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. (cherry picked from commit 50500ecfefd6acc4c7f6c2a95bc0ae1945103220) This seems to have been fixed (by Eli: thank you!) for some time now. |