public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/1] BaseTools:copy the common PcdValueCommon.obj to output directory
@ 2020-03-09  7:08 Fan, ZhijuX
  2020-03-09 11:34 ` Liming Gao
  0 siblings, 1 reply; 2+ messages in thread
From: Fan, ZhijuX @ 2020-03-09  7:08 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Bob Feng, Zhiju . Fan

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2568

PcdValueInit shares the same Edk2\BaseTools\Source\C\PcdValueCommon.obj.
To avoid the conflict, it should copy this file to its output directory,
If so, PcdValueCommon.obj file will be private for PcdValueInit

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
---
 BaseTools/Source/Python/Workspace/DscBuildData.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 476c7edaf9da..15c4a0c4ab01 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -55,6 +55,7 @@ def _IsFieldValueAnArray (Value):
     return False
 
 PcdValueInitName = 'PcdValueInit'
+PcdValueCommonName = 'PcdValueCommon'
 
 PcdMainCHeader = '''
 /**
@@ -2634,10 +2635,14 @@ class DscBuildData(PlatformBuildClassObject):
 
         MakeApp = PcdMakefileHeader
         if sys.platform == "win32":
-            MakeApp = MakeApp + 'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))) + 'INC = '
+            PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))
+            shutil.copy2('%s.obj' % PcdValueCommonPath, os.path.join(self.OutputPath,'%s.obj' % PcdValueCommonName))
+            MakeApp = MakeApp + 'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath,'%s' % PcdValueCommonName)) + 'INC = '
         else:
             MakeApp = MakeApp + PcdGccMakefile
-            MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))) + \
+            PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))
+            shutil.copy2('%s.o' % PcdValueCommonPath, os.path.join(self.OutputPath, '%s.o' % PcdValueCommonName))
+            MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName) + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath,'%s' % PcdValueCommonName)) + \
                       'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'INCLUDE +='
 
         IncSearchList = []
-- 
2.14.1.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] BaseTools:copy the common PcdValueCommon.obj to output directory
  2020-03-09  7:08 [PATCH 1/1] BaseTools:copy the common PcdValueCommon.obj to output directory Fan, ZhijuX
@ 2020-03-09 11:34 ` Liming Gao
  0 siblings, 0 replies; 2+ messages in thread
From: Liming Gao @ 2020-03-09 11:34 UTC (permalink / raw)
  To: Fan, ZhijuX, devel@edk2.groups.io; +Cc: Feng, Bob C, Gao, Liming

Zhiju:
  Please specify the command of copy source file PcdValueCommon.c in the generated Makefile instead of do it in python script.

Thanks
Liming
> -----Original Message-----
> From: Fan, ZhijuX <zhijux.fan@intel.com>
> Sent: Monday, March 9, 2020 3:09 PM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Fan, ZhijuX <zhijux.fan@intel.com>
> Subject: [PATCH 1/1] BaseTools:copy the common PcdValueCommon.obj to output directory
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2568
> 
> PcdValueInit shares the same Edk2\BaseTools\Source\C\PcdValueCommon.obj.
> To avoid the conflict, it should copy this file to its output directory,
> If so, PcdValueCommon.obj file will be private for PcdValueInit
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Bob Feng <bob.c.feng@intel.com>
> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
> ---
>  BaseTools/Source/Python/Workspace/DscBuildData.py | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py
> index 476c7edaf9da..15c4a0c4ab01 100644
> --- a/BaseTools/Source/Python/Workspace/DscBuildData.py
> +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
> @@ -55,6 +55,7 @@ def _IsFieldValueAnArray (Value):
>      return False
> 
>  PcdValueInitName = 'PcdValueInit'
> +PcdValueCommonName = 'PcdValueCommon'
> 
>  PcdMainCHeader = '''
>  /**
> @@ -2634,10 +2635,14 @@ class DscBuildData(PlatformBuildClassObject):
> 
>          MakeApp = PcdMakefileHeader
>          if sys.platform == "win32":
> -            MakeApp = MakeApp + 'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' %
> (PcdValueInitName) + 'OBJECTS = %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName,
> os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))) + 'INC = '
> +            PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"],
> "Source/C/Common/PcdValueCommon"))
> +            shutil.copy2('%s.obj' % PcdValueCommonPath, os.path.join(self.OutputPath,'%s.obj' % PcdValueCommonName))
> +            MakeApp = MakeApp + 'APPFILE = %s\%s.exe\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' %
> (PcdValueInitName) + 'OBJECTS = %s\%s.obj %s.obj\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath,'%s' %
> PcdValueCommonName)) + 'INC = '
>          else:
>              MakeApp = MakeApp + PcdGccMakefile
> -            MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName)
> + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName,
> os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], "Source/C/Common/PcdValueCommon"))) + \
> +            PcdValueCommonPath = os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"],
> "Source/C/Common/PcdValueCommon"))
> +            shutil.copy2('%s.o' % PcdValueCommonPath, os.path.join(self.OutputPath, '%s.o' % PcdValueCommonName))
> +            MakeApp = MakeApp + 'APPFILE = %s/%s\n' % (self.OutputPath, PcdValueInitName) + 'APPNAME = %s\n' % (PcdValueInitName)
> + 'OBJECTS = %s/%s.o %s.o\n' % (self.OutputPath, PcdValueInitName, os.path.join(self.OutputPath,'%s' % PcdValueCommonName)) + \
>                        'include $(MAKEROOT)/Makefiles/app.makefile\n' + 'INCLUDE +='
> 
>          IncSearchList = []
> --
> 2.14.1.windows.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-09 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-09  7:08 [PATCH 1/1] BaseTools:copy the common PcdValueCommon.obj to output directory Fan, ZhijuX
2020-03-09 11:34 ` Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox