Re: [OE-core] [PATCH 3/4] ovmf: Fix build with gcc8

2018-05-17 Thread Khem Raj



On 5/17/18 3:17 AM, Burton, Ross wrote:

Even when I pick from the branch instead of the mail, I suspect the
line endings are messed up and this won't apply.  Can you
double-check?

(I *hate* the ovmf recipe for this reason and am very tempted to just
run dos2unix over the tree after unpack!)


I have updated the patches which hopefully should make quilt happier

http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/master&id=be616a0b6c3decc06f2acbf27f47ebb58d32aa90

Thanks
-Khem
--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 3/4] ovmf: Fix build with gcc8

2018-05-17 Thread Dan McGregor
On 17 May 2018 at 04:17, Burton, Ross  wrote:
> Even when I pick from the branch instead of the mail, I suspect the
> line endings are messed up and this won't apply.  Can you
> double-check?
>
> (I *hate* the ovmf recipe for this reason and am very tempted to just
> run dos2unix over the tree after unpack!)

I was tempted last week to set the text=auto property in a
.gitattributes file in the udk2 repository and submit it upstream for
exactly that reason.

>
> Ross
>
> On 16 May 2018 at 07:32, Khem Raj  wrote:
>> Signed-off-by: Khem Raj 
>> ---
>>  makefile-add-Wno-stringop-truncatio.patch |  73 
>>  ...ols-header.makefile-add-Wno-restrict.patch | 104 ++
>>  makefile-revert-gcc-8-Wno-xxx-optio.patch |  55 +
>>  ...-silence-false-stringop-overflow-war.patch |  65 +++
>>  meta/recipes-core/ovmf/ovmf_git.bb|   4 +
>>  5 files changed, 301 insertions(+)
>>  create mode 100644 
>> meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
>>  create mode 100644 
>> meta/recipes-core/ovmf/ovmf/0002-BaseTools-header.makefile-add-Wno-restrict.patch
>>  create mode 100644 
>> meta/recipes-core/ovmf/ovmf/0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch
>>  create mode 100644 
>> meta/recipes-core/ovmf/ovmf/0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch
>>
>> diff --git 
>> a/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
>>  
>> b/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
>> new file mode 100644
>> index 00..1d1679fe7e
>> --- /dev/null
>> +++ 
>> b/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
>> @@ -0,0 +1,73 @@
>> +From 9fce4bab014b9aa618060eba13d6dd04b0fa1b70 Mon Sep 17 00:00:00 2001
>> +From: Laszlo Ersek 
>> +Date: Fri, 2 Mar 2018 17:11:52 +0100
>> +Subject: [PATCH 1/4] BaseTools/header.makefile: add 
>> "-Wno-stringop-truncation"
>> +
>> +gcc-8 (which is part of Fedora 28) enables the new warning
>> +"-Wstringop-truncation" in "-Wall". This warning is documented in detail
>> +at ; the
>> +introduction says
>> +
>> +> Warn for calls to bounded string manipulation functions such as strncat,
>> +> strncpy, and stpncpy that may either truncate the copied string or leave
>> +> the destination unchanged.
>> +
>> +It breaks the BaseTools build with:
>> +
>> +> EfiUtilityMsgs.c: In function 'PrintMessage':
>> +> EfiUtilityMsgs.c:484:9: error: 'strncat' output may be truncated copying
>> +> between 0 and 511 bytes from a string of length 511
>> +> [-Werror=stringop-truncation]
>> +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
>> +>  ^~~
>> +> EfiUtilityMsgs.c:469:9: error: 'strncat' output may be truncated copying
>> +> between 0 and 511 bytes from a string of length 511
>> +> [-Werror=stringop-truncation]
>> +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
>> +>  ^~~
>> +> EfiUtilityMsgs.c:511:5: error: 'strncat' output may be truncated copying
>> +> between 0 and 511 bytes from a string of length 511
>> +> [-Werror=stringop-truncation]
>> +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
>> +>  ^~~
>> +
>> +The right way to fix the warning would be to implement string concat with
>> +snprintf(). However, Microsoft does not appear to support snprintf()
>> +before VS2015
>> +,
>> +so we just have to shut up the warning. The strncat() calls flagged above
>> +are valid BTW.
>> +
>> +Cc: Ard Biesheuvel 
>> +Cc: Cole Robinson 
>> +Cc: Liming Gao 
>> +Cc: Paolo Bonzini 
>> +Cc: Yonghong Zhu 
>> +Contributed-under: TianoCore Contribution Agreement 1.1
>> +Signed-off-by: Laszlo Ersek 
>> +Reviewed-by: Liming Gao 
>> +---
>> +Upstream-Status: Backport
>> +
>> + BaseTools/Source/C/Makefiles/header.makefile | 4 ++--
>> + 1 file changed, 2 insertions(+), 2 deletions(-)
>> +
>> +diff --git a/BaseTools/Source/C/Makefiles/header.makefile 
>> b/BaseTools/Source/C/Makefiles/header.makefile
>> +index 063982b82f..6c3826aecb 100644
>> +--- a/BaseTools/Source/C/Makefiles/header.makefile
>>  b/BaseTools/Source/C/Makefiles/header.makefile
>> +@@ -47,9 +47,9 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I 
>> $(MAKEROOT)/Include/Common -I $(MAKE
>> + BUILD_CPPFLAGS = $(INCLUDE) -O2
>> + ifeq ($(DARWIN),Darwin)
>> + # assume clang or clang compatible flags on OS X
>> +-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
>> -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib 
>> -c -g
>> ++BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
>> -Wno-de

Re: [OE-core] [PATCH 3/4] ovmf: Fix build with gcc8

2018-05-17 Thread Martin Jansa
On Thu, May 17, 2018 at 11:17:11AM +0100, Burton, Ross wrote:
> Even when I pick from the branch instead of the mail, I suspect the
> line endings are messed up and this won't apply.  Can you
> double-check?
> 
> (I *hate* the ovmf recipe for this reason and am very tempted to just
> run dos2unix over the tree after unpack!)

meta-openembedded/meta-oe/classes/dos2unix.bbclass
might help you do that automatically.

> On 16 May 2018 at 07:32, Khem Raj  wrote:
> > Signed-off-by: Khem Raj 
> > ---
> >  makefile-add-Wno-stringop-truncatio.patch |  73 
> >  ...ols-header.makefile-add-Wno-restrict.patch | 104 ++
> >  makefile-revert-gcc-8-Wno-xxx-optio.patch |  55 +
> >  ...-silence-false-stringop-overflow-war.patch |  65 +++
> >  meta/recipes-core/ovmf/ovmf_git.bb|   4 +
> >  5 files changed, 301 insertions(+)
> >  create mode 100644 
> > meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
> >  create mode 100644 
> > meta/recipes-core/ovmf/ovmf/0002-BaseTools-header.makefile-add-Wno-restrict.patch
> >  create mode 100644 
> > meta/recipes-core/ovmf/ovmf/0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch
> >  create mode 100644 
> > meta/recipes-core/ovmf/ovmf/0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch
> >
> > diff --git 
> > a/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
> >  
> > b/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
> > new file mode 100644
> > index 00..1d1679fe7e
> > --- /dev/null
> > +++ 
> > b/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
> > @@ -0,0 +1,73 @@
> > +From 9fce4bab014b9aa618060eba13d6dd04b0fa1b70 Mon Sep 17 00:00:00 2001
> > +From: Laszlo Ersek 
> > +Date: Fri, 2 Mar 2018 17:11:52 +0100
> > +Subject: [PATCH 1/4] BaseTools/header.makefile: add 
> > "-Wno-stringop-truncation"
> > +
> > +gcc-8 (which is part of Fedora 28) enables the new warning
> > +"-Wstringop-truncation" in "-Wall". This warning is documented in detail
> > +at ; the
> > +introduction says
> > +
> > +> Warn for calls to bounded string manipulation functions such as strncat,
> > +> strncpy, and stpncpy that may either truncate the copied string or leave
> > +> the destination unchanged.
> > +
> > +It breaks the BaseTools build with:
> > +
> > +> EfiUtilityMsgs.c: In function 'PrintMessage':
> > +> EfiUtilityMsgs.c:484:9: error: 'strncat' output may be truncated copying
> > +> between 0 and 511 bytes from a string of length 511
> > +> [-Werror=stringop-truncation]
> > +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
> > +>  ^~~
> > +> EfiUtilityMsgs.c:469:9: error: 'strncat' output may be truncated copying
> > +> between 0 and 511 bytes from a string of length 511
> > +> [-Werror=stringop-truncation]
> > +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
> > +>  ^~~
> > +> EfiUtilityMsgs.c:511:5: error: 'strncat' output may be truncated copying
> > +> between 0 and 511 bytes from a string of length 511
> > +> [-Werror=stringop-truncation]
> > +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
> > +>  ^~~
> > +
> > +The right way to fix the warning would be to implement string concat with
> > +snprintf(). However, Microsoft does not appear to support snprintf()
> > +before VS2015
> > +,
> > +so we just have to shut up the warning. The strncat() calls flagged above
> > +are valid BTW.
> > +
> > +Cc: Ard Biesheuvel 
> > +Cc: Cole Robinson 
> > +Cc: Liming Gao 
> > +Cc: Paolo Bonzini 
> > +Cc: Yonghong Zhu 
> > +Contributed-under: TianoCore Contribution Agreement 1.1
> > +Signed-off-by: Laszlo Ersek 
> > +Reviewed-by: Liming Gao 
> > +---
> > +Upstream-Status: Backport
> > +
> > + BaseTools/Source/C/Makefiles/header.makefile | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/BaseTools/Source/C/Makefiles/header.makefile 
> > b/BaseTools/Source/C/Makefiles/header.makefile
> > +index 063982b82f..6c3826aecb 100644
> > +--- a/BaseTools/Source/C/Makefiles/header.makefile
> >  b/BaseTools/Source/C/Makefiles/header.makefile
> > +@@ -47,9 +47,9 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I 
> > $(MAKEROOT)/Include/Common -I $(MAKE
> > + BUILD_CPPFLAGS = $(INCLUDE) -O2
> > + ifeq ($(DARWIN),Darwin)
> > + # assume clang or clang compatible flags on OS X
> > +-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
> > -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib 
> > -c -g
> > ++BUILD_CFLAGS = -MD -fshort-wchar -fno-

Re: [OE-core] [PATCH 3/4] ovmf: Fix build with gcc8

2018-05-17 Thread Burton, Ross
Even when I pick from the branch instead of the mail, I suspect the
line endings are messed up and this won't apply.  Can you
double-check?

(I *hate* the ovmf recipe for this reason and am very tempted to just
run dos2unix over the tree after unpack!)

Ross

On 16 May 2018 at 07:32, Khem Raj  wrote:
> Signed-off-by: Khem Raj 
> ---
>  makefile-add-Wno-stringop-truncatio.patch |  73 
>  ...ols-header.makefile-add-Wno-restrict.patch | 104 ++
>  makefile-revert-gcc-8-Wno-xxx-optio.patch |  55 +
>  ...-silence-false-stringop-overflow-war.patch |  65 +++
>  meta/recipes-core/ovmf/ovmf_git.bb|   4 +
>  5 files changed, 301 insertions(+)
>  create mode 100644 
> meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
>  create mode 100644 
> meta/recipes-core/ovmf/ovmf/0002-BaseTools-header.makefile-add-Wno-restrict.patch
>  create mode 100644 
> meta/recipes-core/ovmf/ovmf/0003-BaseTools-header.makefile-revert-gcc-8-Wno-xxx-optio.patch
>  create mode 100644 
> meta/recipes-core/ovmf/ovmf/0004-BaseTools-GenVtf-silence-false-stringop-overflow-war.patch
>
> diff --git 
> a/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
>  
> b/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
> new file mode 100644
> index 00..1d1679fe7e
> --- /dev/null
> +++ 
> b/meta/recipes-core/ovmf/ovmf/0001-BaseTools-header.makefile-add-Wno-stringop-truncatio.patch
> @@ -0,0 +1,73 @@
> +From 9fce4bab014b9aa618060eba13d6dd04b0fa1b70 Mon Sep 17 00:00:00 2001
> +From: Laszlo Ersek 
> +Date: Fri, 2 Mar 2018 17:11:52 +0100
> +Subject: [PATCH 1/4] BaseTools/header.makefile: add 
> "-Wno-stringop-truncation"
> +
> +gcc-8 (which is part of Fedora 28) enables the new warning
> +"-Wstringop-truncation" in "-Wall". This warning is documented in detail
> +at ; the
> +introduction says
> +
> +> Warn for calls to bounded string manipulation functions such as strncat,
> +> strncpy, and stpncpy that may either truncate the copied string or leave
> +> the destination unchanged.
> +
> +It breaks the BaseTools build with:
> +
> +> EfiUtilityMsgs.c: In function 'PrintMessage':
> +> EfiUtilityMsgs.c:484:9: error: 'strncat' output may be truncated copying
> +> between 0 and 511 bytes from a string of length 511
> +> [-Werror=stringop-truncation]
> +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
> +>  ^~~
> +> EfiUtilityMsgs.c:469:9: error: 'strncat' output may be truncated copying
> +> between 0 and 511 bytes from a string of length 511
> +> [-Werror=stringop-truncation]
> +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
> +>  ^~~
> +> EfiUtilityMsgs.c:511:5: error: 'strncat' output may be truncated copying
> +> between 0 and 511 bytes from a string of length 511
> +> [-Werror=stringop-truncation]
> +>  strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
> +>  ^~~
> +
> +The right way to fix the warning would be to implement string concat with
> +snprintf(). However, Microsoft does not appear to support snprintf()
> +before VS2015
> +,
> +so we just have to shut up the warning. The strncat() calls flagged above
> +are valid BTW.
> +
> +Cc: Ard Biesheuvel 
> +Cc: Cole Robinson 
> +Cc: Liming Gao 
> +Cc: Paolo Bonzini 
> +Cc: Yonghong Zhu 
> +Contributed-under: TianoCore Contribution Agreement 1.1
> +Signed-off-by: Laszlo Ersek 
> +Reviewed-by: Liming Gao 
> +---
> +Upstream-Status: Backport
> +
> + BaseTools/Source/C/Makefiles/header.makefile | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/BaseTools/Source/C/Makefiles/header.makefile 
> b/BaseTools/Source/C/Makefiles/header.makefile
> +index 063982b82f..6c3826aecb 100644
> +--- a/BaseTools/Source/C/Makefiles/header.makefile
>  b/BaseTools/Source/C/Makefiles/header.makefile
> +@@ -47,9 +47,9 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I 
> $(MAKEROOT)/Include/Common -I $(MAKE
> + BUILD_CPPFLAGS = $(INCLUDE) -O2
> + ifeq ($(DARWIN),Darwin)
> + # assume clang or clang compatible flags on OS X
> +-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
> -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c 
> -g
> ++BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
> -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-self-assign 
> -Wno-unused-result -nostdlib -c -g
> + else
> +-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
> -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g
> ++BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wal