Skip to content

Conversation

jserv
Copy link
Contributor

@jserv jserv commented Oct 8, 2025

This addresses build system inefficiencies and compatibility issues:

  1. Configuration change detection: Use cmp-based comparison to avoid unnecessary rebuilds when configuration hasn't actually changed. Previously, every make run would touch .config and trigger full rebuilds.
  2. Directory creation optimization: Replace runtime mkdir -p $(shell dirname) calls with order-only prerequisites (|).
  3. Configuration dependency tracking: Add $(CONFIG_FILE) as explicit prerequisite to all compilation rules. This ensures object files rebuild when feature flags change (e.g., ENABLE_JIT=1 -> 0).
  4. Build system hygiene: Remove duplicate .PHONY declarations, fix shell script indentation in riscv-arch-test.mk, and add .PHONY coverage for all target declarations.

Summary by cubic

Speeds up and stabilizes the Make build by only updating .config when values change and rebuilding objects when feature flags change. Also replaces ad‑hoc mkdir calls with proper directory prerequisites and adds clearer config warnings.

  • Refactors

    • Update .config only when config actually changes; remove forced config step from default build.
    • Track $(CONFIG_FILE) in all compile rules (core, dev, tests, tools, softfloat) so files rebuild when flags change.
    • Use order-only prerequisites and explicit dir targets instead of inline mkdir.
    • Add GNU make version check for order-only prerequisites.
    • Clean up .PHONY targets and minor make/script formatting; soften noisy logs (use warnings where appropriate).
    • Add config validation messages (e.g., SDL with SYSTEM/FULL4G, T2C disabled note).
  • Migration

    • Requires GNU make 3.81 or newer.

cubic-dev-ai[bot]

This comment was marked as outdated.

@jserv jserv force-pushed the refine-configurations branch 7 times, most recently from 391c5d4 to 452f0dd Compare October 9, 2025 03:37
jserv added 2 commits October 9, 2025 13:00
This addresses build system inefficiencies and compatibility issues:
1. Configuration change detection: Use cmp-based comparison to avoid
   unnecessary rebuilds when configuration hasn't actually changed.
   Previously, every make run would touch .config and trigger full
   rebuilds.
2. Directory creation optimization: Replace runtime mkdir -p $(shell dirname)
   calls with order-only prerequisites (|). Add mkdir -p $(dir $@) to
   compilation rules to ensure subdirectories exist for nested object
   files (build/dtc/libfdt/*.o, build/devices/*.o).
3. Configuration dependency tracking: Add $(CONFIG_FILE) as explicit
   prerequisite to all compilation rules. This ensures object files
   rebuild when feature flags change (e.g., ENABLE_JIT=1 -> 0).
4. Emscripten SDL2_mixer fix: Add -sSTRICT=0 to CFLAGS_emcc to disable
   STRICT mode. The emscripten-ports/SDL2_mixer repository was archived
   in Jan 2024 and has warnings in music_modplug.c that become fatal
   errors under STRICT mode's -Werror flag.
5. CI scan-build fix: Set LATEST_RELEASE=dummy environment variable in
   scan-build steps. This prevents network-dependent prebuilt file
   downloads while avoiding 32-bit compilation requirements
   (ENABLE_PREBUILT=0 triggers -m32 flag which requires 32-bit
   development libraries).
6. Build system hygiene: Remove duplicate .PHONY declarations, fix shell
   script indentation in riscv-arch-test.mk, and add .PHONY coverage for
   all target declarations.
Introduce ENABLE_SDL_MIXER feature flag to conditionally compile
SDL2_mixer-dependent audio code. This allows SDL2 graphics support
without the problematic SDL2_mixer library in emscripten builds.

emscripten-ports/SDL2_mixer (archived in 2024) has unfixable compilation
warnings in music_modplug.c. The port system enforces -sSTRICT -Werror
which cannot be overridden.
@jserv jserv force-pushed the refine-configurations branch 2 times, most recently from a2bfba5 to b2178db Compare October 9, 2025 09:31
This addresses multiple CI failures related to Architecture tests and
SDL_MIXER installation across different platforms.
@jserv jserv force-pushed the refine-configurations branch from b2178db to 7928db7 Compare October 9, 2025 10:11
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.

1 participant