bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/25155] New: libctf directory doesn't compile with MinGW


From: eliz at gnu dot org
Subject: [Bug binutils/25155] New: libctf directory doesn't compile with MinGW
Date: Sat, 02 Nov 2019 13:03:20 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25155

            Bug ID: 25155
           Summary: libctf directory doesn't compile with MinGW
           Product: binutils
           Version: 2.33
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: eliz at gnu dot org
  Target Milestone: ---

Building Binutils 2.33.1 with mingw.org's MinGW fails in the libctf directory
due to several minor problems.

1. Compilation warning in ctf-dump.c:

     mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.33.1/libctf 
-D_GNU_SOURCE -I../../binutils-2.33.1/libctf
-I../../binutils-2.33.1/libctf/../include -I../../binutils-2.33.1/libctf/../bfd
-I../bfd   -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings
-Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -pedantic -Wno-long-long   -O2 -gdwarf-4 -g3
-D__USE_MINGW_ACCESS -MT ctf-dump.o -MD -MP -MF .deps/ctf-dump.Tpo -c -o
ctf-dump.o ../
     ../binutils-2.33.1/libctf/ctf-dump.c
     ../../binutils-2.33.1/libctf/ctf-dump.c: In function
'ctf_dump_format_type':
     ../../binutils-2.33.1/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

   This is because libctf/config.h doesn't have HAVE_DECL_ASPRINTF, as the
other config.h files do.  And libiberty.h uses the following guard for the
asprintf declaration:

#if defined(HAVE_DECL_ASPRINTF) && !HAVE_DECL_ASPRINTF
/* Like sprintf but provides a pointer to malloc'd storage, which must
   be freed by the caller.  */

extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
#endif

2. Compilation error in ctf-create.c:

     mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.33.1/libctf 
-D_GNU_SOURCE -I../../binutils-2.33.1/libctf
-I../../binutils-2.33.1/libctf/../include -I../../binutils-2.33.1/libctf/../bfd
-I../bfd   -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings
-Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -pedantic -Wno-long-long   -O2 -gdwarf-4 -g3
-D__USE_MINGW_ACCESS -MT ctf-create.o -MD -MP -MF .deps/ctf-create.Tpo -c -o
ctf-create.o ../../binutils-2.33.1/libctf/ctf-create.c
     ../../binutils-2.33.1/libctf/ctf-create.c: In function 'ctf_add_function':
     ../../binutils-2.33.1/libctf/ctf-create.c:950:32: error: 'EOVERFLOW'
undeclared (first use in this function); did you mean 'EI_VERSION'?
          return (ctf_set_errno (fp, EOVERFLOW));
                                     ^~~~~~~~~
                                     EI_VERSION

I fixed this by adding

     #ifndef EOVERFLOW
     # define EOVERFLOW ERANGE
     #endif

to ctf-create.c.  ERANGE is not exactly EOVERFLOW, but it's close enough.

3. Compilation error in ctf-subr.c:

     mingw32-gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.33.1/libctf 
-D_GNU_SOURCE -I../../binutils-2.33.1/libctf
-I../../binutils-2.33.1/libctf/../include -I../../binutils-2.33.1/libctf/../bfd
-I../bfd   -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings
-Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -pedantic -Wno-long-long   -O2 -gdwarf-4 -g3 -D__USE
     _MINGW_ACCESS -MT ctf-subr.o -MD -MP -MF .deps/ctf-subr.Tpo -c -o
ctf-subr.o ../
     ../binutils-2.33.1/libctf/ctf-subr.c
     ../../binutils-2.33.1/libctf/ctf-subr.c: In function 'ctf_version':
     ../../binutils-2.33.1/libctf/ctf-subr.c:159:12: error: 'ENOTSUP'
undeclared (first use in this function); did you mean 'ENOTTY'?
         errno = ENOTSUP;
                 ^~~~~~~
                 ENOTTY
     ../../binutils-2.33.1/libctf/ctf-subr.c:159:12: note: each undeclared
identifier is reported only once for each function it appears in

I fixed this by adding

     #ifndef ENOTSUP
     # define ENOTSUP ENOSYS
     #endif

at the beginning of ctf-subr.c.

Thank you for developing Binutils.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]