xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* staging GCC 8.1.0 build warnings
@ 2018-05-09 23:38 John Thomson
  2018-05-14 17:03 ` Wei Liu
  0 siblings, 1 reply; 4+ messages in thread
From: John Thomson @ 2018-05-09 23:38 UTC (permalink / raw)
  To: xen-devel

Hi,
Trying to build Xen staging with GCC 8.1.0 and facing some of the new warnings:

For OVMF, I used these three commits:
https://github.com/tianocore/edk2/compare/1d212a83df0eaf32a6f5d4159beb2d77832e0231^...9de306701312f986c9638cb819d3f1f848d55cab.patch
1d212a83df0eaf32a6f5d4159beb2d77832e0231
9222154ae7b3eef75ae88cdb56158256227cb929
9de306701312f986c9638cb819d3f1f848d55cab


For IPXE, one of these patches:
http://lists.ipxe.org/pipermail/ipxe-devel/2018-April/006146.html
https://build.opensuse.org/package/view_file/openSUSE:Factory/qemu/ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch?expand=1

I was still unable to build IPXE at the Xen selected commit in tools/firmware/etherboot/Makefile:IPXE_GIT_TAG, with Errors:
[BUILD] bin/netdevice.o
Assembler messages
junk at end of line, first unrecognized character is `@'
can't resolve `__table_entries.2720' {.tbl.net_device_configurators.99 section} - `__table_entries.2722' {.tbl.net_device_configurators.00 section}
can't resolve `__table_entries.2796' {.tbl.net_device_configurators.99 section} - `__table_entries.2798' {.tbl.net_device_configurators.00 section}

I ended up using IPXE master and the OpenSUSE ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch
I have not followed this up to find which commit fixes my build yet.

How close to ready are the standalone IPXE patches?

For QEMU, this commit:
https://github.com/qemu/qemu/commit/84c868f6b8f8c1be9d3d65df93cf00b30821401c.patch
84c868f6b8f8c1be9d3d65df93cf00b30821401c


In tools/ocaml/libs/xc/xenctrl_stubs.c
char error_str[1028];

 CC       xenctrl_stubs.o
xenctrl_stubs.c: In function 'failwith_xc':
xenctrl_stubs.c:65:17: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
      "%d: %s: %s", error->code,
                 ^
xenctrl_stubs.c:64:4: note: 'snprintf' output 6 or more bytes (assuming 1029) into a destination of size 1028
    snprintf(error_str, sizeof(error_str),
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      "%d: %s: %s", error->code,
      ~~~~~~~~~~~~~~~~~~~~~~~~~~
      xc_error_code_to_desc(error->code),
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      error->message);
      ~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

I changed these, but am not sure if this is correct?
char error_str[XC_MAX_ERROR_MSG_LEN + 6]
sizeof(error_str) - 1 in the three snprintf


/build/xen-git/src/xen/stubdom/tpm_emulator-x86_64/tpm/tpm_deprecated.c:437:7: error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
   if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Not sure how to approach this, I disabled the vtpm stubdoms in my builds for now.



Cheers,
-- 
  John Thomson

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: staging GCC 8.1.0 build warnings
  2018-05-09 23:38 staging GCC 8.1.0 build warnings John Thomson
@ 2018-05-14 17:03 ` Wei Liu
  2018-05-14 18:20   ` Jason Andryuk
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Liu @ 2018-05-14 17:03 UTC (permalink / raw)
  To: John Thomson; +Cc: xen-devel, Wei Liu

On Thu, May 10, 2018 at 09:38:26AM +1000, John Thomson wrote:
> Hi,
> Trying to build Xen staging with GCC 8.1.0 and facing some of the new warnings:
> 
> For OVMF, I used these three commits:
> https://github.com/tianocore/edk2/compare/1d212a83df0eaf32a6f5d4159beb2d77832e0231^...9de306701312f986c9638cb819d3f1f848d55cab.patch
> 1d212a83df0eaf32a6f5d4159beb2d77832e0231
> 9222154ae7b3eef75ae88cdb56158256227cb929
> 9de306701312f986c9638cb819d3f1f848d55cab
> 
> 
> For IPXE, one of these patches:
> http://lists.ipxe.org/pipermail/ipxe-devel/2018-April/006146.html
> https://build.opensuse.org/package/view_file/openSUSE:Factory/qemu/ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch?expand=1
> 
> I was still unable to build IPXE at the Xen selected commit in tools/firmware/etherboot/Makefile:IPXE_GIT_TAG, with Errors:
> [BUILD] bin/netdevice.o
> Assembler messages
> junk at end of line, first unrecognized character is `@'
> can't resolve `__table_entries.2720' {.tbl.net_device_configurators.99 section} - `__table_entries.2722' {.tbl.net_device_configurators.00 section}
> can't resolve `__table_entries.2796' {.tbl.net_device_configurators.99 section} - `__table_entries.2798' {.tbl.net_device_configurators.00 section}
> 
> I ended up using IPXE master and the OpenSUSE ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch
> I have not followed this up to find which commit fixes my build yet.
> 
> How close to ready are the standalone IPXE patches?

It has gathered some comments. v2 is not yet posted. At this point it is
definitely N+1 material.

I don't think having it merged in N+1 will be a big problem though,
provided we find enough bandwidth to work on it.

> 
> For QEMU, this commit:
> https://github.com/qemu/qemu/commit/84c868f6b8f8c1be9d3d65df93cf00b30821401c.patch
> 84c868f6b8f8c1be9d3d65df93cf00b30821401c
> 
> 
> In tools/ocaml/libs/xc/xenctrl_stubs.c
> char error_str[1028];
> 
>  CC       xenctrl_stubs.o
> xenctrl_stubs.c: In function 'failwith_xc':
> xenctrl_stubs.c:65:17: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
>       "%d: %s: %s", error->code,
>                  ^
> xenctrl_stubs.c:64:4: note: 'snprintf' output 6 or more bytes (assuming 1029) into a destination of size 1028
>     snprintf(error_str, sizeof(error_str),
>     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       "%d: %s: %s", error->code,
>       ~~~~~~~~~~~~~~~~~~~~~~~~~~
>       xc_error_code_to_desc(error->code),
>       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       error->message);
>       ~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> I changed these, but am not sure if this is correct?
> char error_str[XC_MAX_ERROR_MSG_LEN + 6]
> sizeof(error_str) - 1 in the three snprintf

Bumping the size should be fine.

> 
> 
> /build/xen-git/src/xen/stubdom/tpm_emulator-x86_64/tpm/tpm_deprecated.c:437:7: error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
>    if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Not sure how to approach this, I disabled the vtpm stubdoms in my builds for now.
> 

If you don't use it, disabling it is the best option.

Wei.

> 
> 
> Cheers,
> -- 
>   John Thomson
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: staging GCC 8.1.0 build warnings
  2018-05-14 17:03 ` Wei Liu
@ 2018-05-14 18:20   ` Jason Andryuk
  2018-05-15  1:42     ` John Thomson
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Andryuk @ 2018-05-14 18:20 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, John Thomson

On Mon, May 14, 2018 at 1:03 PM, Wei Liu <wei.liu2@citrix.com> wrote:
> On Thu, May 10, 2018 at 09:38:26AM +1000, John Thomson wrote:
>>
>> /build/xen-git/src/xen/stubdom/tpm_emulator-x86_64/tpm/tpm_deprecated.c:437:7: error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
>>    if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
>>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Not sure how to approach this, I disabled the vtpm stubdoms in my builds for now.
>>
>
> If you don't use it, disabling it is the best option.

A fix is proposed upstream:
https://github.com/PeterHuewe/tpm-emulator/pull/30/commits/910c43273c9f3373f93c2e8b8b0929d89fdcead6

Regards,
Jason

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: staging GCC 8.1.0 build warnings
  2018-05-14 18:20   ` Jason Andryuk
@ 2018-05-15  1:42     ` John Thomson
  0 siblings, 0 replies; 4+ messages in thread
From: John Thomson @ 2018-05-15  1:42 UTC (permalink / raw)
  To: Jason Andryuk, Wei Liu; +Cc: xen-devel

On Tue, 15 May 2018, at 04:20, Jason Andryuk wrote:
> > On Thu, May 10, 2018 at 09:38:26AM +1000, John Thomson wrote:
> >> /build/xen-git/src/xen/stubdom/tpm_emulator-x86_64/tpm/tpm_deprecated.c:437:7: error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
> >>    if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
> >>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> A fix is proposed upstream:
> https://github.com/PeterHuewe/tpm-emulator/pull/30/commits/910c43273c9f3373f93c2e8b8b0929d89fdcead6

Thank you, I had completely missed that. 


The qemu-xen patches to fix gcc-8 warnings are in qemu-xen staging, but they are not yet in master.
This will need a new tag for the next 4.11rc when they come through?


> >> For IPXE, one of these patches:
> >> https://build.opensuse.org/package/view_file/openSUSE:Factory/qemu/ipxe-efi-guard-strncpy-with-gcc-warning-ignore-pragma.patch?expand=1

For IPXE I needed the  [build] Use -no-pie on newer versions of gcc patch, as well as the guard-strncpy patch.
https://github.com/ipxe/ipxe/commit/7c395b0e21806b946fe944a27fc273407f357ea1

Cheers,
-- 
  John Thomson

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-15  1:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-09 23:38 staging GCC 8.1.0 build warnings John Thomson
2018-05-14 17:03 ` Wei Liu
2018-05-14 18:20   ` Jason Andryuk
2018-05-15  1:42     ` John Thomson

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).