Re: [PATCH 0/3] BaseTools GCC: pass CC flags to linker

Liming Gao

Without this change, GCC5 LTO can pass build. With it, what difference will be in the generated image? Original way may generate the wrong image, or new way will generate the smaller image?


-----Original Message-----
From: Ard Biesheuvel []
Sent: Tuesday, August 2, 2016 10:39 PM
To: Zhu, Yonghong <>; Gao, Liming <>; Justen, Jordan L <>;;
Cc:; Ard Biesheuvel <>
Subject: [PATCH 0/3] BaseTools GCC: pass CC flags to linker

GCC5 runs in LTO mode, which means it may generate code during the link
stage, and this code generation should be subject to the same settings
as ordinary code generation.

Since we now invoke GCC as the linker, we can start passing the CC_FLAGS
to the linker as well, with only minor surgery. This does not bother
non-LTO links at all, and forces the LTO links to use the correct settings.

Ard Biesheuvel (3):
BaseTools GCC: move -c compiler flag to build rules
BaseTools GCC5: disable warnings-as-errors for now
BaseTools GCC: add the compiler flags to the linker command line

BaseTools/Conf/build_rule.template | 18 ++++++++++--------
BaseTools/Conf/tools_def.template | 18 +++++++++---------
2 files changed, 19 insertions(+), 17 deletions(-)


Join to automatically receive all group messages.