On Mar 13, 2013, at 9:20 AM, "Gao, Liming" <[email protected]> wrote:

> 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.
>  

I agree that ${relsrc} only solves the ASSERT problem. 

For Xcode we use a tool called mtoc to convert from from Mach-O (which has our 
debug info) to PE/COFF. mtoc takes an argument -d and this is what is placed 
PE/COFF debug section. We currently place the BaseName, or GUID as the name in 
the debug section.  So for us the size is fixed and independent of directory 
structure. 

After the mtoc action we copy the Mach-O symbol files to a DEBUG_XCLANG/Symbols 
directory, and after the build we copy our debugger scripts into this 
directory.  We launch lldb from the Symbols directory and our symbol loading 
scripts know how to find the symbols. 

Basically I don't mind overriding the Conf/build_rules.txt file, but I'd rather 
not have to mess with the Python. 

Thanks,

Andrew Fish

> 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]> 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]] 
> Sent: Friday, March 08, 2013 2:41 AM
> To: [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]>
>  
> 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