Build tool will scan source code to check whether STRING_TOEKN in UNI file is
referred or not. If STRING_TOEKN is not referred, it will be ignored. But, the
problem here is that Build tool is not smart to Compiler. It just scans source
code, doesn't recognize code logic to know STRING_TOKEN is really used or not.
Thanks
Liming
From: Andrew Fish [mailto:af...@apple.com]
Sent: Thursday, August 22, 2013 2:14 AM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Remove string references from the build
On Aug 21, 2013, at 11:09 AM, Tim Lewis
<tim.le...@insyde.com<mailto:tim.le...@insyde.com>> wrote:
Andrew -
One of the problems of embedded source code processing in the Python...
Perhaps the build rule could generate the preprocessed .UNI file and that would
be what the Python would operate on, rather than the .UNI file directly. But
that would still require some sort of contract between the [Unicode-Text-File]
rule and the StrGather.py. Or StrGather.py could be invoked explicitly from the
build rules rather than implicitly.
Well it could just hard coding the contents of the makefile. You should check.
Still thinking...
And the #langdef and #string in the .uni file will not make the C preprocessor
happy ....
Thanks,
Andrew Fish
Tim
From: Andrew Fish [mailto:af...@apple.com<http://apple.com>]
Sent: Wednesday, August 21, 2013 11:05 AM
To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: Re: [edk2] Remove string references from the build
Tim,
I was thinking maybe you could pre-process the .uni file, but I'm not sure that
is possible given what the build_rule.template looks like. I'm not sure if no
<Command> means hard coded in Python? So maybe you need to hack the Python?
https://svn.code.sf.net/p/edk2/code/trunk/edk2/BaseTools/Conf/build_rule.template
[Unicode-Text-File]
<InputFile>
*.uni, *.Uni, *.UNI
<OutputFile>
$(DEBUG_DIR)(+)AutoGen.c
$(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h
$(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk
<Command>
[Efi-Image.UEFI_OPTIONROM]
<InputFile>
?.efi, ?.EFI, ?.Efi
<OutputFile>
$(BIN_DIR)(+)$(MODULE_NAME).rom
<Command>
$(OPTROM) -i $(PCI_DEVICE_ID) -f $(PCI_VENDOR_ID) -l $(PCI_CLASS_CODE)
-r $(PCI_REVISION) -o $dst $(OPTROM_FLAGS) $src
[Unicode-Text-File.UEFI_HII]
<InputFile>
*.uni, *.Uni, *.UNI
<OutputFile>
$(OUTPUT_DIR)(+)$(MODULE_NAME)StrDefs.hpk
$(DEBUG_DIR)(+)$(MODULE_NAME)StrDefs.h
<Command>
Andrew Fish
On Aug 21, 2013, at 10:07 AM, Tim Lewis
<tim.le...@insyde.com<mailto:tim.le...@insyde.com>> wrote:
Anyone have advice on removing string references/text from a build based on
build switches?
1. As far as I can tell, conditionals are not allowed in .uni files.
2. As far as I can tell, conditionals are ignored when StrGather.py looks
for STRING_TOKEN (STRING_TOKEN in // or #if 0 are still recognized)
3. FeatureFlag PCDs can't control source files in an INF, so you can't
exclude the .uni from the build.
So, even though strings are never used, they are always included. Yes, I
realize that there are cases need to force the strings into the build by
placing references in comments (a better way must be available surely, perhaps
in the .uni file itself)
The best I've been able to come up with is to create two separate INF files:
one with the .uni files and one without.
Thoughts?
Tim
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/edk2-devel
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel