Andrew:
  For DEBUG image, if it is compiled by MSFT, its PDB file path is still full 
path, which may cause the debug image size be different. If it is compiled by 
GCC, GenFw tool will convert ELF image to EFI image and add DEBUG entry with 
full DLL image path, which may cause the debug image size be different.

Thanks
Liming
From: Andrew Fish [mailto:[email protected]]
Sent: Saturday, March 09, 2013 2:39 AM
To: Gao, Liming
Cc: [email protected]
Subject: Re: [edk2-buildtools] Request to add $(relsrc) support to 
build_rule.template


On Mar 8, 2013, at 1:07 AM, "Gao, Liming" 
<[email protected]<mailto:[email protected]>> wrote:


Andrew:
  Yes. This method can create the same size image. For your proposal, when 
compiler source file, its related file path will be used, right? If yes, its 
command must run at $WORKSAPCE directory?


Liming yes, you are correct. I updated the [C-Code-File] rule build_rule.txt 
file to build from the WORKSPACE directory when I changed from ${src} to 
${relsrc}

    <Command.XCODE>
        cd $(WORKSPACE); "$(CC)" $(INC) $(CC_FLAGS) -o ${dst} ${relsrc}

The way GNU make works this cd is only for the subprocess that executes the 
$(CC) command and it is not global.

Thanks,

Andrew Fish


Thanks
Liming
From: Andrew Fish [mailto:[email protected]<http://apple.com>]
Sent: Friday, March 08, 2013 2:41 AM
To: 
[email protected]<mailto:[email protected]>
Subject: [edk2-buildtools] Request to add $(relsrc) support to 
build_rule.template

We would like to have the option of the ASSERT() messages being $WORKSPACE 
relative. This makes them not only small, but also a standard size.  It removes 
the need to map a drive (on Windows) or make symlinks (Unix) to try and control 
the length of the ASSERT messages.  I could not think of a way to make this 
work so I ended up adding $(relsrc) support to the build_rule.template file.

I had to make the following change to add this feature. I'm thinking there may 
be an easier way to access $(WORKSPACE), but I was not sure how to do this?

--- Source/Python/AutoGen/BuildEngine.py       (revision 14013)
+++ Source/Python/AutoGen/BuildEngine.py    (working copy)
@@ -232,6 +232,7 @@
             SrcPath = ""
             # SourceFile must be a list
             SrcFile = "$(%s)" % self.FileListMacro
+            ScrFileRel = SrcFile
         else:
             SrcFileName, SrcFileBase, SrcFileExt = SourceFile.Name, 
SourceFile.BaseName, SourceFile.Ext
             if SourceFile.Root:
@@ -242,6 +243,7 @@
                 SrcFileDir = "."
             SrcFile = SourceFile.Path
             SrcPath = SourceFile.Dir
+            ScrFileRel = os.path.relpath (SrcFile, os.getenv('WORKSPACE'))

         # destination file (the first one)
         if self.DestFileList:
@@ -264,6 +266,7 @@
             "s_name"    :   SrcFileName,
             "s_base"    :   SrcFileBase,
             "s_ext"     :   SrcFileExt,
+            "relsrc"    :   ScrFileRel,
             # destination file
             "dst"       :   DestFile,
             "d_path"    :   DestPath,

If there is interest in making this change I can create a patch. If there is a 
better way to do this please let me know.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]<mailto:[email protected]>>

Andrew Fish



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
edk2-buildtools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-buildtools-devel

Reply via email to