Skip to content

Containers: Add gcc-multilib for IA32 cross-compilation support#572

Merged
apop5 merged 2 commits into
microsoft:mainfrom
AnsenHuangMSFT:add-gcc-multilib-to-ubuntu24
May 4, 2026
Merged

Containers: Add gcc-multilib for IA32 cross-compilation support#572
apop5 merged 2 commits into
microsoft:mainfrom
AnsenHuangMSFT:add-gcc-multilib-to-ubuntu24

Conversation

@AnsenHuangMSFT
Copy link
Copy Markdown
Contributor

@AnsenHuangMSFT AnsenHuangMSFT commented May 4, 2026

Description

The Ubuntu-22 and Ubuntu-24 build container templates (.sync/containers/) are missing several packages required for IA32 cross-compilation and AGESA firmware builds.

Problem

  1. IA32 builds fail with atal error: bits/libc-header-start.h: No such file or directory

    • GCC uses the -m32 flag for IA32 targets (defined in BaseTools/Conf/tools_def.template)
    • This requires 32-bit glibc development headers provided by gcc-multilib / g++-multilib
  2. AGESA CBS builds fail with atal error: IdsNvIdWH.h: No such file or directory

    • AGESA's AmdCbsPkg/Tools/IdsIdGen.pl uses XML::Simple and XML::Parser to generate header files at build time
    • These Perl modules are provided by libxml-simple-perl and libxml-parser-perl

Root Cause

The container images already install cross-compilation toolchains for ARM, AArch64, and RISC-V architectures, but lack:

  • The 32-bit x86 multilib packages (on x86_64 hosts, IA32 compilation uses native GCC with -m32 rather than a cross-compiler)
  • Perl XML modules needed by AGESA code-generation scripts

Changes

Added to .sync/containers/Ubuntu-22/Dockerfile and .sync/containers/Ubuntu-24/Dockerfile:

  • gcc-multilib - 32-bit glibc headers/libs for IA32 builds
  • g++-multilib - 32-bit C++ support (tianocore container parity)
  • libxml-parser-perl - XML::Parser module for AGESA IdsIdGen.pl
  • libxml-simple-perl - XML::Simple module for AGESA IdsIdGen.pl

Testing

Validated against a Project MU AMD platform build targeting IA32+X64 architectures with TOOL_CHAIN_TAG=GCC. Without these packages:

  • Build fails at IA32 compilation (missing 32-bit headers)
  • Build fails at CBS library compilation (missing generated headers from Perl scripts)

@apop5
Copy link
Copy Markdown
Contributor

apop5 commented May 4, 2026

These need to target the files under .sync/containers.

https://github.com/microsoft/mu_devops/tree/main/.sync/containers

the Container files are synced through a github action so that the GCC version and other things are pulled from version.njk

Add gcc-multilib to .sync/containers/ Nunjucks templates for both
Ubuntu-22 and Ubuntu-24 images. This provides 32-bit glibc headers
required for IA32 (-m32) builds with GCC.

The container images already install cross-compilation toolchains for
ARM, AArch64, and RISC-V but lack the 32-bit x86 equivalent. On
x86_64 hosts, compiling for IA32 uses the native GCC with -m32,
which requires the multilib package for 32-bit headers and libraries.
@AnsenHuangMSFT AnsenHuangMSFT force-pushed the add-gcc-multilib-to-ubuntu24 branch from a946e74 to 35601fe Compare May 4, 2026 22:09
Comment thread .sync/containers/Ubuntu-22/Dockerfile
AGESA's IdsIdGen.pl uses XML::Simple and XML::Parser to generate
header files (e.g. IdsNvIdWH.h) at build time. Without these Perl
modules, CBS library compilation fails with missing headers.
@AnsenHuangMSFT AnsenHuangMSFT force-pushed the add-gcc-multilib-to-ubuntu24 branch from 5ec34f4 to 9970158 Compare May 4, 2026 22:58
@AnsenHuangMSFT
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Microsoft"

@apop5 apop5 merged commit 9ac4099 into microsoft:main May 4, 2026
3 checks passed
apop5 pushed a commit that referenced this pull request May 5, 2026
## Description

Reverts the Ubuntu-22 Dockerfile changes from #572. These packages
(gcc-multilib, g++-multilib, libxml-parser-perl, libxml-simple-perl) are
only needed for the Ubuntu-24 container image.

**Why revert Ubuntu-22:**
- No known consumer uses Ubuntu-22 for IA32 cross-compilation
- The multilib packages conflict with \gcc-12-x86-64-linux-gnux32\
causing a failure with exit code 100
- The Perl XML modules were added for AGESA CBS header generation which
only runs in the Ubuntu-24 pipeline

## Changes

- Removes \libxml-parser-perl\ and \libxml-simple-perl\ from Ubuntu-22
Dockerfile template
- Removes \g++-\-multilib\ and \gcc-\-multilib\ from Ubuntu-22
Dockerfile template

## Testing

Ubuntu-24 container is unaffected (retains all additions from #572).

Co-authored-by: Ansen Huang <ansenhuang@microsoft.com>
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