Skip to content

Commit 72122da

Browse files
tannevaledclaude
andcommitted
fix(gcc-wrapper): keep real binary in bin/ so cc1 lookup resolves
The previous shape moved the real gcc binary to libexec/gcc-wrap/, which broke gcc's relative lookup for cc1 / cc1plus / collect2 (gcc expects them at lib/gcc/<triplet>/<version>/ relative to its OWN location). Result: `cannot execute 'cc1': No such file or directory` during fixincludes at make-install time. Keep the real binary at bin/.${tool}-real (hidden by leading dot to avoid cluttering bin/) and have bin/<tool> point at the wrapper. cc1 lookup then resolves the same way it always did. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 4977d5c commit 72122da

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

projects/gnu.org/gcc/package.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ build:
202202
esac
203203
bindir=$(cd "$(dirname "$0")" && pwd)
204204
gcc_root="$bindir/.."
205-
real="$gcc_root/libexec/gcc-wrap/$target"
205+
# IMPORTANT: keep the real binary in bin/ (as .${target}-real) so
206+
# gcc's internal lookup for cc1 / cc1plus / collect2 (all relative
207+
# to its own dir at lib/gcc/<triplet>/<ver>/) still resolves.
208+
# Moving it under libexec/ broke that lookup (#13094 v1).
209+
real="$bindir/.${target}-real"
206210
if [ -z "$CPATH" ]; then
207211
for d in "$bindir/../../../glibc/v"*; do
208212
[ -d "$d/include" ] && libc="$d" && break
@@ -245,7 +249,7 @@ build:
245249
cd {{prefix}}/bin
246250
for tool in gcc g++ cpp c++ gfortran; do
247251
[ -f "$tool" ] && [ ! -L "$tool" ] || continue
248-
mv "$tool" ../libexec/gcc-wrap/
252+
mv "$tool" ".${tool}-real"
249253
ln -sf ../libexec/gcc-wrap.sh "$tool"
250254
done
251255
if: linux

0 commit comments

Comments
 (0)