* Re: -Werror enabled by default on GNU/Hurd
@ 2021-12-29 18:06 Andrea Monaco
2021-12-30 15:55 ` Andrew Burgess
0 siblings, 1 reply; 6+ messages in thread
From: Andrea Monaco @ 2021-12-29 18:06 UTC (permalink / raw)
To: aburgess; +Cc: gdb
> with this patch I am now able to build GDB on GNU/Hurd (i686). This
> might help you out.
Thanks, that solves a warning. But the build still fails with this
output:
CXX msg_U.o
cc1: warning: command-line option '-Wno-mismatched-tags' is valid for C++/ObjC++ but not for C
cc1: warning: command-line option '-Wsuggest-override' is valid for C++/ObjC++ but not for C
cc1: warning: command-line option '-Wdeprecated-copy' is valid for C++/ObjC++ but not for C
cc1: warning: command-line option '-Wdeprecated-copy-dtor' is valid for C++/ObjC++ but not for C
cc1: warning: command-line option '-Wredundant-move' is valid for C++/ObjC++ but not for C
cc1: warning: command-line option '-Wstrict-null-sentinel' is valid for C++/ObjC++ but not for C
msg_U.c: In function 'msg_set_init_ports':
msg_U.c:1044:22: error: conversion from 'unsigned int' to 'short unsigned int' changes value from '4294967295' to '65535' [-Werror=overflow]
1044 | /* msgtl_name = */ MACH_MSG_TYPE_POLYMORPHIC,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
msg_U.c: In function 'msg_set_dtable':
msg_U.c:1838:22: error: conversion from 'unsigned int' to 'short unsigned int' changes value from '4294967295' to '65535' [-Werror=overflow]
1838 | /* msgtl_name = */ MACH_MSG_TYPE_POLYMORPHIC,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Makefile:1684: recipe for target 'msg_U.o' failed
make: *** [msg_U.o] Error 1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: -Werror enabled by default on GNU/Hurd
2021-12-29 18:06 -Werror enabled by default on GNU/Hurd Andrea Monaco
@ 2021-12-30 15:55 ` Andrew Burgess
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Burgess @ 2021-12-30 15:55 UTC (permalink / raw)
To: Andrea Monaco; +Cc: gdb
* Andrea Monaco via Gdb <gdb@sourceware.org> [2021-12-29 19:06:04 +0100]:
>
> > with this patch I am now able to build GDB on GNU/Hurd (i686). This
> > might help you out.
>
> Thanks, that solves a warning. But the build still fails with this
> output:
>
>
> CXX msg_U.o
> cc1: warning: command-line option '-Wno-mismatched-tags' is valid for C++/ObjC++ but not for C
> cc1: warning: command-line option '-Wsuggest-override' is valid for C++/ObjC++ but not for C
> cc1: warning: command-line option '-Wdeprecated-copy' is valid for C++/ObjC++ but not for C
> cc1: warning: command-line option '-Wdeprecated-copy-dtor' is valid for C++/ObjC++ but not for C
> cc1: warning: command-line option '-Wredundant-move' is valid for C++/ObjC++ but not for C
> cc1: warning: command-line option '-Wstrict-null-sentinel' is valid for C++/ObjC++ but not for C
> msg_U.c: In function 'msg_set_init_ports':
> msg_U.c:1044:22: error: conversion from 'unsigned int' to 'short unsigned int' changes value from '4294967295' to '65535' [-Werror=overflow]
> 1044 | /* msgtl_name = */ MACH_MSG_TYPE_POLYMORPHIC,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> msg_U.c: In function 'msg_set_dtable':
> msg_U.c:1838:22: error: conversion from 'unsigned int' to 'short unsigned int' changes value from '4294967295' to '65535' [-Werror=overflow]
> 1838 | /* msgtl_name = */ MACH_MSG_TYPE_POLYMORPHIC,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> Makefile:1684: recipe for target 'msg_U.o' failed
> make: *** [msg_U.o] Error 1
I don't claim to know anything about GNU/Hurd, this was the first time
I ever installed it.
The file msg_U.c is generated using the mig tool, and the .defs files
binutils-gdb/gdb/msg.defs. The .defs file just includes
/usr/include/hurd/msg.h. And the makefile fragment that builds the
msg_U.c is found in binutils-gdb/gdb/config/i386/i386gnu.mn.
I notice in the above, that my version of those two lines is slightly
different, like this:
/* msgtl_name = */ (unsigned short) MACH_MSG_TYPE_POLYMORPHIC,
Which would solve the error you're seeing. Finally, here's the
version number information for the mig tool I'm using:
$ mig --version
i686-gnu-mig (GNU MIG) 1.8+git20200618
Remembering that you probably understand all this far better than me,
I wonder if you need to update your version of mig?
As a last resort if you patch your generated file, adding the cast
that I see, is this enough to finish building GDB? Clearly this isn't
a long term solution, but it feels like the above warning is a tooling
issue, rather than a problem with the GDB source.
Thanks,
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: -Werror enabled by default on GNU/Hurd
2021-12-28 22:16 Andrea Monaco
2021-12-29 2:49 ` Simon Marchi
@ 2021-12-29 14:43 ` Andrew Burgess
1 sibling, 0 replies; 6+ messages in thread
From: Andrew Burgess @ 2021-12-29 14:43 UTC (permalink / raw)
To: Andrea Monaco; +Cc: gdb
* Andrea Monaco via Gdb <gdb@sourceware.org> [2021-12-28 23:16:40 +0100]:
>
> When building gdb on GNU/Hurd, -Werror is enabled by default. I think
> that's a bug: that option is only useful in specific instances; enabling
> it by default means that the build fails after a plain ./configure, and
> you need to pass --disable-werror to make it succeed.
>
> I tried to locate the problem myself, but the build scripts are very
> complex. Could someone please give me some hints?
I just posted this patch to the patches list:
https://sourceware.org/pipermail/gdb-patches/2021-December/184683.html
with this patch I am now able to build GDB on GNU/Hurd (i686). This
might help you out.
Thanks,
Andrew
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: -Werror enabled by default on GNU/Hurd
2021-12-29 2:49 ` Simon Marchi
@ 2021-12-29 3:46 ` Joel Brobecker
0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2021-12-29 3:46 UTC (permalink / raw)
To: Simon Marchi via Gdb; +Cc: Andrea Monaco, Joel Brobecker
> > When building gdb on GNU/Hurd, -Werror is enabled by default. I think
> > that's a bug: that option is only useful in specific instances; enabling
> > it by default means that the build fails after a plain ./configure, and
> > you need to pass --disable-werror to make it succeed.
> >
> > I tried to locate the problem myself, but the build scripts are very
> > complex. Could someone please give me some hints?
>
> What are the errors you see? We aim for warning-free builds, so the best
> fix would be to get rid of these warnings.
Indeed. If you use the development branch, then we want warnings
to trigger an error -- otherwise, those warnings very rarely get
looked at. The situation is different on release branches, where
warnings are made non-fatal.
--
Joel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: -Werror enabled by default on GNU/Hurd
2021-12-28 22:16 Andrea Monaco
@ 2021-12-29 2:49 ` Simon Marchi
2021-12-29 3:46 ` Joel Brobecker
2021-12-29 14:43 ` Andrew Burgess
1 sibling, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2021-12-29 2:49 UTC (permalink / raw)
To: Andrea Monaco, gdb
On 2021-12-28 17:16, Andrea Monaco via Gdb wrote:
>
> When building gdb on GNU/Hurd, -Werror is enabled by default. I think
> that's a bug: that option is only useful in specific instances; enabling
> it by default means that the build fails after a plain ./configure, and
> you need to pass --disable-werror to make it succeed.
>
> I tried to locate the problem myself, but the build scripts are very
> complex. Could someone please give me some hints?
>
>
>
> Thanks,
>
> Andrea Monaco
What are the errors you see? We aim for warning-free builds, so the best
fix would be to get rid of these warnings.
Simon
^ permalink raw reply [flat|nested] 6+ messages in thread
* -Werror enabled by default on GNU/Hurd
@ 2021-12-28 22:16 Andrea Monaco
2021-12-29 2:49 ` Simon Marchi
2021-12-29 14:43 ` Andrew Burgess
0 siblings, 2 replies; 6+ messages in thread
From: Andrea Monaco @ 2021-12-28 22:16 UTC (permalink / raw)
To: gdb
When building gdb on GNU/Hurd, -Werror is enabled by default. I think
that's a bug: that option is only useful in specific instances; enabling
it by default means that the build fails after a plain ./configure, and
you need to pass --disable-werror to make it succeed.
I tried to locate the problem myself, but the build scripts are very
complex. Could someone please give me some hints?
Thanks,
Andrea Monaco
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-12-30 15:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-29 18:06 -Werror enabled by default on GNU/Hurd Andrea Monaco
2021-12-30 15:55 ` Andrew Burgess
-- strict thread matches above, loose matches on Subject: below --
2021-12-28 22:16 Andrea Monaco
2021-12-29 2:49 ` Simon Marchi
2021-12-29 3:46 ` Joel Brobecker
2021-12-29 14:43 ` Andrew Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).