Compilation error in simple-object-elf.c

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Compilation error in simple-object-elf.c

Eli Zaretskii
Hi,

I've built the pretest of GDB 8.2 with MinGW today, and bumped into a
compilation error in libiberty:

     if [ x"" != x ]; then \
       gcc -c -DHAVE_CONFIG_H -O2 -gdwarf-4 -g3 -D__USE_MINGW_ACCESS  -I. -I./../include   -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE   ./simple-object-elf.c -o noasan/simple-object-elf.o; \
     else true; fi
     gcc -c -DHAVE_CONFIG_H -O2 -gdwarf-4 -g3 -D__USE_MINGW_ACCESS  -I. -I./../include   -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE ./simple-object-elf.c -o simple-object-elf.o
     ./simple-object-elf.c: In function 'simple_object_elf_copy_lto_debug_sections':
     ./simple-object-elf.c:1284:14: error: 'ENOTSUP' undeclared (first use in this function)
            *err = ENOTSUP;
                   ^~~~~~~
     ./simple-object-elf.c:1284:14: note: each undeclared identifier is reported only once for each function it appears in

Suggested fix:

2018-07-18  Eli Zaretskii  <[hidden email]>

        * libiberty/simple-object-elf.c (ENOTSUP): If not defined by
          errno.h, redirect to ENOSYS.

--- libiberty/simple-object-elf.c~0 2018-07-04 18:41:59.000000000 +0300
+++ libiberty/simple-object-elf.c 2018-07-18 18:19:39.286654700 +0300
@@ -22,6 +22,10 @@ Boston, MA 02110-1301, USA.  */
 #include "simple-object.h"
 
 #include <errno.h>
+/* mingw.org's MinGW doesn't have ENOTSUP.  */
+#ifndef ENOTSUP
+# define ENOTSUP ENOSYS
+#endif
 #include <stddef.h>
 
 #ifdef HAVE_STDLIB_H

Reply | Threaded
Open this post in threaded view
|

Re: Compilation error in simple-object-elf.c

Richard Biener
On Wed, Jul 18, 2018 at 6:18 PM Eli Zaretskii <[hidden email]> wrote:

>
> Hi,
>
> I've built the pretest of GDB 8.2 with MinGW today, and bumped into a
> compilation error in libiberty:
>
>      if [ x"" != x ]; then \
>        gcc -c -DHAVE_CONFIG_H -O2 -gdwarf-4 -g3 -D__USE_MINGW_ACCESS  -I. -I./../include   -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE   ./simple-object-elf.c -o noasan/simple-object-elf.o; \
>      else true; fi
>      gcc -c -DHAVE_CONFIG_H -O2 -gdwarf-4 -g3 -D__USE_MINGW_ACCESS  -I. -I./../include   -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic  -D_GNU_SOURCE ./simple-object-elf.c -o simple-object-elf.o
>      ./simple-object-elf.c: In function 'simple_object_elf_copy_lto_debug_sections':
>      ./simple-object-elf.c:1284:14: error: 'ENOTSUP' undeclared (first use in this function)
>             *err = ENOTSUP;
>                    ^~~~~~~
>      ./simple-object-elf.c:1284:14: note: each undeclared identifier is reported only once for each function it appears in
>
> Suggested fix:

Works for me, thus OK.  I'm going to check it in to make 8.2.

Richard.

> 2018-07-18  Eli Zaretskii  <[hidden email]>
>
>         * libiberty/simple-object-elf.c (ENOTSUP): If not defined by
>           errno.h, redirect to ENOSYS.
>
> --- libiberty/simple-object-elf.c~0     2018-07-04 18:41:59.000000000 +0300
> +++ libiberty/simple-object-elf.c       2018-07-18 18:19:39.286654700 +0300
> @@ -22,6 +22,10 @@ Boston, MA 02110-1301, USA.  */
>  #include "simple-object.h"
>
>  #include <errno.h>
> +/* mingw.org's MinGW doesn't have ENOTSUP.  */
> +#ifndef ENOTSUP
> +# define ENOTSUP ENOSYS
> +#endif
>  #include <stddef.h>
>
>  #ifdef HAVE_STDLIB_H
>
Reply | Threaded
Open this post in threaded view
|

Re: Compilation error in simple-object-elf.c

Eli Zaretskii
> From: Richard Biener <[hidden email]>
> Date: Thu, 19 Jul 2018 10:46:01 +0200
> Cc: DJ Delorie <[hidden email]>, GCC Patches <[hidden email]>, [hidden email]
>
> >             *err = ENOTSUP;
> >                    ^~~~~~~
> >      ./simple-object-elf.c:1284:14: note: each undeclared identifier is reported only once for each function it appears in
> >
> > Suggested fix:
>
> Works for me, thus OK.  I'm going to check it in to make 8.2.

Thanks.

Joel/Pedro, is this okay for GDB's copy of libiberty, master and
branch?
Reply | Threaded
Open this post in threaded view
|

Re: Compilation error in simple-object-elf.c

Pedro Alves-7
On 07/19/2018 02:06 PM, Eli Zaretskii wrote:

>> From: Richard Biener <[hidden email]>
>> Date: Thu, 19 Jul 2018 10:46:01 +0200
>> Cc: DJ Delorie <[hidden email]>, GCC Patches <[hidden email]>, [hidden email]
>>
>>>             *err = ENOTSUP;
>>>                    ^~~~~~~
>>>      ./simple-object-elf.c:1284:14: note: each undeclared identifier is reported only once for each function it appears in
>>>
>>> Suggested fix:
>>
>> Works for me, thus OK.  I'm going to check it in to make 8.2.
>
> Thanks.
>
> Joel/Pedro, is this okay for GDB's copy of libiberty, master and
> branch?

Yes.

Thanks,
Pedro Alves
Reply | Threaded
Open this post in threaded view
|

Re: Compilation error in simple-object-elf.c

Eli Zaretskii
> Cc: [hidden email], [hidden email], [hidden email]
> From: Pedro Alves <[hidden email]>
> Date: Thu, 19 Jul 2018 14:41:13 +0100
>
> On 07/19/2018 02:06 PM, Eli Zaretskii wrote:
> >> From: Richard Biener <[hidden email]>
> >> Date: Thu, 19 Jul 2018 10:46:01 +0200
> >> Cc: DJ Delorie <[hidden email]>, GCC Patches <[hidden email]>, [hidden email]
> >>
> >>>             *err = ENOTSUP;
> >>>                    ^~~~~~~
> >>>      ./simple-object-elf.c:1284:14: note: each undeclared identifier is reported only once for each function it appears in
> >>>
> >>> Suggested fix:
> >>
> >> Works for me, thus OK.  I'm going to check it in to make 8.2.
> >
> > Thanks.
> >
> > Joel/Pedro, is this okay for GDB's copy of libiberty, master and
> > branch?

Thanks, done.