[edk2-devel] [Patch V2] BaseTools: Fix DevicePath tool build failure issue

Bob Feng posted 1 patch 2 years ago
Failed in applying to current master (apply log)
BaseTools/Source/C/DevicePath/GNUmakefile | 5 +++++
1 file changed, 5 insertions(+)
[edk2-devel] [Patch V2] BaseTools: Fix DevicePath tool build failure issue
Posted by Bob Feng 2 years ago
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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88386): https://edk2.groups.io/g/devel/message/88386
Mute This Topic: https://groups.io/mt/90234472/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch V2] BaseTools: Fix DevicePath tool build failure issue
Posted by Yuwei Chen 2 years ago
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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88678): https://edk2.groups.io/g/devel/message/88678
Mute This Topic: https://groups.io/mt/90234472/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-