Re: [Patch V2] BaseTools: Fix DevicePath tool build failure issue


Yuwei Chen
 

This patch looks good to me.

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

-----Original Message-----
From: Feng, Bob C <bob.c.feng@...>
Sent: Monday, April 4, 2022 11:46 AM
To: devel@edk2.groups.io
Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran
<rebecca@...>; Chen, Christine <yuwei.chen@...>; Gerd
Hoffmann <kraxel@...>; Gao, Liming <gaoliming@...>
Subject: [Patch V2] BaseTools: Fix DevicePath tool build failure issue

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

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@...>
Reported-by: Yuwei Chen <yuwei.chen@...>
Signed-off-by: Gerd Hoffmann <kraxel@...>
Signed-off-by: Bob Feng <bob.c.feng@...>
Cc: Liming Gao <gaoliming@...>
Cc: Yuwei Chen <yuwei.chen@...>
Cc: Rebecca Cran <rebecca@...>
---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

Join devel@edk2.groups.io to automatically receive all group messages.