public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V2] BaseTools: Fix DevicePath tool build failure issue
@ 2022-04-04  3:46 Bob Feng
  2022-04-11  3:14 ` Yuwei Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Feng @ 2022-04-04  3:46 UTC (permalink / raw)
  To: devel; +Cc: Feng, Bob C, Rebecca Cran, Yuwei Chen, Gerd Hoffmann, Liming Gao

From: "Feng, Bob C" <bob.c.feng@intel.com>

Fix the DevicePath tool build failure that was introduced by
the fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning").
Failure cases are:
1. clang 13.1.6 on macOS
2. gcc5.4

Reported-by: Rebecca Cran <rebecca@bsdio.com>
Reported-by: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
---
V2 update the method to get gcc version
 BaseTools/Source/C/DevicePath/GNUmakefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
index b05d2bddfa..c217674345 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -11,12 +11,17 @@ APPNAME = DevicePath
 
 OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtilities.o
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
+GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+ifneq ("$(GCCVERSION)", "5")
+ifneq ($(CXX), llvm)
 # gcc 12 trips over device path handling
 BUILD_CFLAGS += -Wno-error=stringop-overflow
+endif
+endif
 
 LIBS = -lCommon
 ifeq ($(CYGWIN), CYGWIN)
   LIBS += -L/lib/e2fsprogs -luuid
 endif
-- 
2.29.1.windows.1


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

* Re: [Patch V2] BaseTools: Fix DevicePath tool build failure issue
  2022-04-04  3:46 [Patch V2] BaseTools: Fix DevicePath tool build failure issue Bob Feng
@ 2022-04-11  3:14 ` Yuwei Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Yuwei Chen @ 2022-04-11  3:14 UTC (permalink / raw)
  To: Feng, Bob C, devel@edk2.groups.io
  Cc: Rebecca Cran, Gerd Hoffmann, Gao, Liming

This patch looks good to me. 

Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>

> -----Original Message-----
> From: Feng, Bob C <bob.c.feng@intel.com>
> Sent: Monday, April 4, 2022 11:46 AM
> To: devel@edk2.groups.io
> Cc: Feng, Bob C <bob.c.feng@intel.com>; Rebecca Cran
> <rebecca@bsdio.com>; Chen, Christine <yuwei.chen@intel.com>; Gerd
> Hoffmann <kraxel@redhat.com>; Gao, Liming <gaoliming@byosoft.com.cn>
> Subject: [Patch V2] BaseTools: Fix DevicePath tool build failure issue
> 
> From: "Feng, Bob C" <bob.c.feng@intel.com>
> 
> Fix the DevicePath tool build failure that was introduced by the fixes:
> 22130dcd98b4 ("Basetools: turn off gcc12 warning").
> Failure cases are:
> 1. clang 13.1.6 on macOS
> 2. gcc5.4
> 
> Reported-by: Rebecca Cran <rebecca@bsdio.com>
> Reported-by: Yuwei Chen <yuwei.chen@intel.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> ---V2 update the method to get gcc version
> BaseTools/Source/C/DevicePath/GNUmakefile | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile
> b/BaseTools/Source/C/DevicePath/GNUmakefile
> index b05d2bddfa..c217674345 100644
> --- a/BaseTools/Source/C/DevicePath/GNUmakefile
> +++ b/BaseTools/Source/C/DevicePath/GNUmakefile
> @@ -11,12 +11,17 @@ APPNAME = DevicePath
>   OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o
> DevicePathUtilities.o  include $(MAKEROOT)/Makefiles/app.makefile
> +GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')+ifneq
> ("$(GCCVERSION)", "5")+ifneq ($(CXX), llvm) # gcc 12 trips over device path
> handling BUILD_CFLAGS += -Wno-error=stringop-overflow+endif+endif  LIBS
> = -lCommon ifeq ($(CYGWIN), CYGWIN)   LIBS += -L/lib/e2fsprogs -luuid
> endif--
> 2.29.1.windows.1


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

end of thread, other threads:[~2022-04-11  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-04  3:46 [Patch V2] BaseTools: Fix DevicePath tool build failure issue Bob Feng
2022-04-11  3:14 ` Yuwei Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox