[edk2-devel] [Patch V3 1/1] BaseTools: remove directly calling for gcc command
Yuwei Chen
yuwei.chen at intel.com
Fri Jul 22 00:27:09 UTC 2022
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4003
In some environment, the directly calling for gcc is not supported.
This patch fixes the issue.
Cc: Bob Feng <bob.c.feng at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen at intel.com>
---
BaseTools/Source/C/DevicePath/GNUmakefile | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
old mode 100644
new mode 100755
index c217674345b1..5944e80bd2b4
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,12 +13,15 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
include $(MAKEROOT)/Makefiles/app.makefile
-GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+GCCVERSION=0
+ifneq ($(CXX), gcc)
+ GCCVERSION = $(shell $(CXX) -dumpversion | awk -F'.' '{print $$1}')
+endif
ifneq ("$(GCCVERSION)", "5")
-ifneq ($(CXX), llvm)
-# gcc 12 trips over device path handling
-BUILD_CFLAGS += -Wno-error=stringop-overflow
-endif
+ ifneq ($(CXX), llvm)
+ # gcc 12 trips over device path handling
+ BUILD_CFLAGS += -Wno-error=stringop-overflow
+ endif
endif
LIBS = -lCommon
--
2.27.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91683): https://edk2.groups.io/g/devel/message/91683
Mute This Topic: https://groups.io/mt/92539013/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list