Skip to content

Commit

Permalink
BaseTools: GenC: Fixing an edge case where BUILDMODULE might fail
Browse files Browse the repository at this point in the history
This change fixed an edge case when invoking the build process with
"BUILDMODULE" and no stack cookie is involved (i.e. pure assembly code),
the build might fail.

The existing code path is written to handle such case, but the error
method is actually breaking the build. This change demotes the message
to warning.

This was tested on QEMU Q35 build process.

Signed-off-by: Kun Qin <[email protected]>

(cherry picked from commit ca0ae3c)
  • Loading branch information
kuqin12 committed Jul 26, 2024
1 parent 4473478 commit d14003c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BaseTools/Source/Python/AutoGen/GenC.py
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,7 @@ def CreateCode(Info, AutoGenC, AutoGenH, StringH, UniGenCFlag, UniGenBinBuffer,
else:
CookieValue = int(GlobalData.gStackCookieValues64[hash(Info.Guid) % len(GlobalData.gStackCookieValues64)])
except:
EdkLogger.error("build", AUTOGEN_ERROR, "Failed to get Stack Cookie Value List! Generating random value.", ExtraData="[%s]" % str(Info))
EdkLogger.warn("build", "Failed to get Stack Cookie Value List! Generating random value.", ExtraData="[%s]" % str(Info))
if Bitwidth == 32:
CookieValue = secrets.randbelow (0xFFFFFFFF)
else:
Expand Down

0 comments on commit d14003c

Please sign in to comment.