[edk2-devel] [PATCH] BaseTools: Use BUILD_CC when checking gcc version in DevicePath

Jake Garver via groups.io posted 1 patch 1 year, 4 months ago
Failed in applying to current master (apply log)
BaseTools/Source/C/DevicePath/GNUmakefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2-devel] [PATCH] BaseTools: Use BUILD_CC when checking gcc version in DevicePath
Posted by Jake Garver via groups.io 1 year, 4 months ago
When checking the version in DevicePath's Makefile, use BUILD_CC instead
of assuming "gcc".  BUILD_CC is set in header.makefile and is the
compiler that will actually be used to build DevicePath.  It defaults to
"gcc", but may be overridden.

Signed-off-by: Jake Garver <jake@nvidia.com>
---
 BaseTools/Source/C/DevicePath/GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
index 17f213879e..13b54ead65 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,7 +13,7 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
-GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+GCCVERSION = $(shell $(BUILD_CC) -dumpversion | awk -F'.' '{print $$1}')
 ifneq ("$(GCCVERSION)", "5")
 ifneq ($(CXX), llvm)
 ifneq ($(DARWIN),Darwin)
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97626): https://edk2.groups.io/g/devel/message/97626
Mute This Topic: https://groups.io/mt/95785320/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] BaseTools: Use BUILD_CC when checking gcc version in DevicePath
Posted by Bob Feng 1 year, 3 months ago
Thank you for fixing this issue.

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: Jake Garver <jake@nvidia.com> 
Sent: Tuesday, December 20, 2022 9:14 PM
To: devel@edk2.groups.io
Cc: jbrasen@nvidia.com; ashishsingha@nvidia.com; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Jake Garver <jake@nvidia.com>
Subject: [PATCH] BaseTools: Use BUILD_CC when checking gcc version in DevicePath

When checking the version in DevicePath's Makefile, use BUILD_CC instead of assuming "gcc".  BUILD_CC is set in header.makefile and is the compiler that will actually be used to build DevicePath.  It defaults to "gcc", but may be overridden.

Signed-off-by: Jake Garver <jake@nvidia.com>
---
 BaseTools/Source/C/DevicePath/GNUmakefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
index 17f213879e..13b54ead65 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,7 +13,7 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
-GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+GCCVERSION = $(shell $(BUILD_CC) -dumpversion | awk -F'.' '{print 
+$$1}')
 ifneq ("$(GCCVERSION)", "5")
 ifneq ($(CXX), llvm)
 ifneq ($(DARWIN),Darwin)
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#97805): https://edk2.groups.io/g/devel/message/97805
Mute This Topic: https://groups.io/mt/95785320/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-