lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

gccNGPackages: Force regular dirs (#427189)

authored by

John Ericson and committed by
GitHub
61656014 fd3432df

+463 -219
+1 -6
pkgs/build-support/cc-wrapper/default.nix
··· 728 728 '' 729 729 # GCC NG friendly libc++ 730 730 + optionalString (libcxx != null && libcxx.isGNU or false) '' 731 - for dir in ${getDev libcxx}/include/c++/*; do 732 - echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags 733 - done 734 - for dir in ${getDev libcxx}/include/c++/*/${targetPlatform.config}; do 735 - echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags 736 - done 731 + echo "-isystem ${getDev libcxx}/include" >> $out/nix-support/libcxx-cxxflags 737 732 '' 738 733 739 734 ##
-162
pkgs/development/compilers/gcc/ng/15/gcc/custom-threading-model.patch
··· 1 - From 46280d27a5c96b2efa7a61f49ee8dc14f7e10d0c Mon Sep 17 00:00:00 2001 2 - From: John Ericson <git@JohnEricson.me> 3 - Date: Sun, 22 Aug 2021 01:14:22 -0400 4 - Subject: [PATCH] Factor out thread model detection with `GCC_AC_THREAD_MODEL` 5 - MIME-Version: 1.0 6 - Content-Type: text/plain; charset=UTF-8 7 - Content-Transfer-Encoding: 8bit 8 - 9 - This macro deduplicates the 10 - 11 - $CC -v 2>&1 | sed -n 's/^Thread model: //p' 12 - 13 - check that was occurring in various runtime libs. 14 - 15 - Additionally, as a bit of an Easter egg, this also allows overriding 16 - what the compiler would return by setting the 17 - `gcc_cv_target_thread_file` cache variable first. I admit that it is in 18 - fact this Easter egg that led me to write the patch. The use-case for it 19 - is for making multilib builds where the library sets do not all share 20 - the same thread model easier. See also `THREAD_MODEL_SPEC` for more 21 - about the varying thread models use-case. 22 - 23 - Arguably one could could try to define on `THREAD_MODEL_SPEC` on more 24 - platforms (besides e.g. AIX) but the ramifications of this are a bit 25 - unclear. Setting `gcc_cv_target_thread_file` directly is a "low tech" 26 - solution that will work for now for sure. Of course, since setting a 27 - cache variable like this a hacky trick, I will not expect this to be at 28 - all stable/guaranteed to work, going forward. 29 - 30 - Thanks to Arsen who on IRC discussed these things with me, including in 31 - particular making it a cache var not `--with-model` flag, to not 32 - prematurely foster expectations that this is stable. 33 - 34 - Suggested-by: Arsen Arsenović <arsen@aarsen.me> 35 - --- 36 - config/gthr.m4 | 23 +++++++++++++++++++++++ 37 - libatomic/configure.ac | 4 +--- 38 - libgcc/configure.ac | 4 +--- 39 - libphobos/m4/druntime/os.m4 | 2 +- 40 - libstdc++-v3/acinclude.m4 | 8 +++----- 41 - 5 files changed, 29 insertions(+), 12 deletions(-) 42 - 43 - diff --git a/config/gthr.m4 b/config/gthr.m4 44 - index 11996247f15..e8fac4a5721 100644 45 - --- a/config/gthr.m4 46 - +++ b/config/gthr.m4 47 - @@ -5,6 +5,26 @@ dnl Public License, this file may be distributed as part of a program 48 - dnl that contains a configuration script generated by Autoconf, under 49 - dnl the same distribution terms as the rest of that program. 50 - 51 - +dnl Define thread model 52 - + 53 - +dnl usage: GCC_AC_THREAD_MODEL 54 - +AC_DEFUN([GCC_AC_THREAD_MODEL], 55 - +[ 56 - +# Specify the threading model for this GCC runtime library 57 - +# Pass with no value to take from compiler's metadata 58 - +# Pass with a value to specify a thread package 59 - +# 'single' means single threaded -- without threads. 60 - +AC_CACHE_CHECK([for the threading model used by GCC], [gcc_cv_target_thread_file], [ 61 - + # Set new cache variable 62 - + gcc_cv_target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` 63 - +]) 64 - +# Set variable name (not prefixed enough to be a good cache variable 65 - +# name) traditionally used for this purpose, to avoid having to change 66 - +# a bunch of configure scripts. 67 - +target_thread_file="$gcc_cv_target_thread_file" 68 - +]) 69 - + 70 - + 71 - dnl Define header location by thread model 72 - 73 - dnl usage: GCC_AC_THREAD_HEADER([thread_model]) 74 - @@ -23,6 +43,9 @@ case $1 in 75 - vxworks) thread_header=config/gthr-vxworks.h ;; 76 - win32) thread_header=config/i386/gthr-win32.h ;; 77 - mcf) thread_header=config/i386/gthr-mcf.h ;; 78 - + *) 79 - + AC_MSG_ERROR([No known header for threading model '$1'.]) 80 - + ;; 81 - esac 82 - AC_SUBST(thread_header) 83 - ]) 84 - diff --git a/libatomic/configure.ac b/libatomic/configure.ac 85 - index aafae71028d..a1aa3bdf69f 100644 86 - --- a/libatomic/configure.ac 87 - +++ b/libatomic/configure.ac 88 - @@ -162,9 +162,7 @@ libtool_VERSION=3:0:2 89 - AC_SUBST(libtool_VERSION) 90 - 91 - # Check for used threading-model 92 - -AC_MSG_CHECKING([for thread model used by GCC]) 93 - -target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` 94 - -AC_MSG_RESULT([$target_thread_file]) 95 - +GCC_AC_THREAD_MODEL 96 - 97 - case "$target" in 98 - *aarch64*) 99 - diff --git a/libgcc/configure.ac b/libgcc/configure.ac 100 - index 85e4f1bc48b..d44493f9653 100644 101 - --- a/libgcc/configure.ac 102 - +++ b/libgcc/configure.ac 103 - @@ -305,9 +305,7 @@ AC_SUBST([use_tm_clone_registry]) 104 - 105 - AC_LIB_PROG_LD_GNU 106 - 107 - -AC_MSG_CHECKING([for thread model used by GCC]) 108 - -target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` 109 - -AC_MSG_RESULT([$target_thread_file]) 110 - +GCC_AC_THREAD_MODEL 111 - 112 - # Check for assembler CFI support. 113 - AC_CACHE_CHECK([whether assembler supports CFI directives], [libgcc_cv_cfi], 114 - diff --git a/libphobos/m4/druntime/os.m4 b/libphobos/m4/druntime/os.m4 115 - index ef8ca434407..7bb91362dbe 100644 116 - --- a/libphobos/m4/druntime/os.m4 117 - +++ b/libphobos/m4/druntime/os.m4 118 - @@ -32,7 +32,7 @@ case $1 in 119 - # TODO: These targets need porting. 120 - dce|mipssde|rtems|tpf|vxworks) 121 - DCFG_THREAD_MODEL="Single" ;; 122 - - *) as_fn_error "Thread implementation '$1' not recognised" "$LINENO" 5 ;; 123 - + *) AC_MSG_ERROR([Thread implementation '$1' not recognised]) ;; 124 - esac 125 - AC_SUBST(DCFG_THREAD_MODEL) 126 - ]) 127 - diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 128 - index a0094c2dd95..66fc3abe4fd 100644 129 - --- a/libstdc++-v3/acinclude.m4 130 - +++ b/libstdc++-v3/acinclude.m4 131 - @@ -4345,9 +4345,7 @@ dnl Substs: 132 - dnl thread_header 133 - dnl 134 - AC_DEFUN([GLIBCXX_ENABLE_THREADS], [ 135 - - AC_MSG_CHECKING([for thread model used by GCC]) 136 - - target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'` 137 - - AC_MSG_RESULT([$target_thread_file]) 138 - + GCC_AC_THREAD_MODEL 139 - GCC_AC_THREAD_HEADER([$target_thread_file]) 140 - ]) 141 - 142 - @@ -4357,7 +4355,8 @@ dnl Check if gthread implementation defines the types and functions 143 - dnl required by the c++0x thread library. Conforming gthread 144 - dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x. 145 - dnl 146 - -dnl GLIBCXX_ENABLE_SYMVERS must be done before this. 147 - +dnl GLIBCXX_ENABLE_SYMVERS and GLIBCXX_ENABLE_THREADS must be done 148 - +dnl before this. 149 - dnl 150 - AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [ 151 - GLIBCXX_ENABLE(libstdcxx-threads,auto,,[enable C++11 threads support]) 152 - @@ -4372,7 +4371,6 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [ 153 - CXXFLAGS="$CXXFLAGS -fno-exceptions \ 154 - -I${toplevel_srcdir}/libgcc -I${toplevel_builddir}/libgcc" 155 - 156 - - target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'` 157 - case $target_thread_file in 158 - posix) 159 - CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS" 160 - -- 161 - 2.47.2 162 -
+49
pkgs/development/compilers/gcc/ng/15/libgcc/force-regular-dirs.patch
··· 1 + From bb3277895d3bd77bcacb7c489ebb1390478bbc12 Mon Sep 17 00:00:00 2001 2 + From: John Ericson <John.Ericson@Obsidian.Systems> 3 + Date: Thu, 17 Jul 2025 11:00:07 -0400 4 + Subject: [PATCH 2/2] Force regular dirs 5 + 6 + Override directories in libgcc so they are normal $out/lib and 7 + $dev/include. This is not suitable for upstreaming, but is done on top 8 + of a different patch which is, and which makes this smaller. 9 + 10 + --- 11 + libgcc/Makefile.in | 6 +++--- 12 + libgcc/configure.ac | 3 --- 13 + 2 files changed, 3 insertions(+), 6 deletions(-) 14 + 15 + diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in 16 + index 4661c36703d..986cd035148 100644 17 + --- a/libgcc/Makefile.in 18 + +++ b/libgcc/Makefile.in 19 + @@ -202,10 +202,10 @@ STRIP = @STRIP@ 20 + STRIP_FOR_TARGET = $(STRIP) 21 + 22 + # Used to install the shared libgcc. 23 + -slibdir = @slibdir@ 24 + +slibdir = $(libdir) 25 + # Maybe used for DLLs on Windows targets. 26 + -toolexecdir = @toolexecdir@ 27 + -toolexeclibdir = @toolexeclibdir@ 28 + +toolexecdir = $(bindir) 29 + +toolexeclibdir = $(libdir) 30 + 31 + export AR_FOR_TARGET 32 + export AR_CREATE_FOR_TARGET 33 + diff --git a/libgcc/configure.ac b/libgcc/configure.ac 34 + index 5fdac5d95f2..89044cb65c9 100644 35 + --- a/libgcc/configure.ac 36 + +++ b/libgcc/configure.ac 37 + @@ -479,9 +479,6 @@ if test x"$enable_as_accelerator_for" != x; then 38 + accel_dir_suffix=/accel/${target_noncanonical} 39 + real_host_noncanonical=${enable_as_accelerator_for} 40 + fi 41 + -# Directory in which the compiler finds libraries etc. 42 + -libdir=${orig_libdir}/gcc/${real_host_noncanonical}/'$(version)'${accel_dir_suffix} 43 + -includedir=${libdir}/include 44 + 45 + if test x"$enable_offload_targets" != x; then 46 + extra_parts="${extra_parts} crtoffloadbegin.o crtoffloadend.o" 47 + -- 48 + 2.47.2 49 +
+53
pkgs/development/compilers/gcc/ng/15/libgfortran/force-regular-dirs.patch
··· 1 + From 7a0c8ca8872a73c6886940448ba9b3203b13268d Mon Sep 17 00:00:00 2001 2 + From: John Ericson <git@JohnEricson.me> 3 + Date: Mon, 21 Jul 2025 11:42:13 -0400 4 + Subject: [PATCH] libgfortran: Force regular include/lib dir 5 + 6 + --- 7 + libgfortran/Makefile.am | 13 +++++-------- 8 + 1 file changed, 5 insertions(+), 8 deletions(-) 9 + 10 + diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am 11 + index 21b35c76a06..3d38cde5b42 100644 12 + --- a/libgfortran/Makefile.am 13 + +++ b/libgfortran/Makefile.am 14 + @@ -42,14 +42,13 @@ extra_darwin_ldflags_libgfortran += -Wc,-nodefaultrpaths 15 + extra_darwin_ldflags_libgfortran += -Wl,-rpath,@loader_path 16 + endif 17 + 18 + -gfor_c_HEADERS = ISO_Fortran_binding.h 19 + -gfor_cdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)/include 20 + +include_HEADERS = ISO_Fortran_binding.h 21 + 22 + LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \ 23 + $(lt_host_flags) 24 + 25 + -toolexeclib_LTLIBRARIES = libgfortran.la 26 + -toolexeclib_DATA = libgfortran.spec 27 + +lib_LTLIBRARIES = libgfortran.la 28 + +toolexeclib_DATA = libgfortran.spec # needs "exec" in name 29 + libgfortran_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS) 30 + libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \ 31 + $(LTLDFLAGS) $(LIBQUADLIB) ../libbacktrace/libbacktrace.la \ 32 + @@ -58,16 +57,14 @@ libgfortran_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` 33 + $(version_arg) -Wc,-shared-libgcc 34 + libgfortran_la_DEPENDENCIES = $(version_dep) libgfortran.spec $(LIBQUADLIB_DEP) 35 + 36 + -cafexeclib_LTLIBRARIES = libcaf_single.la 37 + -cafexeclibdir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR) 38 + +lib_LTLIBRARIES += libcaf_single.la 39 + libcaf_single_la_SOURCES = caf/single.c 40 + libcaf_single_la_LDFLAGS = -static 41 + libcaf_single_la_DEPENDENCIES = caf/libcaf.h 42 + libcaf_single_la_LINK = $(LINK) $(libcaf_single_la_LDFLAGS) 43 + 44 + if IEEE_SUPPORT 45 + -fincludedir = $(libdir)/gcc/$(target_alias)/$(gcc_version)$(MULTISUBDIR)/finclude 46 + -nodist_finclude_HEADERS = ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod 47 + +nodist_include_HEADERS = ieee_arithmetic.mod ieee_exceptions.mod ieee_features.mod 48 + endif 49 + 50 + ## io.h conflicts with a system header on some platforms, so 51 + -- 52 + 2.47.2 53 +
+30
pkgs/development/compilers/gcc/ng/15/libssp/force-regular-dirs.patch
··· 1 + From e7dac0e90f3e4363d858a6f147d7cc4f62815dd6 Mon Sep 17 00:00:00 2001 2 + From: John Ericson <John.Ericson@Obsidian.Systems> 3 + Date: Fri, 18 Jul 2025 16:54:17 -0400 4 + Subject: [PATCH 3/3] Force regular dirs 5 + 6 + Override directories in libssp so they are normal $out/lib and 7 + $dev/include. This is not suitable for upstreaming, but is done on top 8 + of a different patch which is, and which makes this smaller. 9 + --- 10 + libssp/configure.ac | 4 ---- 11 + 1 file changed, 4 deletions(-) 12 + 13 + diff --git a/libssp/configure.ac b/libssp/configure.ac 14 + index 5b9fa4fbecc..f1723dc33ce 100644 15 + --- a/libssp/configure.ac 16 + +++ b/libssp/configure.ac 17 + @@ -207,10 +207,6 @@ esac 18 + AC_SUBST(toolexecdir) 19 + AC_SUBST(toolexeclibdir) 20 + 21 + -# Directory in which the compiler finds libraries etc. 22 + -libdir='$(toolexeclibdir)' 23 + -includedir=${orig_libdir}/gcc/${host_noncanonical}/'$(version)/include' 24 + - 25 + if test ${multilib} = yes; then 26 + multilib_arg="--enable-multilib" 27 + else 28 + -- 29 + 2.47.2 30 +
+120
pkgs/development/compilers/gcc/ng/15/libstdcxx/force-regular-dirs.patch
··· 1 + From db427c55334dd2edc11397d3a92d55dc9c06d1c3 Mon Sep 17 00:00:00 2001 2 + From: John Ericson <git@JohnEricson.me> 3 + Date: Sun, 20 Jul 2025 14:20:00 -0400 4 + Subject: [PATCH] libstdc++: Force regular include/lib dir 5 + 6 + Delete a bunch of unneeded logic to do this. 7 + --- 8 + libstdc++-v3/acinclude.m4 | 80 ++------------------------------ 9 + libstdc++-v3/include/Makefile.am | 2 +- 10 + 2 files changed, 4 insertions(+), 78 deletions(-) 11 + 12 + diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 13 + index a0094c2dd95..a0718dff394 100644 14 + --- a/libstdc++-v3/acinclude.m4 15 + +++ b/libstdc++-v3/acinclude.m4 16 + @@ -727,85 +727,11 @@ dnl 17 + dnl This logic must match gcc/configure.ac's setting of gcc_gxx_include_dir. 18 + dnl config/gxx-include-dir.m4 must be kept consistant with this as well. 19 + AC_DEFUN([GLIBCXX_EXPORT_INSTALL_INFO], [ 20 + - glibcxx_toolexecdir=no 21 + - glibcxx_toolexeclibdir=no 22 + + glibcxx_toolexecdir='$(libdir)' 23 + + glibcxx_toolexeclibdir='$(libdir)' 24 + + gxx_include_dir='$(includedir)' 25 + glibcxx_prefixdir=$prefix 26 + 27 + - AC_MSG_CHECKING([for gxx-include-dir]) 28 + - AC_ARG_WITH([gxx-include-dir], 29 + - AC_HELP_STRING([--with-gxx-include-dir=DIR], 30 + - [installation directory for include files]), 31 + - [case "$withval" in 32 + - yes) AC_MSG_ERROR([Missing directory for --with-gxx-include-dir]) ;; 33 + - no) gxx_include_dir=no ;; 34 + - *) gxx_include_dir=$withval ;; 35 + - esac], 36 + - [gxx_include_dir=no]) 37 + - AC_MSG_RESULT($gxx_include_dir) 38 + - 39 + - AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) 40 + - AC_ARG_ENABLE([version-specific-runtime-libs], 41 + - AC_HELP_STRING([--enable-version-specific-runtime-libs], 42 + - [Specify that runtime libraries should be installed in a compiler-specific directory]), 43 + - [case "$enableval" in 44 + - yes) version_specific_libs=yes ;; 45 + - no) version_specific_libs=no ;; 46 + - *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; 47 + - esac], 48 + - [version_specific_libs=no]) 49 + - AC_MSG_RESULT($version_specific_libs) 50 + - 51 + - GCC_WITH_TOOLEXECLIBDIR 52 + - 53 + - # Default case for install directory for include files. 54 + - if test $version_specific_libs = no && test $gxx_include_dir = no; then 55 + - gxx_include_dir='include/c++/${gcc_version}' 56 + - if test -n "$with_cross_host" && 57 + - test x"$with_cross_host" != x"no"; then 58 + - gxx_include_dir='${prefix}/${target_alias}/'"$gxx_include_dir" 59 + - else 60 + - gxx_include_dir='${prefix}/'"$gxx_include_dir" 61 + - fi 62 + - fi 63 + - 64 + - # Version-specific runtime libs processing. 65 + - if test $version_specific_libs = yes; then 66 + - # Need the gcc compiler version to know where to install libraries 67 + - # and header files if --enable-version-specific-runtime-libs option 68 + - # is selected. FIXME: these variables are misnamed, there are 69 + - # no executables installed in _toolexecdir or _toolexeclibdir. 70 + - if test x"$gxx_include_dir" = x"no"; then 71 + - gxx_include_dir='${libdir}/gcc/${host_alias}/${gcc_version}/include/c++' 72 + - fi 73 + - glibcxx_toolexecdir='${libdir}/gcc/${host_alias}' 74 + - glibcxx_toolexeclibdir='${toolexecdir}/${gcc_version}$(MULTISUBDIR)' 75 + - fi 76 + - 77 + - # Calculate glibcxx_toolexecdir, glibcxx_toolexeclibdir 78 + - # Install a library built with a cross compiler in tooldir, not libdir. 79 + - if test x"$glibcxx_toolexecdir" = x"no"; then 80 + - if test -n "$with_cross_host" && 81 + - test x"$with_cross_host" != x"no"; then 82 + - glibcxx_toolexecdir='${exec_prefix}/${host_alias}' 83 + - case ${with_toolexeclibdir} in 84 + - no) 85 + - glibcxx_toolexeclibdir='${toolexecdir}/lib' 86 + - ;; 87 + - *) 88 + - glibcxx_toolexeclibdir=${with_toolexeclibdir} 89 + - ;; 90 + - esac 91 + - else 92 + - glibcxx_toolexecdir='${libdir}/gcc/${host_alias}' 93 + - glibcxx_toolexeclibdir='${libdir}' 94 + - fi 95 + - multi_os_directory=`$CXX -print-multi-os-directory` 96 + - case $multi_os_directory in 97 + - .) ;; # Avoid trailing /. 98 + - *) glibcxx_toolexeclibdir=$glibcxx_toolexeclibdir/$multi_os_directory ;; 99 + - esac 100 + - fi 101 + - 102 + AC_MSG_CHECKING([for install location]) 103 + AC_MSG_RESULT($gxx_include_dir) 104 + 105 + diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am 106 + index 537774c2668..c0bfeb43b44 100644 107 + --- a/libstdc++-v3/include/Makefile.am 108 + +++ b/libstdc++-v3/include/Makefile.am 109 + @@ -1048,7 +1048,7 @@ endif 110 + 111 + host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR) 112 + host_builddir = ./${host_alias}/bits 113 + -host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits 114 + +host_installdir = ${gxx_include_dir}/bits 115 + host_headers = \ 116 + ${host_srcdir}/ctype_base.h \ 117 + ${host_srcdir}/ctype_inline.h \ 118 + -- 119 + 2.47.2 120 +
+55 -9
pkgs/development/compilers/gcc/ng/common/libatomic/default.nix
··· 5 5 release_version, 6 6 version, 7 7 getVersionFile, 8 + monorepoSrc ? null, 9 + fetchpatch, 8 10 autoreconfHook269, 9 - monorepoSrc ? null, 10 11 runCommand, 11 12 }: 12 13 stdenv.mkDerivation (finalAttrs: { 13 14 pname = "libatomic"; 14 15 inherit version; 15 16 16 - src = monorepoSrc; 17 + src = runCommand "libatomic-src-${version}" { src = monorepoSrc; } '' 18 + runPhase unpackPhase 19 + 20 + mkdir -p "$out/gcc" 21 + cp gcc/BASE-VER "$out/gcc" 22 + cp gcc/DATESTAMP "$out/gcc" 23 + 24 + cp -r libatomic "$out" 25 + 26 + cp -r config "$out" 27 + cp -r multilib.am "$out" 28 + cp -r libtool.m4 "$out" 29 + 30 + cp config.guess "$out" 31 + cp config.rpath "$out" 32 + cp config.sub "$out" 33 + cp config-ml.in "$out" 34 + cp ltmain.sh "$out" 35 + cp install-sh "$out" 36 + cp mkinstalldirs "$out" 37 + 38 + [[ -f MD5SUMS ]]; cp MD5SUMS "$out" 39 + ''; 17 40 18 41 patches = [ 19 - (getVersionFile "gcc/custom-threading-model.patch") 42 + (fetchpatch { 43 + name = "custom-threading-model.patch"; 44 + url = "https://inbox.sourceware.org/gcc-patches/20250716204545.1063669-1-git@JohnEricson.me/raw"; 45 + hash = "sha256-kxNntY2r4i/+XHQSpf9bYV2Jg+FD/pD5TiMn5hd4ckk="; 46 + includes = [ 47 + "config/*" 48 + "libatomic/*" 49 + ]; 50 + }) 20 51 ]; 21 52 53 + postUnpack = '' 54 + mkdir -p ./build 55 + buildRoot=$(readlink -e "./build") 56 + ''; 57 + 58 + preAutoreconf = '' 59 + sourceRoot=$(readlink -e "./libatomic") 60 + cd $sourceRoot 61 + ''; 62 + 22 63 enableParallelBuilding = true; 23 64 24 65 nativeBuildInputs = [ 25 66 autoreconfHook269 26 67 ]; 27 68 28 - postPatch = '' 29 - sourceRoot=$(readlink -e "./libatomic") 30 - ''; 69 + configurePlatforms = [ 70 + "build" 71 + "host" 72 + ]; 73 + 74 + configureFlags = [ 75 + "--disable-dependency-tracking" 76 + "cross_compiling=true" 77 + "--disable-multilib" 78 + ]; 31 79 32 80 preConfigure = '' 33 - mkdir ../build 34 - cd ../build 81 + cd "$buildRoot" 35 82 configureScript=$sourceRoot/configure 36 - chmod +x "$configureScript" 37 83 ''; 38 84 39 85 doCheck = true;
+28 -7
pkgs/development/compilers/gcc/ng/common/libgcc/default.nix
··· 6 6 version, 7 7 getVersionFile, 8 8 monorepoSrc ? null, 9 + fetchpatch, 9 10 autoreconfHook269, 10 11 buildGccPackages, 11 12 buildPackages, ··· 37 38 ]; 38 39 39 40 patches = [ 40 - (getVersionFile "gcc/custom-threading-model.patch") 41 + (fetchpatch { 42 + name = "delete-MACHMODE_H.patch"; 43 + url = "https://github.com/gcc-mirror/gcc/commit/493aae4b034d62054d5e7e54dc06cd9a8be54e29.diff"; 44 + hash = "sha256-oEk0lnI96RlpALWpb7J+GnrtgQsFVqDO57I/zjiqqTk="; 45 + }) 46 + (fetchpatch { 47 + name = "custom-threading-model.patch"; 48 + url = "https://inbox.sourceware.org/gcc-patches/20250716204545.1063669-1-git@JohnEricson.me/raw"; 49 + hash = "sha256-NgiC4cFeFInXXg27me1XpSeImPaL0WHs50Tf1YHz4ps="; 50 + }) 51 + (fetchpatch { 52 + name = "libgcc.mvars-less-0.patch"; 53 + url = "https://inbox.sourceware.org/gcc-patches/20250716234028.1153560-1-John.Ericson@Obsidian.Systems/raw"; 54 + hash = "sha256-NEcieDCsy+7IRU3qQKVD3i57OuwGZKB/rmNF8X2I1n0="; 55 + }) 56 + (fetchpatch { 57 + name = "libgcc.mvars-less-1.patch"; 58 + url = "https://inbox.sourceware.org/gcc-patches/20250716234028.1153560-2-John.Ericson@Obsidian.Systems/raw"; 59 + hash = "sha256-nfRC4f6m3kHDro4+6E4y1ZPs+prxBQmn0H2rzIjaMWM="; 60 + }) 61 + (fetchpatch { 62 + name = "regular-libdir-includedir.patch"; 63 + url = "https://inbox.sourceware.org/gcc-patches/20250717174911.1536129-1-git@JohnEricson.me/raw"; 64 + hash = "sha256-Cn7rvg1FI7H/26GzSe4pv5VW/gvwbwGqivAqEeawkwk="; 65 + }) 66 + (getVersionFile "libgcc/force-regular-dirs.patch") 41 67 ]; 42 68 43 69 autoreconfFlags = "--install --force --verbose . libgcc"; ··· 95 121 tm.h \ 96 122 options.h \ 97 123 insn-constants.h \ 98 - insn-modes.h \ 99 124 version.h 100 125 ) 101 126 mkdir -p "$buildRoot/gcc/include" ··· 186 211 makeFlags = [ "MULTIBUILDTOP:=../" ]; 187 212 188 213 postInstall = '' 189 - cp gthr-default.h "$out/lib/gcc/${stdenv.hostPlatform.config}/${version}/include" 190 - moveToOutput "lib/gcc/${stdenv.hostPlatform.config}/${version}/include" "$dev" 191 - mkdir -p "$out/lib" "$dev/include" 192 - ln -s "$out/lib/gcc/${stdenv.hostPlatform.config}/${version}"/* "$out/lib" 193 - ln -s "$dev/lib/gcc/${stdenv.hostPlatform.config}/${version}/include"/* "$dev/include/" 214 + install -c -m 644 gthr-default.h "$dev/include" 194 215 ''; 195 216 196 217 doCheck = true;
+7 -8
pkgs/development/compilers/gcc/ng/common/libgfortran/default.nix
··· 5 5 gcc_meta, 6 6 release_version, 7 7 version, 8 + getVersionFile, 8 9 monorepoSrc ? null, 9 - buildPackages, 10 10 autoreconfHook269, 11 11 libiberty, 12 + buildPackages, 12 13 libgcc, 13 14 libbacktrace, 14 15 }: ··· 30 31 autoreconfHook269 31 32 libiberty 32 33 gfortran 34 + ]; 35 + 36 + patches = [ 37 + (getVersionFile "libgfortran/force-regular-dirs.patch") 33 38 ]; 34 39 35 40 autoreconfFlags = "--install --force --verbose . libgfortran"; ··· 161 166 "gcc_cv_target_thread_file=single" 162 167 # $CC cannot link binaries, let alone run then 163 168 "cross_compiling=true" 169 + "--with-toolexeclibdir=${builtins.placeholder "dev"}/lib" 164 170 ]; 165 171 166 172 # Set the variable back the way it was, see corresponding code in ··· 170 176 ''; 171 177 172 178 makeFlags = [ "MULTIBUILDTOP:=../" ]; 173 - 174 - postInstall = '' 175 - moveToOutput "lib/gcc/${stdenv.hostPlatform.config}/${version}/include" "$dev" 176 - mkdir -p "$out/lib" "$dev/include" 177 - ln -s "$out/lib/gcc/${stdenv.hostPlatform.config}/${version}"/* "$out/lib" 178 - ln -s "$dev/lib/gcc/${stdenv.hostPlatform.config}/${version}/include"/* "$dev/include/" 179 - ''; 180 179 181 180 doCheck = true; 182 181
+38 -5
pkgs/development/compilers/gcc/ng/common/libssp/default.nix
··· 4 4 gcc_meta, 5 5 release_version, 6 6 version, 7 + getVersionFile, 7 8 monorepoSrc ? null, 9 + fetchpatch, 10 + autoreconfHook269, 8 11 runCommand, 9 12 }: 10 13 stdenv.mkDerivation (finalAttrs: { ··· 19 22 cp gcc/DATESTAMP "$out/gcc" 20 23 21 24 cp -r libssp "$out" 25 + 26 + cp -r config "$out" 27 + cp -r multilib.am "$out" 22 28 23 29 cp config.guess "$out" 24 30 cp config.rpath "$out" ··· 31 37 [[ -f MD5SUMS ]]; cp MD5SUMS "$out" 32 38 ''; 33 39 34 - sourceRoot = "${finalAttrs.src.name}/libssp"; 40 + outputs = [ 41 + "out" 42 + "dev" 43 + ]; 44 + 45 + patches = [ 46 + (fetchpatch { 47 + name = "regular-libdir-includedir.patch"; 48 + url = "https://inbox.sourceware.org/gcc-patches/20250720172933.2404828-1-git@JohnEricson.me/raw"; 49 + hash = "sha256-W7dcy1Tm3O2reK7kx83DRv8W97qUfaqDbKLiLXIegRw="; 50 + }) 51 + (getVersionFile "libssp/force-regular-dirs.patch") 52 + ]; 53 + 54 + postUnpack = '' 55 + mkdir -p ./build 56 + buildRoot=$(readlink -e "./build") 57 + ''; 58 + 59 + preAutoreconf = '' 60 + sourceRoot=$(readlink -e "./libssp") 61 + cd $sourceRoot 62 + ''; 63 + 64 + enableParallelBuilding = true; 65 + 66 + nativeBuildInputs = [ 67 + autoreconfHook269 68 + ]; 35 69 36 70 configurePlatforms = [ 37 71 "build" 38 72 "host" 39 73 ]; 74 + 40 75 configureFlags = [ 41 76 "--disable-dependency-tracking" 42 - "--with-toolexeclibdir=${builtins.placeholder "out" + "/lib"}" 43 77 "cross_compiling=true" 44 78 "--disable-multilib" 45 79 ]; 46 80 47 81 preConfigure = '' 48 - mkdir ../../build 49 - cd ../../build 50 - configureScript=../$sourceRoot/configure 82 + cd "$buildRoot" 83 + configureScript=$sourceRoot/configure 51 84 ''; 52 85 53 86 hardeningDisable = [
+59 -19
pkgs/development/compilers/gcc/ng/common/libstdcxx/default.nix
··· 6 6 version, 7 7 getVersionFile, 8 8 monorepoSrc ? null, 9 + fetchpatch, 10 + autoreconfHook269, 9 11 runCommand, 10 - autoreconfHook269, 11 12 gettext, 12 13 }: 13 14 stdenv.mkDerivation (finalAttrs: { 14 15 pname = "libstdcxx"; 15 16 inherit version; 16 17 17 - src = monorepoSrc; 18 + src = runCommand "libstdcxx-src-${version}" { src = monorepoSrc; } '' 19 + runPhase unpackPhase 20 + 21 + mkdir -p "$out/gcc" 22 + cp gcc/BASE-VER "$out/gcc" 23 + cp gcc/DATESTAMP "$out/gcc" 24 + 25 + mkdir -p "$out/libgcc" 26 + cp libgcc/gthr*.h "$out/libgcc" 27 + cp libgcc/unwind-pe.h "$out/libgcc" 28 + 29 + cp -r libstdc++-v3 "$out" 30 + 31 + cp -r libiberty "$out" 32 + cp -r include "$out" 33 + cp -r contrib "$out" 34 + 35 + cp -r config "$out" 36 + cp -r multilib.am "$out" 37 + 38 + cp config.guess "$out" 39 + cp config.rpath "$out" 40 + cp config.sub "$out" 41 + cp config-ml.in "$out" 42 + cp ltmain.sh "$out" 43 + cp install-sh "$out" 44 + cp mkinstalldirs "$out" 18 45 19 - enableParallelBuilding = true; 46 + [[ -f MD5SUMS ]]; cp MD5SUMS "$out" 47 + ''; 20 48 21 - nativeBuildInputs = [ 22 - autoreconfHook269 23 - gettext 49 + outputs = [ 50 + "out" 51 + "dev" 24 52 ]; 25 53 26 54 patches = [ 27 - (getVersionFile "gcc/custom-threading-model.patch") 55 + (fetchpatch { 56 + name = "custom-threading-model.patch"; 57 + url = "https://inbox.sourceware.org/gcc-patches/20250716204545.1063669-1-git@JohnEricson.me/raw"; 58 + hash = "sha256-jPP0+MoPLtCwWcW6doO6KHCppwAYK40qNVyriLXcGOg="; 59 + includes = [ 60 + "config/*" 61 + "libstdc++-v3/*" 62 + ]; 63 + }) 64 + (getVersionFile "libstdcxx/force-regular-dirs.patch") 28 65 ]; 29 66 30 67 postUnpack = '' ··· 37 74 cd $sourceRoot 38 75 ''; 39 76 40 - postPatch = '' 41 - sed -i \ 42 - -e 's/AM_ENABLE_MULTILIB(/AM_ENABLE_MULTILIB(NOPE/' \ 43 - -e 's#glibcxx_toolexeclibdir=no#glibcxx_toolexeclibdir=${builtins.placeholder "out"}/libexec#' \ 44 - configure.ac 45 - ''; 77 + enableParallelBuilding = true; 78 + 79 + nativeBuildInputs = [ 80 + autoreconfHook269 81 + gettext 82 + ]; 46 83 47 84 preConfigure = '' 48 85 cd "$buildRoot" ··· 50 87 chmod +x "$configureScript" 51 88 ''; 52 89 90 + configurePlatforms = [ 91 + "build" 92 + "host" 93 + ]; 94 + 53 95 configureFlags = [ 54 96 "--disable-dependency-tracking" 55 - "--with-toolexeclibdir=${builtins.placeholder "out"}/lib" 56 97 "gcc_cv_target_thread_file=posix" 57 98 "cross_compiling=true" 58 99 "--disable-multilib" ··· 64 105 "--with-default-libstdcxx-abi=new" 65 106 ]; 66 107 67 - outputs = [ 68 - "out" 69 - "dev" 70 - ]; 71 - 72 108 hardeningDisable = [ 73 109 # PATH_MAX 74 110 "fortify" 75 111 ]; 112 + 113 + postInstall = '' 114 + moveToOutput lib/libstdc++.modules.json "$dev" 115 + ''; 76 116 77 117 doCheck = true; 78 118
+23 -3
pkgs/development/compilers/gcc/ng/common/patches.nix
··· 32 32 } 33 33 ]; 34 34 35 - # Submitted: https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689429.html 36 - # In Git: https://github.com/Ericson2314/gcc/tree/libgcc-custom-threading-model-15 37 - "gcc/custom-threading-model.patch" = [ 35 + # In Git: https://github.com/Ericson2314/gcc/tree/regular-dirs-in-libgcc-15 36 + "libgcc/force-regular-dirs.patch" = [ 37 + { 38 + after = "15"; 39 + path = ../15; 40 + } 41 + ]; 42 + # In Git: https://github.com/Ericson2314/gcc/tree/regular-dirs-in-libssp-15 43 + "libssp/force-regular-dirs.patch" = [ 44 + { 45 + after = "15"; 46 + path = ../15; 47 + } 48 + ]; 49 + # In Git: https://github.com/Ericson2314/gcc/tree/libstdcxx-force-regular-dirs-15 50 + "libstdcxx/force-regular-dirs.patch" = [ 51 + { 52 + after = "15"; 53 + path = ../15; 54 + } 55 + ]; 56 + # In Git: https://github.com/Ericson2314/gcc/tree/libgfortran-force-regular-dirs-15 57 + "libgfortran/force-regular-dirs.patch" = [ 38 58 { 39 59 after = "15"; 40 60 path = ../15;