Skip to content

Commit c3d12d3

Browse files
authored
Generate Random Stack Cookie Values in Module Build Path (#825)
## Description If only a single module was being built instead of a platform DSC, the build scripts would not generate the random stack cookie values. On clean builds, this causes an error to be reported during the autogen process. This PR updates build.py so the code path taken on module builds will generate the random stack cookie values. - [x] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... ## How This Was Tested Tested by specifying a build module on Q35. ## Integration Instructions N/A
1 parent 2a76908 commit c3d12d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

BaseTools/Source/Python/build/build.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ def _BuildPlatform(self):
18701870
self.UniFlag,
18711871
self.Progress
18721872
)
1873-
GenerateStackCookieValues() # MU_CHANGE [BEGIN]: Add build-time random stack cookie support
1873+
GenerateStackCookieValues() # MU_CHANGE: Add build-time random stack cookie support
18741874
self.Fdf = Wa.FdfFile
18751875
self.LoadFixAddress = Wa.Platform.LoadFixAddress
18761876
self.BuildReport.AddPlatformReport(Wa)
@@ -1974,6 +1974,7 @@ def _BuildModule(self):
19741974
self.Progress,
19751975
self.ModuleFile
19761976
)
1977+
GenerateStackCookieValues() # MU_CHANGE: Add build-time random stack cookie support
19771978
self.Fdf = Wa.FdfFile
19781979
self.LoadFixAddress = Wa.Platform.LoadFixAddress
19791980
Wa.CreateMakeFile(False)
@@ -2224,7 +2225,7 @@ def PerformAutoGen(self,BuildTarget,ToolChain):
22242225
self.UniFlag,
22252226
self.Progress
22262227
)
2227-
GenerateStackCookieValues() # MU_CHANGE [BEGIN]: Add build-time random stack cookie support
2228+
GenerateStackCookieValues() # MU_CHANGE: Add build-time random stack cookie support
22282229
self.Fdf = Wa.FdfFile
22292230
self.LoadFixAddress = Wa.Platform.LoadFixAddress
22302231
self.BuildReport.AddPlatformReport(Wa)

0 commit comments

Comments
 (0)