From 5576b17363e92ce07e9707478061d5ce38bf7d06 Mon Sep 17 00:00:00 2001 From: "Feng, Bob C" Date: Mon, 4 Apr 2022 11:46:21 +0800 Subject: BaseTools: Fix DevicePath tool build failure issue 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 Reported-by: Yuwei Chen Signed-off-by: Gerd Hoffmann Signed-off-by: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Rebecca Cran Reviewed-by: Yuwei Chen --- 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 b05d2bd..c217674 100644 --- a/BaseTools/Source/C/DevicePath/GNUmakefile +++ b/BaseTools/Source/C/DevicePath/GNUmakefile @@ -13,8 +13,13 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili 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) -- cgit v1.1