57 lines
1.9 KiB
Bash
Executable File
57 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
# ============================================================================
|
|
# DarkForge Linux — Phase 0, Chapter 5: Binutils Pass 1
|
|
# ============================================================================
|
|
# Purpose: Build the cross-assembler and cross-linker (binutils) as the
|
|
# first component of the cross-toolchain. This must be built first
|
|
# because both GCC and Glibc configure tests depend on it.
|
|
# Inputs: ${LFS}/sources/binutils-2.46.0.tar.xz
|
|
# Outputs: Cross-binutils installed to ${LFS}/tools/
|
|
# Assumes: Running as 'lfs' user, environment sourced from 000-env-setup.sh
|
|
# Ref: LFS 13.0 §5.2
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
source "${LFS}/sources/darkforge-env.sh"
|
|
|
|
PACKAGE="binutils"
|
|
VERSION="2.46.0"
|
|
SRCDIR="${LFS}/sources"
|
|
|
|
echo "=== Building ${PACKAGE}-${VERSION} (Cross-Toolchain Pass 1) ==="
|
|
|
|
cd "${SRCDIR}"
|
|
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
|
|
cd "${PACKAGE}-${VERSION}"
|
|
|
|
mkdir -v build
|
|
cd build
|
|
|
|
# Configure for cross-compilation
|
|
# --target=$LFS_TGT: produce binaries for our target triplet
|
|
# --prefix=$LFS/tools: install into the temporary toolchain directory
|
|
# --with-sysroot=$LFS: use $LFS as the sysroot for target libraries
|
|
# --disable-nls: no internationalization needed for build tools
|
|
# --enable-gprofng=no: don't build the profiling tool
|
|
# --disable-werror: don't fail on compiler warnings
|
|
# --enable-new-dtags: use RUNPATH (modern) instead of RPATH
|
|
# --enable-default-hash-style=gnu: GNU hash for faster symbol lookup
|
|
../configure \
|
|
--prefix="${LFS}/tools" \
|
|
--with-sysroot="${LFS}" \
|
|
--target="${LFS_TGT}" \
|
|
--disable-nls \
|
|
--enable-gprofng=no \
|
|
--disable-werror \
|
|
--enable-new-dtags \
|
|
--enable-default-hash-style=gnu
|
|
|
|
make
|
|
make install
|
|
|
|
# Cleanup
|
|
cd "${SRCDIR}"
|
|
rm -rf "${PACKAGE}-${VERSION}"
|
|
|
|
echo "=== ${PACKAGE}-${VERSION} Pass 1 complete ==="
|