]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix DevicePath tool build failure issue
authorFeng, Bob C <bob.c.feng@intel.com>
Mon, 4 Apr 2022 03:46:21 +0000 (11:46 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 12 Apr 2022 07:01:26 +0000 (07:01 +0000)
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>
BaseTools/Source/C/DevicePath/GNUmakefile

index b05d2bddfa68c977dadcb50545095f5da26c94db..c217674345b1b7884c9dab233afeb828abf8c7e2 100644 (file)
@@ -13,8 +13,13 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 \r
 include $(MAKEROOT)/Makefiles/app.makefile\r
 \r
+GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')\r
+ifneq ("$(GCCVERSION)", "5")\r
+ifneq ($(CXX), llvm)\r
 # gcc 12 trips over device path handling\r
 BUILD_CFLAGS += -Wno-error=stringop-overflow\r
+endif\r
+endif\r
 \r
 LIBS = -lCommon\r
 ifeq ($(CYGWIN), CYGWIN)\r