summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2022-04-04 11:46:21 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-12 07:01:26 +0000
commit5576b17363e92ce07e9707478061d5ce38bf7d06 (patch)
treef04a0ea60fdd6c33b7685bd0e28ec73598493348 /BaseTools
parent12a50c9ce117b6106c92bb965799e709547d8494 (diff)
downloadedk2-5576b17363e92ce07e9707478061d5ce38bf7d06.zip
edk2-5576b17363e92ce07e9707478061d5ce38bf7d06.tar.gz
edk2-5576b17363e92ce07e9707478061d5ce38bf7d06.tar.bz2
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 <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> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/C/DevicePath/GNUmakefile5
1 files changed, 5 insertions, 0 deletions
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)