* [Xen-devel] Tools build failure with gcc-9.2.1
@ 2020-03-25 9:40 Dario Faggioli
2020-03-29 17:19 ` Julien Grall
0 siblings, 1 reply; 4+ messages in thread
From: Dario Faggioli @ 2020-03-25 9:40 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 1393 bytes --]
Hello,
Are the following errors (and more similar ones):
CC xenctrl_stubs.o
In file included from /usr/lib64/ocaml/caml/alloc.h:24,
from xenctrl_stubs.c:22:
xenctrl_stubs.c: In function 'stub_xc_vcpu_context_get':
/usr/lib64/ocaml/caml/mlvalues.h:265:24: error: passing argument 1 of 'memcpy' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
265 | #define String_val(x) ((const char *) Bp_val(x))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~
xenctrl_stubs.c:502:9: note: in expansion of macro 'String_val'
502 | memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));
| ^~~~~~~~~~
In file included from xenctrl_stubs.c:30:
/usr/include/string.h:43:14: note: expected 'void * restrict' but argument is of type 'const char *'
43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
| ^~~~~~
When building with:
gcc version 9.2.1 20200306 [revision c5edde44f5b17b4891f17a63517f355bbf89e7d3] (SUSE Linux)
Already known and being dealt with?
Regards
--
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xen-devel] Tools build failure with gcc-9.2.1
2020-03-25 9:40 [Xen-devel] Tools build failure with gcc-9.2.1 Dario Faggioli
@ 2020-03-29 17:19 ` Julien Grall
2020-03-30 10:58 ` Dario Faggioli
0 siblings, 1 reply; 4+ messages in thread
From: Julien Grall @ 2020-03-29 17:19 UTC (permalink / raw)
To: Dario Faggioli, xen-devel
On 25/03/2020 09:40, Dario Faggioli wrote:
> Hello,
Hi Dario,
>
> Are the following errors (and more similar ones):
>
> CC xenctrl_stubs.o
> In file included from /usr/lib64/ocaml/caml/alloc.h:24,
> from xenctrl_stubs.c:22:
> xenctrl_stubs.c: In function 'stub_xc_vcpu_context_get':
> /usr/lib64/ocaml/caml/mlvalues.h:265:24: error: passing argument 1 of 'memcpy' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
> 265 | #define String_val(x) ((const char *) Bp_val(x))
> | ~^~~~~~~~~~~~~~~~~~~~~~~~~
> xenctrl_stubs.c:502:9: note: in expansion of macro 'String_val'
> 502 | memcpy(String_val(context), (char *) &ctxt.c, sizeof(ctxt.c));
> | ^~~~~~~~~~
> In file included from xenctrl_stubs.c:30:
> /usr/include/string.h:43:14: note: expected 'void * restrict' but argument is of type 'const char *'
> 43 | extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
> | ^~~~~~
>
> When building with:
>
> gcc version 9.2.1 20200306 [revision c5edde44f5b17b4891f17a63517f355bbf89e7d3] (SUSE Linux)
>
> Already known and being dealt with?
I suspect you have a new version of Ocaml built with -safe-string as per
[1], String_Val() will return (const char *) rather than (char *).
I am looking at writing a patch for it and send it to xen-devel.
Cheers,
[1] https://github.com/ocaml/ocaml/pull/1274
>
> Regards
>
--
Julien Grall
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xen-devel] Tools build failure with gcc-9.2.1
2020-03-29 17:19 ` Julien Grall
@ 2020-03-30 10:58 ` Dario Faggioli
2020-03-30 20:32 ` Julien Grall
0 siblings, 1 reply; 4+ messages in thread
From: Dario Faggioli @ 2020-03-30 10:58 UTC (permalink / raw)
To: Julien Grall, xen-devel
[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]
On Sun, 2020-03-29 at 18:19 +0100, Julien Grall wrote:
> On 25/03/2020 09:40, Dario Faggioli wrote:
> > /usr/include/string.h:43:14: note: expected 'void * restrict' but
> > argument is of type 'const char *'
> > 43 | extern void *memcpy (void *__restrict __dest, const void
> > *__restrict __src,
> > | ^~~~~~
> >
> > When building with:
> >
> > gcc version 9.2.1 20200306 [revision
> > c5edde44f5b17b4891f17a63517f355bbf89e7d3] (SUSE Linux)
> >
> > Already known and being dealt with?
>
> I suspect you have a new version of Ocaml built with -safe-string as
> per
> [1], String_Val() will return (const char *) rather than (char *).
>
Yep, I checked in the ocaml headers installed on the system, and that's
exactly the case.
> I am looking at writing a patch for it and send it to xen-devel.
>
Cool, thanks! I'll be happy to test it. :-)
Regards
--
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xen-devel] Tools build failure with gcc-9.2.1
2020-03-30 10:58 ` Dario Faggioli
@ 2020-03-30 20:32 ` Julien Grall
0 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2020-03-30 20:32 UTC (permalink / raw)
To: Dario Faggioli, xen-devel
Hi Dario,
On 30/03/2020 11:58, Dario Faggioli wrote:
> On Sun, 2020-03-29 at 18:19 +0100, Julien Grall wrote:
>> On 25/03/2020 09:40, Dario Faggioli wrote:
>>> /usr/include/string.h:43:14: note: expected 'void * restrict' but
>>> argument is of type 'const char *'
>>> 43 | extern void *memcpy (void *__restrict __dest, const void
>>> *__restrict __src,
>>> | ^~~~~~
>>>
>>> When building with:
>>>
>>> gcc version 9.2.1 20200306 [revision
>>> c5edde44f5b17b4891f17a63517f355bbf89e7d3] (SUSE Linux)
>>>
>>> Already known and being dealt with?
>>
>> I suspect you have a new version of Ocaml built with -safe-string as
>> per
>> [1], String_Val() will return (const char *) rather than (char *).
>>
> Yep, I checked in the ocaml headers installed on the system, and that's
> exactly the case.
>
>> I am looking at writing a patch for it and send it to xen-devel.
>>
> Cool, thanks! I'll be happy to test it. :-)
I have just posted the patches [1]. This was compiled with OCaml 4.10.x
and -safe-string. Let me know if it fixes everything on your side.
Cheers,
[1] <20200330192157.1335-1-julien@xen.org>
--
Julien Grall
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-30 20:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 9:40 [Xen-devel] Tools build failure with gcc-9.2.1 Dario Faggioli
2020-03-29 17:19 ` Julien Grall
2020-03-30 10:58 ` Dario Faggioli
2020-03-30 20:32 ` Julien Grall
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 NNTP newsgroup(s).