* [Patch V2 1/1] BaseTools: remove directly calling for gcc command
@ 2022-07-20 0:21 Yuwei Chen
2022-07-20 0:48 ` [edk2-devel] " Ni, Ray
0 siblings, 1 reply; 2+ messages in thread
From: Yuwei Chen @ 2022-07-20 0:21 UTC (permalink / raw)
To: devel; +Cc: Bob Feng, Liming Gao
In some environment, the directly calling for gcc is not supported.
This patch fixes the issue.
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [edk2-devel] [Patch V2 1/1] BaseTools: remove directly calling for gcc command
2022-07-20 0:21 [Patch V2 1/1] BaseTools: remove directly calling for gcc command Yuwei Chen
@ 2022-07-20 0:48 ` Ni, Ray
0 siblings, 0 replies; 2+ messages in thread
From: Ni, Ray @ 2022-07-20 0:48 UTC (permalink / raw)
To: devel@edk2.groups.io, Chen, Christine; +Cc: Feng, Bob C, Gao, Liming
[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]
Does every cc support dumpversion?
thanks,
ray
________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Yuwei Chen <yuwei.chen@intel.com>
Sent: Wednesday, July 20, 2022 8:21:45 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>
Subject: [edk2-devel] [Patch V2 1/1] BaseTools: remove directly calling for gcc command
In some environment, the directly calling for gcc is not supported.
This patch fixes the issue.
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Yuwei Chen <yuwei.chen@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
[-- Attachment #2: Type: text/html, Size: 2741 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-20 0:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-20 0:21 [Patch V2 1/1] BaseTools: remove directly calling for gcc command Yuwei Chen
2022-07-20 0:48 ` [edk2-devel] " Ni, Ray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox