Skip to content

Commit

Permalink
edk2basetools/build/build.py: Add a warning about deprecated toolchains
Browse files Browse the repository at this point in the history
Print a warning at the start and end of a build if a deprecated
toolchain is used: currently those are GCC48, GCC49 and GCC5.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
  • Loading branch information
bexcran committed May 12, 2023
1 parent dddb9d6 commit 23d0890
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions edk2basetools/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
from edk2basetools.GenFds.GenFds import resetFdsGlobalVariable
from edk2basetools.AutoGen.AutoGen import CalculatePriorityValue

gDeprecatedToolChains = ['GCC48', 'GCC49', 'GCC5']

## standard targets of build command
gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']

Expand Down Expand Up @@ -900,6 +902,11 @@ def GetToolChainAndFamilyFromDsc (self, File):
for BuildTarget in self.BuildTargetList:
GlobalData.gGlobalDefines['TARGET'] = BuildTarget
for BuildToolChain in self.ToolChainList:
if BuildToolChain in gDeprecatedToolChains:
EdkLogger.warn("build", "Toolchain " + BuildToolChain + \
" is deprecated and will be removed before the edk2-stable202402 release. " \
"You should use 'GCCNOLTO' instead of 'GCC49', and 'GCC' instead of 'GCC5'")

GlobalData.gGlobalDefines['TOOLCHAIN'] = BuildToolChain
GlobalData.gGlobalDefines['TOOL_CHAIN_TAG'] = BuildToolChain
for BuildArch in self.ArchList:
Expand Down Expand Up @@ -2769,6 +2776,11 @@ def Main():
else:
BuildDurationStr = time.strftime("%H:%M:%S", BuildDuration)
if MyBuild is not None:
if any(tc in MyBuild.ToolChainList for tc in gDeprecatedToolChains):
EdkLogger.warn("build", "Toolchains " + str(gDeprecatedToolChains) + " are " \
"deprecated and will be removed before the edk2-stable202402 release. " \
"You should use 'GCCNOLTO' instead of 'GCC49', and 'GCC' instead of 'GCC5'.")

if not BuildError:
MyBuild.BuildReport.GenerateReport(BuildDurationStr, LogBuildTime(MyBuild.AutoGenTime), LogBuildTime(MyBuild.MakeTime), LogBuildTime(MyBuild.GenFdsTime))

Expand Down

0 comments on commit 23d0890

Please sign in to comment.