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

Bob Feng posted 1 patch 2 years, 1 month ago
Failed in applying to current master (apply log)
There is a newer version of this series
BaseTools/Source/C/DevicePath/GNUmakefile | 5 +++++
1 file changed, 5 insertions(+)
[edk2-devel] [Patch] BaseTools: Fix DevicePath tool build failure issue
Posted by Bob Feng 2 years, 1 month 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>
---
 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..7ef4c620e3 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 --version | grep ^gcc | sed 's/^.* //g' | 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 (#88377): https://edk2.groups.io/g/devel/message/88377
Mute This Topic: https://groups.io/mt/90214266/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-