Files
nixpkgs/pkgs/development/compilers/gcc/ng/15/libgcc/force-regular-dirs.patch
John Ericson 424f8f2abb gccNGPackages: Force regular dirs
Because we're building things separately, we don't need the fancy
lib/... namespacing tricks that GCC normally does to squeeze itself in
the FHS. We can just use the normal autotools libdir and include dir,
and the nixpkgs infra will sort everything out.

Where possible I submitted patches to the mailing list, and fetched
those. The ones I am vendoring are the residuals which I don't think are
ready for upstreaming yet. (I can imagine a further reworking upstream
such that we wouldn't need our own patches of that sort, but it would be
good to get the first crop merged first before discussing that.)
2025-07-21 15:40:34 -04:00

50 lines
1.6 KiB
Diff

From bb3277895d3bd77bcacb7c489ebb1390478bbc12 Mon Sep 17 00:00:00 2001
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Thu, 17 Jul 2025 11:00:07 -0400
Subject: [PATCH 2/2] Force regular dirs
Override directories in libgcc so they are normal $out/lib and
$dev/include. This is not suitable for upstreaming, but is done on top
of a different patch which is, and which makes this smaller.
---
libgcc/Makefile.in | 6 +++---
libgcc/configure.ac | 3 ---
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index 4661c36703d..986cd035148 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -202,10 +202,10 @@ STRIP = @STRIP@
STRIP_FOR_TARGET = $(STRIP)
# Used to install the shared libgcc.
-slibdir = @slibdir@
+slibdir = $(libdir)
# Maybe used for DLLs on Windows targets.
-toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
+toolexecdir = $(bindir)
+toolexeclibdir = $(libdir)
export AR_FOR_TARGET
export AR_CREATE_FOR_TARGET
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 5fdac5d95f2..89044cb65c9 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -479,9 +479,6 @@ if test x"$enable_as_accelerator_for" != x; then
accel_dir_suffix=/accel/${target_noncanonical}
real_host_noncanonical=${enable_as_accelerator_for}
fi
-# Directory in which the compiler finds libraries etc.
-libdir=${orig_libdir}/gcc/${real_host_noncanonical}/'$(version)'${accel_dir_suffix}
-includedir=${libdir}/include
if test x"$enable_offload_targets" != x; then
extra_parts="${extra_parts} crtoffloadbegin.o crtoffloadend.o"
--
2.47.2