#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 3: Chroot Environment for Chapter 8 Builds # ============================================================================ # Purpose: Sourced by all Phase 3 build scripts. Sets hardware-specific # compiler flags for native compilation targeting AMD Zen 5. # ============================================================================ # Hardware-specific flags — AMD Ryzen 9 9950X3D (Zen 5) export CFLAGS="-march=znver5 -O2 -pipe -fomit-frame-pointer" export CXXFLAGS="${CFLAGS}" export LDFLAGS="-Wl,-O1,--as-needed" export MAKEFLAGS="-j32" # Standard paths export SRCDIR="/sources" export SCRIPTS="/sources/toolchain-scripts" # Helper function for consistent build pattern pkg_extract() { local tarball="$1" cd "${SRCDIR}" tar -xf "${tarball}" } pkg_cleanup() { local dir="$1" cd "${SRCDIR}" rm -rf "${dir}" }