fixed missing symlinks

This commit is contained in:
2026-03-20 13:44:07 +01:00
parent 094b55919a
commit 2ab24f9aea
2 changed files with 35 additions and 0 deletions

View File

@@ -2,6 +2,28 @@
--- ---
## V42 2026-03-21 01:00:00
**Fix chroot gcc linker failure — create cross-prefix symlinks for ld**
### Changes:
- Fixed `024-chroot-essentials.sh`: Added creation of `/usr/x86_64-darkforge-linux-gnu/bin/`
with symlinks to `/usr/bin/` for ld, as, ar, nm, objcopy, objdump, ranlib, readelf, strip.
GCC pass 2 was configured with `--target=x86_64-darkforge-linux-gnu`, so it looks for
the linker at `/usr/x86_64-darkforge-linux-gnu/bin/ld`. But binutils pass 2 installed
`ld` to `/usr/bin/ld`. The missing symlink caused `ld returned 127` (not found) →
"C compiler cannot create executables" in all Chapter 7 builds.
- Added gcc diagnostic section to `024-chroot-essentials.sh` to catch this class of
issue early with clear error messages.
### Plan deviation/changes:
- None
### What is missing/needs polish:
- None
---
## V41 2026-03-21 00:30:00 ## V41 2026-03-21 00:30:00
**Fix chroot PATH and add combined chroot build runner** **Fix chroot PATH and add combined chroot build runner**

View File

@@ -23,6 +23,19 @@ echo "=== DarkForge: Creating essential files and symlinks ==="
[ -L /lib ] || { echo "ERROR: /lib should be a symlink to usr/lib"; exit 1; } [ -L /lib ] || { echo "ERROR: /lib should be a symlink to usr/lib"; exit 1; }
[ -L /sbin ] || { echo "ERROR: /sbin should be a symlink to usr/sbin"; exit 1; } [ -L /sbin ] || { echo "ERROR: /sbin should be a symlink to usr/sbin"; exit 1; }
# --- Create toolchain cross-prefix symlinks -----------------------------------
# GCC pass 2 was configured with --target=x86_64-darkforge-linux-gnu, so it
# looks for the linker (ld) and assembler (as) at:
# /usr/x86_64-darkforge-linux-gnu/bin/ld
# But binutils pass 2 installed them to /usr/bin/ld. We need symlinks.
echo ">>> Creating cross-prefix symlinks for gcc to find ld/as..."
mkdir -pv /usr/x86_64-darkforge-linux-gnu/bin
for tool in ld ld.bfd ar as nm objcopy objdump ranlib readelf strip; do
if [ -f "/usr/bin/${tool}" ]; then
ln -sfv "../../bin/${tool}" "/usr/x86_64-darkforge-linux-gnu/bin/${tool}"
fi
done
# --- Create /etc/passwd ------------------------------------------------------- # --- Create /etc/passwd -------------------------------------------------------
cat > /etc/passwd << "EOF" cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash root:x:0:0:root:/root:/bin/bash