Skip to content

[Cherry-Pick] BaseTools: Enable 4k alignment for tool chains#1845

Open
apop5 wants to merge 1 commit into
microsoft:release/202511from
apop5:personal/apop5/4kalign
Open

[Cherry-Pick] BaseTools: Enable 4k alignment for tool chains#1845
apop5 wants to merge 1 commit into
microsoft:release/202511from
apop5:personal/apop5/4kalign

Conversation

@apop5

@apop5 apop5 commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Description

Reordering x64 toolchain defines (GCCS) to use a DLINK_XIPFLAGS to set common-page-size to 0x40. Otherwise use default align (0x1000 for x64).

Reorder CLANGDWARF toolchain defines to use DLINK_XIPFLAGS to set common-page-size to 0x40 (matching existing behavior) and otherwise use default linker value (0x1000 for x64). Required modifying build_rule.template to support CLANGDWARF build family for SEC, PEI_CORE, PEIM type files.

(cherry picked from commit 87e486f)

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Local builds under linux to verify 4k alignment for x64, and 0x40 alignment for ia32

Integration Instructions

This may increase the size of compiled images.
If platforms choose to opt out of 4k alignment, they can do so with a DLINK override in their platform DSC file.

Reordering x64 toolchain defines (GCCS) to use a DLINK_XIPFLAGS
to set common-page-size to 0x40. Otherwise use default align
(0x1000 for x64).

Reorder CLANGDWARF toolchain defines to use DLINK_XIPFLAGS
to set common-page-size to 0x40 (matching existing behavior)
and otherwise use default linker value (0x1000 for x64).
Required modifying build_rule.template to support CLANGDWARF
build family for SEC, PEI_CORE, PEIM type files.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
(cherry picked from commit 87e486f)
@mu-automation

mu-automation Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

❌ QEMU Validation Failed

Source Dependencies

Repository Commit
mu_basecore e1b42c2
mu_tiano_platforms 49baa9b

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A
ArmVirt DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A

Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/29129582800

This comment was automatically generated by the Mu QEMU PR Validation workflow.

@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release/202511@5315549). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             release/202511    #1845   +/-   ##
=================================================
  Coverage                  ?    2.25%           
=================================================
  Files                     ?     1640           
  Lines                     ?   421475           
  Branches                  ?     5048           
=================================================
  Hits                      ?     9501           
  Misses                    ?   411890           
  Partials                  ?       84           
Flag Coverage Δ
FmpDevicePkg 9.53% <ø> (?)
MdeModulePkg 1.65% <ø> (?)
MdePkg 5.44% <ø> (?)
NetworkPkg 0.55% <ø> (?)
PolicyServicePkg 30.42% <ø> (?)
SecurityPkg 1.56% <ø> (?)
UefiCpuPkg 4.78% <ø> (?)
UnitTestFrameworkPkg 11.70% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@apop5

apop5 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator Author

❌ QEMU Validation Failed

Source Dependencies

Repository Commit
mu_basecore e1b42c2
mu_tiano_platforms 49baa9b

Results

Platform Target Build Boot Overall Boot Time Build Logs Boot Logs
Q35 DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A
ArmVirt DEBUG ❌ failure ⏩ skipped N/A Build Logs N/A
Workflow run: https://github.com/microsoft/mu_basecore/actions/runs/29129582800

This comment was automatically generated by the Mu QEMU PR Validation workflow.

These failures are coming from /FILEALIGN directive also being quite large (4k for ArmVirt, 64 for Q35)
Running without these directives to fallback to default build tools allows the Fvs to fit in the allotted size.

https://github.com/microsoft/mu_tiano_platforms/blob/main/Platforms/QemuQ35Pkg/QemuQ35PkgX64.dsc#L60
https://github.com/microsoft/mu_tiano_platforms/blob/main/Platforms/QemuArmVirtPkg/QemuArmVirtPkg.dsc#L1398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants