UefiPayloadPkg: Add new option "--add_cc_flags" in UniversalPayloadBuild.py
Add new option "--add_cc_flag" to append CC compilation flags when build
Payload. With this option, user can append specified build options in
build script.
Usage example to add more CC flags:
python UefiPayloadPkg/UniversalPayloadBuild.py -t GCC5 -b DEBUG --Fit \
--add_cc_flag=-mno-sse --add_cc_flag=-mno-mmx
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
This commit is contained in:
@@ -175,6 +175,7 @@
|
||||
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
|
||||
MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
|
||||
!endif
|
||||
*_*_*_CC_FLAGS = $(APPEND_CC_FLAGS)
|
||||
|
||||
[BuildOptions.AARCH64]
|
||||
GCC:*_*_*_CC_FLAGS = -mcmodel=tiny -mstrict-align
|
||||
|
||||
@@ -164,6 +164,14 @@ def BuildUniversalPayload(Args):
|
||||
for MacroItem in Args.Macro:
|
||||
Defines += " -D {}".format (MacroItem)
|
||||
|
||||
if (Args.add_cc_flags!= None):
|
||||
CcFlags = " ".join(Args.add_cc_flags)
|
||||
|
||||
# Wrap the CC flags with double quotes since we might have plenty of
|
||||
# specified build options
|
||||
FinalFlags = f'"{CcFlags}"'
|
||||
Defines += " -D APPEND_CC_FLAGS={}".format (FinalFlags)
|
||||
|
||||
#
|
||||
# Building DXE core and DXE drivers as DXEFV.
|
||||
#
|
||||
@@ -330,6 +338,7 @@ def main():
|
||||
parser.add_argument("-f", "--Fit", action='store_true', help='Build UniversalPayload file as UniversalPayload.fit', default=False)
|
||||
parser.add_argument('-l', "--LoadAddress", type=int, help='Specify payload load address', default =0x000800000)
|
||||
parser.add_argument('-c', '--DscPath', type=str, default="UefiPayloadPkg/UefiPayloadPkg.dsc", help='Path to the DSC file')
|
||||
parser.add_argument('-ac', '--add_cc_flags', action='append', help='Add specified CC compile flags')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user