Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-29 Thread Andrew Fish via groups.io


> On Mar 29, 2022, at 2:38 PM, Andrew Fish via groups.io 
>  wrote:
> 
> 
> 
>> On Mar 29, 2022, at 11:14 AM, gr...@grantlmul.xyz 
>>  wrote:
>> 
>> While I can't test this myself, the following does appear to result in a 
>> successful build using the same clang version:
>> 
>> 
>> diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
>> b/BaseTools/Source/C/DevicePath/GNUmakefile
>> index b05d2bddfa..81aa35aa31 100644
>> --- a/BaseTools/Source/C/DevicePath/GNUmakefile
>> +++ b/BaseTools/Source/C/DevicePath/GNUmakefile
>> @@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
>> DevicePathFromText.o  DevicePathUtili
>>  include $(MAKEROOT)/Makefiles/app.makefile
>>  
>>  # gcc 12 trips over device path handling
>> -BUILD_CFLAGS += -Wno-error=stringop-overflow
>> +ifeq($(CC), gcc)
>> +  BUILD_CFLAGS += -Wno-error=stringop-overflow
>> +endif
>>  
> 
> Gerd,
> 
> I’m not sure if this was caused by my email client but your fix did not work 
> for me.
> GNUmakefile:17: *** missing separator.  Stop.
> 

Sorry I forgot to mention I was using an Xcode clang on macOS. 

Thanks,

Andrew Fish

> I had to add a space after `ifeq` to get it to work.
> diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
> b/BaseTools/Source/C/DevicePath/GNUmakefile
> index b05d2bddfa68..ebab1d3e2617 100644
> --- a/BaseTools/Source/C/DevicePath/GNUmakefile
> +++ b/BaseTools/Source/C/DevicePath/GNUmakefile
> @@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
> DevicePathFromText.o  DevicePathUtili
>  include $(MAKEROOT)/Makefiles/app.makefile
>  
>  # gcc 12 trips over device path handling
> -BUILD_CFLAGS += -Wno-error=stringop-overflow
> +ifeq ($(CC), gcc)
> +  BUILD_CFLAGS += -Wno-error=stringop-overflow
> +endif
>  
>  LIBS = -lCommon
>  ifeq ($(CYGWIN), CYGWIN)
> 
> 
> I had been working around like this previously (I’m not sure about the 
> portability of -Wno-unknown-warning-option):
> 
> diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
> b/BaseTools/Source/C/DevicePath/GNUmakefile
> index b05d2bddfa68..d08588a81f80 100644
> --- a/BaseTools/Source/C/DevicePath/GNUmakefile
> +++ b/BaseTools/Source/C/DevicePath/GNUmakefile
> @@ -14,7 +14,7 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
> DevicePathFromText.o  DevicePathUtili
>  include $(MAKEROOT)/Makefiles/app.makefile
>  
>  # gcc 12 trips over device path handling
> -BUILD_CFLAGS += -Wno-error=stringop-overflow
> +BUILD_CFLAGS += -Wno-error=stringop-overflow -Wno-unknown-warning-option
>  
>  LIBS = -lCommon
>  ifeq ($(CYGWIN), CYGWIN)
> 
> Thanks,
> 
> Andrew Fish
>>  LIBS = -lCommon
>>  ifeq ($(CYGWIN), CYGWIN)
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88207): https://edk2.groups.io/g/devel/message/88207
Mute This Topic: https://groups.io/mt/89997416/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-29 Thread Andrew Fish via groups.io


> On Mar 29, 2022, at 11:14 AM, gr...@grantlmul.xyz wrote:
> 
> While I can't test this myself, the following does appear to result in a 
> successful build using the same clang version:
> 
> 
> diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
> b/BaseTools/Source/C/DevicePath/GNUmakefile
> index b05d2bddfa..81aa35aa31 100644
> --- a/BaseTools/Source/C/DevicePath/GNUmakefile
> +++ b/BaseTools/Source/C/DevicePath/GNUmakefile
> @@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
> DevicePathFromText.o  DevicePathUtili
>  include $(MAKEROOT)/Makefiles/app.makefile
>  
>  # gcc 12 trips over device path handling
> -BUILD_CFLAGS += -Wno-error=stringop-overflow
> +ifeq($(CC), gcc)
> +  BUILD_CFLAGS += -Wno-error=stringop-overflow
> +endif
>  

Gerd,

I’m not sure if this was caused by my email client but your fix did not work 
for me.
GNUmakefile:17: *** missing separator.  Stop.

I had to add a space after `ifeq` to get it to work.
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
b/BaseTools/Source/C/DevicePath/GNUmakefile
index b05d2bddfa68..ebab1d3e2617 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
DevicePathFromText.o  DevicePathUtili
 include $(MAKEROOT)/Makefiles/app.makefile
 
 # gcc 12 trips over device path handling
-BUILD_CFLAGS += -Wno-error=stringop-overflow
+ifeq ($(CC), gcc)
+  BUILD_CFLAGS += -Wno-error=stringop-overflow
+endif
 
 LIBS = -lCommon
 ifeq ($(CYGWIN), CYGWIN)


I had been working around like this previously (I’m not sure about the 
portability of -Wno-unknown-warning-option):

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
b/BaseTools/Source/C/DevicePath/GNUmakefile
index b05d2bddfa68..d08588a81f80 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -14,7 +14,7 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
DevicePathFromText.o  DevicePathUtili
 include $(MAKEROOT)/Makefiles/app.makefile
 
 # gcc 12 trips over device path handling
-BUILD_CFLAGS += -Wno-error=stringop-overflow
+BUILD_CFLAGS += -Wno-error=stringop-overflow -Wno-unknown-warning-option
 
 LIBS = -lCommon
 ifeq ($(CYGWIN), CYGWIN)

Thanks,

Andrew Fish
>  LIBS = -lCommon
>  ifeq ($(CYGWIN), CYGWIN)
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88206): https://edk2.groups.io/g/devel/message/88206
Mute This Topic: https://groups.io/mt/89997416/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-29 Thread grant
While I can't test this myself, the following does appear to result in a 
successful build using the same clang version:

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
b/BaseTools/Source/C/DevicePath/GNUmakefile

index b05d2bddfa..81aa35aa31 100644

--- a/BaseTools/Source/C/DevicePath/GNUmakefile

+++ b/BaseTools/Source/C/DevicePath/GNUmakefile

@@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
DevicePathFromText.o  DevicePathUtili

include $(MAKEROOT)/Makefiles/app.makefile

# gcc 12 trips over device path handling

-BUILD_CFLAGS += -Wno-error=stringop-overflow

+ifeq($(CC), gcc)

+  BUILD_CFLAGS += -Wno-error=stringop-overflow

+endif

LIBS = -lCommon

ifeq ($(CYGWIN), CYGWIN)


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88203): https://edk2.groups.io/g/devel/message/88203
Mute This Topic: https://groups.io/mt/89997416/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-28 Thread Bob Feng
Hi Gerd,

Could you provide a patch to fix this issue or revert the original commit? 

Thanks,
Bob

-Original Message-
From: Rebecca Cran  
Sent: Tuesday, March 29, 2022 5:30 AM
To: devel@edk2.groups.io; kra...@redhat.com
Cc: Pawel Polawski ; Gao, Liming 
; Chen, Christine ; Oliver 
Steffen ; Feng, Bob C 
Subject: Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

This breaks building BaseTools with clang 13.1.6 on macOS:


/Applications/Xcode.app/Contents/Developer/usr/bin/make -C DevicePath gcc  -c  
-I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I 
../Common/ -I .. -I . -I ../Include/AArch64/ -MD -fshort-wchar 
-fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations 
-Wno-self-assign -Wno-unused-result -nostdlib -g -O2  
-Wno-error=stringop-overflow DevicePath.c -o DevicePath.o
error: unknown warning option '-Werror=stringop-overflow'; did you mean 
'-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]


-- 

Rebecca Cran


On 3/24/22 6:04 AM, Gerd Hoffmann wrote:
> In function ‘SetDevicePathEndNode’,
>  inlined from ‘FileDevicePath’ at DevicePathUtilities.c:857:5:
> DevicePathUtilities.c:321:3: error: writing 4 bytes into a region of size 1 
> [-Werror=stringop-overflow=]
>321 |   memcpy (Node, , sizeof 
> (mUefiDevicePathLibEndDevicePath));
>|   
> ^
> In file included from UefiDevicePathLib.h:22,
>   from DevicePathUtilities.c:16:
> ../Include/Protocol/DevicePath.h: In function ‘FileDevicePath’:
> ../Include/Protocol/DevicePath.h:51:9: note: destination object ‘Type’ of 
> size 1
> 51 |   UINT8 Type;   ///< 0x01 Hardware Device Path.
>| ^~~~
>
> Signed-off-by: Gerd Hoffmann 
> ---
>   BaseTools/Source/C/DevicePath/GNUmakefile | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
> b/BaseTools/Source/C/DevicePath/GNUmakefile
> index 7ca08af9662d..b05d2bddfa68 100644
> --- a/BaseTools/Source/C/DevicePath/GNUmakefile
> +++ b/BaseTools/Source/C/DevicePath/GNUmakefile
> @@ -13,6 +13,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
> DevicePathFromText.o  DevicePathUtili
>   
>   include $(MAKEROOT)/Makefiles/app.makefile
>   
> +# gcc 12 trips over device path handling BUILD_CFLAGS += 
> +-Wno-error=stringop-overflow
> +
>   LIBS = -lCommon
>   ifeq ($(CYGWIN), CYGWIN)
> LIBS += -L/lib/e2fsprogs -luuid


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88147): https://edk2.groups.io/g/devel/message/88147
Mute This Topic: https://groups.io/mt/89997416/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-28 Thread Rebecca Cran

This breaks building BaseTools with clang 13.1.6 on macOS:


/Applications/Xcode.app/Contents/Developer/usr/bin/make -C DevicePath
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I 
../Include/IndustryStandard -I ../Common/ -I .. -I . -I 
../Include/AArch64/ -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror 
-Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result 
-nostdlib -g -O2  -Wno-error=stringop-overflow DevicePath.c -o DevicePath.o
error: unknown warning option '-Werror=stringop-overflow'; did you mean 
'-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]



--

Rebecca Cran


On 3/24/22 6:04 AM, Gerd Hoffmann wrote:

In function ‘SetDevicePathEndNode’,
 inlined from ‘FileDevicePath’ at DevicePathUtilities.c:857:5:
DevicePathUtilities.c:321:3: error: writing 4 bytes into a region of size 1 
[-Werror=stringop-overflow=]
   321 |   memcpy (Node, , sizeof 
(mUefiDevicePathLibEndDevicePath));
   |   
^
In file included from UefiDevicePathLib.h:22,
  from DevicePathUtilities.c:16:
../Include/Protocol/DevicePath.h: In function ‘FileDevicePath’:
../Include/Protocol/DevicePath.h:51:9: note: destination object ‘Type’ of size 1
51 |   UINT8 Type;   ///< 0x01 Hardware Device Path.
   | ^~~~

Signed-off-by: Gerd Hoffmann 
---
  BaseTools/Source/C/DevicePath/GNUmakefile | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
b/BaseTools/Source/C/DevicePath/GNUmakefile
index 7ca08af9662d..b05d2bddfa68 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,6 +13,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
DevicePathFromText.o  DevicePathUtili
  
  include $(MAKEROOT)/Makefiles/app.makefile
  
+# gcc 12 trips over device path handling

+BUILD_CFLAGS += -Wno-error=stringop-overflow
+
  LIBS = -lCommon
  ifeq ($(CYGWIN), CYGWIN)
LIBS += -L/lib/e2fsprogs -luuid



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88140): https://edk2.groups.io/g/devel/message/88140
Mute This Topic: https://groups.io/mt/89997416/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning

2022-03-24 Thread Gerd Hoffmann
In function ‘SetDevicePathEndNode’,
inlined from ‘FileDevicePath’ at DevicePathUtilities.c:857:5:
DevicePathUtilities.c:321:3: error: writing 4 bytes into a region of size 1 
[-Werror=stringop-overflow=]
  321 |   memcpy (Node, , sizeof 
(mUefiDevicePathLibEndDevicePath));
  |   
^
In file included from UefiDevicePathLib.h:22,
 from DevicePathUtilities.c:16:
../Include/Protocol/DevicePath.h: In function ‘FileDevicePath’:
../Include/Protocol/DevicePath.h:51:9: note: destination object ‘Type’ of size 1
   51 |   UINT8 Type;   ///< 0x01 Hardware Device Path.
  | ^~~~

Signed-off-by: Gerd Hoffmann 
---
 BaseTools/Source/C/DevicePath/GNUmakefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile 
b/BaseTools/Source/C/DevicePath/GNUmakefile
index 7ca08af9662d..b05d2bddfa68 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,6 +13,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o 
DevicePathFromText.o  DevicePathUtili
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
+# gcc 12 trips over device path handling
+BUILD_CFLAGS += -Wno-error=stringop-overflow
+
 LIBS = -lCommon
 ifeq ($(CYGWIN), CYGWIN)
   LIBS += -L/lib/e2fsprogs -luuid
-- 
2.35.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87986): https://edk2.groups.io/g/devel/message/87986
Mute This Topic: https://groups.io/mt/89997416/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-