-
-
Notifications
You must be signed in to change notification settings - Fork 205
Further optimization for space (-Os -> -Oz): musl-cross-make-> bump to gcc 15.1.0 & related changes #1991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
69ab1d1 to
c19ab15
Compare
|
This PR will be needed soon, since xx20 (t420/x220) are near space exhaustion (less than 100kb free left) as can be seen at #2041 (comment) : the t420-hotp-maximized rom has 67kb free left in CBFS region. |
This comment was marked as outdated.
This comment was marked as outdated.
Local build:
Builds are reproducible if built clean ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades the Heads build toolchain from GCC 9.4.0 to GCC 15.1.0 and systematically switches compiler optimization flags from -Os (optimize for size) to -Oz (optimize aggressively for size) across 30+ modules. The changes deliver a 1.44% space reduction (115 KB) in the final firmware payload through improved compiler optimization and enhanced binary stripping.
Key changes include:
- GCC toolchain upgrade via musl-cross-make bump to latest commit with GCC 15.1.0
- C23 compatibility patches for multiple modules (tpmtotp, powerpc-utils, bash, e2fsprogs, gpg2, cairo, linux kernel)
- Systematic
-Osto-Ozoptimization flag conversion across all modules - New CBFS/IFD validation script with automatic size fixing capability
- Module version bumps: kexec-tools (2.0.26→2.0.31), dropbear (2016.74→2025.88)
- Enhanced Makefile with GPG injection caching and improved stripping flags
- Disabled features in OpenSSL and LVM2 for additional space savings
Reviewed changes
Copilot reviewed 59 out of 60 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/musl-cross-make | Bumps commit hash and GCC version from 9.4.0 to 15.1.0 with upgrade notes |
| patches/musl-cross-make-3635262e4524c991552789af6f36211a335a77b3/0001-use-gcc-15_1_0.patch | Updates musl-cross-make Makefile to use GCC 15.1.0 |
| patches/tpmtotp-4d63d21c8b7db2e92ddb393057f168aead147f47/*.patch | Three patches fixing GCC 15.1.0 compatibility issues (function signatures, printf formats, AES macro) |
| patches/powerpc-utils-1.3.5/0001-fix-rtas-function-pointer-signatures-gcc15.patch | Fixes function pointer declarations for C23 compatibility |
| patches/kexec-tools-2.0.31/*.patch | Six patches for kexec-tools 2.0.31: disables unused modules, improves framebuffer support, adds EBDA workaround, fixes purgatory build, uses build compiler for utils, adds x86-64 baseline flags |
| patches/lvm2-2.03.23.patch | Adds libgen.h include for basename() function required by GCC 15.1.0 |
| patches/linux-6.6.16-openpower/0008-powerpc-boot-Fix-C23-bool-compatibility-for-GCC-15.patch | Adds -std=gnu11 to PowerPC boot Makefile for C23 bool keyword conflicts |
| patches/dropbear-2025.88/0001-disable-fatal-user-group-change-errors-for-heads-environment.patch | Updates patch paths for dropbear 2025.88 source tree restructuring |
| patches/coreboot-talos_2/0003-ugly_skiboot-patch_fix_for_newer_gcc_from_musl_125.patch | Adds additional GCC 15.1.0 warning suppressions for skiboot (-Wno-error=unterminated-string-initialization, -Wno-error=misleading-indentation) |
| patches/bash-5.1.16.patch | Adds unistd.h include to lib/termcap/tparam.c for write() declaration |
| modules/kexec | Deleted - replaced by modules/kexec-tools |
| modules/kexec-tools | New module file for kexec-tools 2.0.31 with -Oz optimization |
| modules/dropbear | Updates to version 2025.88 with additional configure options for space savings |
| modules/openssl | Switches to -Oz and disables additional protocols/algorithms (dtls, ec2m, engine, gost, md2, srp, ssl3, tls1, tls1_1) |
| modules/lvm2 | Switches to -Oz and disables advanced features (thin, cache, VDO, writecache, integrity, snapshots, mirrors) |
| modules/linux | Adds -std=gnu11 flag and PowerPC-specific GCC 15.1.0 compatibility flags |
| modules/bash | Changes to -Oz with -std=gnu11 for C23 compatibility |
| modules/cairo | Changes to -Oz with -std=gnu11, -Wno-inline, -Wno-incompatible-pointer-types |
| modules/coreboot | Adds validation script calls and extensive GCC 15.1.0 compatibility documentation |
| modules/e2fsprogs | Changes to -Oz with -std=gnu11 for C23 bool keyword conflicts |
| modules/gpg2 | Changes to -Oz with -std=gnu11 and adds -DDISABLE_PHOTO_VIEWER |
| modules/libgcrypt | Changes to -Oz and disables jent-support |
| modules/zstd, modules/util-linux, modules/tpmtotp, modules/qrencode, modules/powerpc-utils, modules/pixman, modules/pinentry, modules/newt, modules/ncurses, modules/mbedtls, modules/libusb-compat, modules/libusb, modules/libpng, modules/libnitrokey, modules/libksba, modules/libhidapi-libusb, modules/libgpg-error, modules/libassuan, modules/kbd, modules/ioport, modules/io386, modules/gpg, modules/flashtools, modules/flashrom, modules/flashprog, modules/fbwhiptail, modules/exfatprogs, modules/cryptsetup2, modules/cryptsetup | All changed from -Os to -Oz optimization |
| bin/validate_cbfs_ifd_fit.sh | New validation script that checks CONFIG_CBFS_SIZE against IFD BIOS region with auto-fix capability |
| Makefile | Adds validation targets, enhances strip flags (--strip-all), implements GPG injection caching, adds verbose build hints, fixes kexec module reference, adds coreboot cbmem GCC 15.1.0 compatibility flag |
Comments suppressed due to low confidence (2)
patches/dropbear-2025.88/0001-disable-fatal-user-group-change-errors-for-heads-environment.patch:1
- The patch header line references the old path "dropbear-2016.74" but this module is being updated to "dropbear-2025.88". The patch should use paths that match the new version to avoid confusion during patch application.
patches/dropbear-2025.88/0001-disable-fatal-user-group-change-errors-for-heads-environment.patch:12 - Commenting out the
dropbear_exitcalls whensetgid/initgroupsorsetuidfail means the server will continue executing the user session even if it could not drop privileges toses.authstate.pw_uid/pw_gid, so a user who authenticated as an unprivileged account could end up with a shell running under the original (likely root) UID/GID. This silently bypasses the operating system’s privilege separation mechanisms and can turn any failure in the privilege-dropping path (for example due to security policy or environment issues) into a remote privilege escalation to the Dropbear daemon’s UID. The fix is to keep these failures fatal (e.g., by retainingdropbear_exitor otherwise aborting the session) so that no user commands are executed when user/group changes fail.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
patches/kexec-tools-2.0.31/0006-use-x86-64-baseline-level-for-purgatory.patch
Outdated
Show resolved
Hide resolved
Upgrade from 5.1.16 (Jan 2022) to 5.3 (Jul 2025). The newer version doesn't require patches - it already includes proper C header handling and the -std=gnu11 workaround is no longer needed thanks to upstream fixes. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991)
…for 6.1.8 only Remove duplication of EXTRA_FLAGS definition across kernel versions. Define base flags once (-fdebug-prefix-map, -gno-record-gcc-switches), then conditionally add -std=gnu11 only for kernel 6.1.8 which requires GCC 15.1 C23 compatibility workaround. Other kernel versions (4.14.62, 4.19.139, 5.4.69, 5.10.214, 6.6.16-openpower) compile without workaround flags. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Upgrade from 2.03.23 (Nov 2023) to 2.03.25 (Jul 2024). The newer version removes the libgen.h issue that required a GCC 15.1.0 workaround patch. However, GCC 15.1.0's C23 mode enforces const qualifiers on stdin/stdout/stderr, which breaks lvm2's reopen_standard_stream() calls. Port the working patch from lvm2-2.03.23 in osresearch/heads master branch (commit 63290d6) to 2.03.25. The patch wraps problematic memory allocation and log10() calls in #if 0 blocks to disable them at compile-time, maintaining compatibility with musl-libc and C23 standard enforcement. Changes: - Bump lvm2 from 2.03.23 to 2.03.25 - Update hash to 4bea6fd2e5af9cdb3e27b48b4efa8d89210d9bfa13df900e092e404720a59b1d - Replace -Os with -Oz for space optimization - Port lvm2-2.03.23.patch to lvm2-2.03.25.patch for C23 compatibility - Remove obsolete lvm2-gcc-15.1-libgen.patch Tested: EOL_x220-hotp-maximized board builds successfully with 182 KiB free CBFS Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Upgrade from 5.1.16 (Jan 2022) to 5.3 (Jul 2025). The newer version doesn't require patches - it already includes proper C header handling and the -std=gnu11 workaround is no longer needed thanks to upstream fixes. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…for 6.1.8 only Remove duplication of EXTRA_FLAGS definition across kernel versions. Define base flags once (-fdebug-prefix-map, -gno-record-gcc-switches), then conditionally add -std=gnu11 only for kernel 6.1.8 which requires GCC 15.1 C23 compatibility workaround. Other kernel versions (4.14.62, 4.19.139, 5.4.69, 5.10.214, 6.6.16-openpower) compile without workaround flags. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Upgrade from 2.03.23 (Nov 2023) to 2.03.25 (Jul 2024). The newer version removes the libgen.h issue that required a GCC 15.1.0 workaround patch. However, GCC 15.1.0's C23 mode enforces const qualifiers on stdin/stdout/stderr, which breaks lvm2's reopen_standard_stream() calls. Port the working patch from lvm2-2.03.23 in osresearch/heads master branch (commit 63290d6) to 2.03.25. The patch wraps problematic memory allocation and log10() calls in #if 0 blocks to disable them at compile-time, maintaining compatibility with musl-libc and C23 standard enforcement. Changes: - Bump lvm2 from 2.03.23 to 2.03.25 - Update hash to 4bea6fd2e5af9cdb3e27b48b4efa8d89210d9bfa13df900e092e404720a59b1d - Replace -Os with -Oz for space optimization - Port lvm2-2.03.23.patch to lvm2-2.03.25.patch for C23 compatibility - Remove obsolete lvm2-gcc-15.1-libgen.patch Tested: EOL_x220-hotp-maximized board builds successfully with 182 KiB free CBFS Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
a6f1917 to
f547ef2
Compare
Upgrade from 5.1.16 (Jan 2022) to 5.3 (Jul 2025). The newer version doesn't require patches - it already includes proper C header handling and the -std=gnu11 workaround is no longer needed thanks to upstream fixes. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…for 6.1.8 only Remove duplication of EXTRA_FLAGS definition across kernel versions. Define base flags once (-fdebug-prefix-map, -gno-record-gcc-switches), then conditionally add -std=gnu11 only for kernel 6.1.8 which requires GCC 15.1 C23 compatibility workaround. Other kernel versions (4.14.62, 4.19.139, 5.4.69, 5.10.214, 6.6.16-openpower) compile without workaround flags. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Upgrade from 2.03.23 (Nov 2023) to 2.03.25 (Jul 2024). The newer version removes the libgen.h issue that required a GCC 15.1.0 workaround patch. However, GCC 15.1.0's C23 mode enforces const qualifiers on stdin/stdout/stderr, which breaks lvm2's reopen_standard_stream() calls. Port the working patch from lvm2-2.03.23 in osresearch/heads master branch (commit 63290d6) to 2.03.25. The patch wraps problematic memory allocation and log10() calls in #if 0 blocks to disable them at compile-time, maintaining compatibility with musl-libc and C23 standard enforcement. Changes: - Bump lvm2 from 2.03.23 to 2.03.25 - Update hash to 4bea6fd2e5af9cdb3e27b48b4efa8d89210d9bfa13df900e092e404720a59b1d - Replace -Os with -Oz for space optimization - Port lvm2-2.03.23.patch to lvm2-2.03.25.patch for C23 compatibility - Remove obsolete lvm2-gcc-15.1-libgen.patch Tested: EOL_x220-hotp-maximized board builds successfully with 182 KiB free CBFS Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
f547ef2 to
90edf07
Compare
Upgrade from 5.1.16 (Jan 2022) to 5.3 (Jul 2025). The newer version doesn't require patches - it already includes proper C header handling and the -std=gnu11 workaround is no longer needed thanks to upstream fixes. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…for 6.1.8 only Remove duplication of EXTRA_FLAGS definition across kernel versions. Define base flags once (-fdebug-prefix-map, -gno-record-gcc-switches), then conditionally add -std=gnu11 only for kernel 6.1.8 which requires GCC 15.1 C23 compatibility workaround. Other kernel versions (4.14.62, 4.19.139, 5.4.69, 5.10.214, 6.6.16-openpower) compile without workaround flags. Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Upgrade from 2.03.23 (Nov 2023) to 2.03.25 (Jul 2024). The newer version removes the libgen.h issue that required a GCC 15.1.0 workaround patch. However, GCC 15.1.0's C23 mode enforces const qualifiers on stdin/stdout/stderr, which breaks lvm2's reopen_standard_stream() calls. Port the working patch from lvm2-2.03.23 in osresearch/heads master branch (commit 63290d6) to 2.03.25. The patch wraps problematic memory allocation and log10() calls in #if 0 blocks to disable them at compile-time, maintaining compatibility with musl-libc and C23 standard enforcement. Changes: - Bump lvm2 from 2.03.23 to 2.03.25 - Update hash to 4bea6fd2e5af9cdb3e27b48b4efa8d89210d9bfa13df900e092e404720a59b1d - Replace -Os with -Oz for space optimization - Port lvm2-2.03.23.patch to lvm2-2.03.25.patch for C23 compatibility - Remove obsolete lvm2-gcc-15.1-libgen.patch Tested: EOL_x220-hotp-maximized board builds successfully with 182 KiB free CBFS Ref: GCC 15.1.0 upgrade (PR linuxboot#1991) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
90edf07 to
f6a4e38
Compare
modules/libgcrypt
Outdated
| --disable-doc \ | ||
| --disable-static \ | ||
| --disable-jent-support \ | ||
| --enable-ciphers="aes des chacha20" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we decided to be prescriptive, we could economize ~310KB of precious SPI space.
… bump gcc 9.4.0 -> gcc 15.1.0 (in the goal of using gcc 12+ -Oz instead of -Os for more agressive optimization for space) Bump musl-cross-make and set default GCC to 15.1.0 to enable -Oz optimizations for reduced binary sizes; apply per-module C23 compatibility workarounds. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
rename kexec -> kexec-tools Update to the specified kexec-tools version migrate/rename patches to the appropriate directory Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…23 compatibility fixes Bump musl-cross-make and set default GCC to 15.1.0 to enable -Oz optimizations for reduced binary sizes; apply per-module C23 compatibility workarounds. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…being added to cpio then initrd.cpio.xz Ensure binaries and libraries are stripped before inclusion to reduce initrd size. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…totp-4d63d21c8b7db2e92ddb393057f168aead147f47: staging code fixes to comply with gcc 15.1+ Apply staging fixes for tpmtotp to address function signature and printf format issues with GCC 15.1. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…(unused): requires to be built with -O0 Disable jitter entropy support (unused) to avoid needing -O0 and simplify reproducible builds. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…used cryptographic algorithms Disable unused cryptographic algorithms to shrink OpenSSL artifacts. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…tion Add additional optimization flags to reduce LVM2 binary size (~8.5KB). Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…uce size Add configure flags: `--enable-ciphers="aes des chacha20"`, `--enable-pubkey-ciphers="rsa ecc"`, and `--enable-digests="sha1 sha256 sha512 blake2"` to reduce the built footprint (~310KB) by limiting algorithms to those used. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…enables Adopt -Oz as the baseline optimization level and remove explicit `--enable-ciphers`, `--enable-pubkey-ciphers`, and `--enable-digests` configure flags that limited algorithm sets. The removal centralizes optimization and algorithm selection and avoids duplication of size tweaks. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Add 0008-powerpc-boot-Fix-C23-bool-compatibility-for-GCC-15.patch to fix C23 "bool" compatibility issues for PPC64 builds under GCC 15.1; this patch targets the bool/type compatibility to resolve build failures related to C23 bool handling. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…tion-pointer-signatures-gcc15.patch: function pointers need proper signatures to match their actual usage Adjust RTAS helper function pointer types to match their actual signatures to avoid GCC 15 compilation errors. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…003-ugly_skiboot-patch_fix_for_newer_gcc_from_musl_125.patch: add patches needed for skiboot to be compiled in little-endian by heads boostrapped gcc15.1 compiler Add patches required for skiboot to build in little-endian when using the GCC 15.1 bootstrap toolchain. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Standardize TODO style to TODO(GCC15-...) and clarify GCC 15 compatibility workarounds and required follow-ups per module. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…for 6.1.8 only Centralize EXTRA_FLAGS and only add -std=gnu11 for Linux 6.1.8 (currently used by most board configs) to address GCC 15.1 C23 compatibility problems. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…rypt, libksba, libassuan Replace large configure patches with small sed edits at configure-time (e.g., set hardcode_into_libs=no) to reduce maintenance burden. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…0 compatibility Upgrade Dropbear to 2025.88, update tar URL/checksum, and disable unused configure features to reduce build surface. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
b724a84 to
7b9d668
Compare
|
Putting back to draft, kexec to next kernel fails. Heads says which in debug.log shows that kexec fails with |
…MEMFD_CREATE Enable CONFIG_TMPFS=y in all 11 kernel configs. This automatically enables CONFIG_MEMFD_CREATE via kernel's 'def_bool TMPFS || HUGETLBFS'. Root cause: upstream kexec-tools 2.0.32 copybuf_memfd() unconditionally calls memfd_create() syscall with no fallback. Without CONFIG_MEMFD_CREATE at runtime, it returns -1, causing 'Failed to copy decompressed buf' error when loading gzip kernels. Regenerated all kernel configs via 'make oldconfig' with GCC 15.1.0 toolchain, which updates compiler capability flags and memory initialization settings. Fixes gzip kernel loading on 58 boards using 6.1.8 and 6.6.16 kernels. Kernel configs with CONFIG_MEMFD_CREATE=y: - novacustom-common (4 boards) - x230-maximized (19 boards) - t480 (4 boards) - t440p (2 boards) - w541 (2 boards) - c216 (2 boards) - qemu (18 boards) - talos-2 (1 board) - librem_common (1 board) - librem_common-6.1.8 (9 boards) - msi-z690-z790 (4 boards) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
aa56e01 to
591dd2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 71 out of 71 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (3)
patches/kexec-tools-2.0.32/0002-improve-framebuffer-setup-with-intel-drm-support.patch:2
- The patch header shows a future date "2025-08-11" which appears to be inconsistent with the current date (January 2026). Patch timestamps should reflect when the patch was actually created or when the code change occurred.
patches/dropbear-2025.88/0001-disable-fatal-user-group-change-errors-for-heads-environment.patch:2 - The patch path in the dropbear module has changed from referencing "dropbear-2016.74" to a more generic "src/" path. This suggests the directory structure of dropbear has changed between versions. Verify that the patch applies correctly to the new version 2025.88's actual directory structure.
patches/dropbear-2025.88/0001-disable-fatal-user-group-change-errors-for-heads-environment.patch:13 - This patch disables the fatal error handling when
setgid,initgroups, orsetuidfail, meaning the server will silently continue the session without actually dropping privileges to the requested user. If any non-root account is ever allowed to log in (or if privilege changes unexpectedly fail due to environment or LSM restrictions), a user who should get an unprivileged session could instead inherit the current (often root) privileges, leading to a silent privilege escalation. Preserve the existing behavior of terminating the session on failure (or at least aborting the child before executing any user command) and log the error instead of continuing execution with incorrect credentials.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| libksba_configure := \ | ||
| $(CROSS_TOOLS) \ | ||
| CFLAGS="-Os" \ | ||
| sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed command to replace hardcode_into_libs is applied in-place to the configure script without checking if the pattern exists or if the substitution succeeds. Consider adding error checking or using a more robust approach (such as a proper patch file) to ensure the modification is applied correctly and fails gracefully if the configure script structure has changed.
| @@ -1,5 +1,16 @@ | |||
| modules-$(CONFIG_POWERPC_UTILS) += powerpc-utils | |||
|
|
|||
| # GCC_15_POWERPC_UTILS: Function pointer signature compatibility for GCC 15.1 | |||
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TODO comment references "GCC_15_POWERPC_UTILS" as an identifier, but the more conventional format would be "TODO(GCC15_POWERPC_UTILS)" or simply "TODO:". Consider using a consistent TODO format throughout the codebase for better searchability and tooling support.
| --disable-systemd-journal \ | ||
| --disable-app-machineid \ | ||
| --disable-blkid_wiping \ | ||
| --disable-o_direct \ | ||
| --disable-fsadm \ | ||
| --disable-blkdeactivate \ | ||
| --disable-blkzeroout \ | ||
| --without-blkid \ | ||
| --without-udev \ | ||
| --with-cluster=none \ | ||
| --with-thin=none \ | ||
| --with-cache=none \ | ||
| --with-vdo=none \ | ||
| --with-writecache=none \ | ||
| --with-integrity=none \ | ||
| --with-snapshots=none \ | ||
| --with-mirrors=none \ | ||
| --disable-udev_rules \ | ||
| --disable-pkgconfig \ | ||
| --disable-nls \ | ||
| --with-thin-check= \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling advanced LVM features (thin provisioning, cache, VDO, writecache, integrity, snapshots, mirrors) significantly reduces LVM functionality. While this achieves space optimization goals, it may break existing configurations or scripts that expect these features. Consider documenting which LVM operations are still supported and which will fail with this minimal build.
| @$(CROSS)strip --preserve-dates --strip-all "$$@" 2>&-; true | ||
| initrd_bins += $(initrd_bin_dir)/$(notdir $1) | ||
| endef | ||
|
|
||
| define initrd_lib_add = | ||
| $(initrd_lib_dir)/$(notdir $1): $1 | ||
| $(call do,INSTALL-LIB,$(1:$(pwd)/%=%),\ | ||
| $(CROSS)strip --preserve-dates -o "$$@" "$$<") | ||
| $(CROSS)strip --preserve-dates --strip-all -o "$$@" "$$<") |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding "--strip-all" flag is more aggressive than the previous default strip behavior. While this achieves better space optimization, it removes all symbol and relocation information which may make debugging more difficult. Ensure this doesn't break any tools or scripts that expect certain symbol information to be present in the binaries.
| sed -i 's/cross_compiling=no/cross_compiling=yes/' configure \ | ||
| && $(CROSS_TOOLS) \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed command to force cross_compiling=yes in the configure script is a workaround that modifies the build detection logic. While this may be necessary for the cross-compilation setup, it's a fragile approach that could break if the configure script structure changes. Consider whether there's a cleaner way to signal cross-compilation to the configure script (such as setting appropriate environment variables or configure flags).
| sed -i 's/cross_compiling=no/cross_compiling=yes/' configure \ | |
| && $(CROSS_TOOLS) \ | |
| $(CROSS_TOOLS) \ |
| sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \ | ||
| && CFLAGS="-Oz" \ | ||
| $(CROSS_TOOLS) \ | ||
| ./configure \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed command to replace hardcode_into_libs is applied in-place to the configure script without checking if the pattern exists or if the substitution succeeds. Consider adding error checking or using a more robust approach (such as a proper patch file) to ensure the modification is applied correctly and fails gracefully if the configure script structure has changed.
| sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \ | |
| && CFLAGS="-Oz" \ | |
| $(CROSS_TOOLS) \ | |
| ./configure \ | |
| grep -q 'hardcode_into_libs=yes' configure || { echo "ERROR: Expected pattern 'hardcode_into_libs=yes' not found in configure; aborting."; exit 1; }; \ | |
| sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \ | |
| && CFLAGS="-Oz" \ | |
| $(CROSS_TOOLS) \ |
| libgcrypt_configure := \ | ||
| $(CROSS_TOOLS) \ | ||
| CFLAGS="-Os" \ | ||
| sed -i 's/hardcode_into_libs=yes/hardcode_into_libs=no/g' configure \ |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sed command to replace hardcode_into_libs is applied in-place to the configure script without checking if the pattern exists or if the substitution succeeds. Consider adding error checking or using a more robust approach (such as a proper patch file) to ensure the modification is applied correctly and fails gracefully if the configure script structure has changed.
| # there is no point preparing another coreboot module that won't be shared with | ||
| # anything. | ||
|
|
||
| # GCC_15_PPC64_COREBOOT: PowerPC64 dual-compiler architecture GCC 15.1 compatibility |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation comment uses an unconventional identifier format "GCC_15_PPC64_COREBOOT". For consistency with other TODO comments in the PR that use the format "TODO(GCC15-MODULE)", consider using "TODO(GCC15_PPC64_COREBOOT)" or similar consistent format.
| # GCC_15_PPC64_COREBOOT: PowerPC64 dual-compiler architecture GCC 15.1 compatibility | |
| # TODO(GCC15_PPC64_COREBOOT): PowerPC64 dual-compiler architecture GCC 15.1 compatibility |
| # CONFIG_TMPFS_INODE64 is not set | ||
| # CONFIG_HUGETLBFS is not set | ||
| CONFIG_ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP=y | ||
| CONFIG_MEMFD_CREATE=y |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling TMPFS and MEMFD_CREATE across all kernel configurations is a significant functional change. While these features are generally useful, this change should be documented in the PR description as it alters kernel capabilities beyond just the GCC upgrade and optimization changes. Ensure this change is intentional and not an accidental side effect of kernel config regeneration.
| CONFIG_MEMFD_CREATE=y | |
| # CONFIG_MEMFD_CREATE is not set |
|
Don't use yet. Can't boot multiboot Xen + kernel (qubesos) yet. |
Stats diff since #2041 got merged for x220-hotp-maximized
Master
This PR
Gain of 212 - 69 = 143 KiB free for most constrained board
Continues #590