{gcc10,gfortran10}: drop

EOL since 2023; no longer used in the tree.
This commit is contained in:
Emily
2025-08-22 23:01:59 +01:00
parent 2a196a7278
commit 4e7ee62b94
11 changed files with 164 additions and 614 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
- The `offrss` package was removed due to lack of upstream maintenance since 2012. It's recommended for users to migrate to another RSS reader
- GCC 9 has been removed, as it has reached endoflife upstream and is no longer supported.
- GCC 9 and 10 have been removed, as they have reached endoflife upstream and are no longer supported.
- `base16-builder` node package has been removed due to lack of upstream maintenance.
- `gentium` package now provides `Gentium-*.ttf` files, and not `GentiumPlus-*.ttf` files like before. The font identifiers `Gentium Plus*` are available in the `gentium-plus` package, and if you want to use the more recently updated package `gentium` [by sil](https://software.sil.org/gentium/), you should update your configuration files to use the `Gentium` font identifier.
-10
View File
@@ -1,10 +0,0 @@
{ wrapCC, gcc10 }:
wrapCC (
gcc10.cc.override {
name = "gfortran";
langFortran = true;
langCC = false;
langC = false;
profiledCompiler = false;
}
)
+130 -137
View File
@@ -41,145 +41,138 @@ lib.pipe drv
)
]
++
++ (
let
targetPlatformSlash =
if lib.systems.equals hostPlatform targetPlatform then "" else "${targetPlatform.config}/";
# nixpkgs did not add the "libgcc" output until gcc11. In theory
# the following condition can be changed to `true`, but that has not
# been tested.
lib.optionals (lib.versionAtLeast version "11.0")
# If we are building a cross-compiler and the target libc provided
# to us at build time has a libgcc, use that instead of building a
# new one. This avoids having two separate (but identical) libgcc
# outpaths in the closure of most packages, which can be confusing.
useLibgccFromTargetLibc = libcCross != null && libcCross ? passthru.libgcc;
enableLibGccOutput =
(!stdenv.targetPlatform.isWindows || (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform))
&& !langJit
&& !stdenv.hostPlatform.isDarwin
&& enableShared
&& !useLibgccFromTargetLibc;
# For some reason libgcc_s.so has major-version "2" on m68k but
# "1" everywhere else. Might be worth changing this to "*".
libgcc_s-version-major = if targetPlatform.isM68k then "2" else "1";
in
[
(
let
targetPlatformSlash =
if lib.systems.equals hostPlatform targetPlatform then "" else "${targetPlatform.config}/";
# If we are building a cross-compiler and the target libc provided
# to us at build time has a libgcc, use that instead of building a
# new one. This avoids having two separate (but identical) libgcc
# outpaths in the closure of most packages, which can be confusing.
useLibgccFromTargetLibc = libcCross != null && libcCross ? passthru.libgcc;
enableLibGccOutput =
(!stdenv.targetPlatform.isWindows || (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform))
&& !langJit
&& !stdenv.hostPlatform.isDarwin
&& enableShared
&& !useLibgccFromTargetLibc;
# For some reason libgcc_s.so has major-version "2" on m68k but
# "1" everywhere else. Might be worth changing this to "*".
libgcc_s-version-major = if targetPlatform.isM68k then "2" else "1";
in
[
(
pkg:
pkg.overrideAttrs (
previousAttrs:
lib.optionalAttrs useLibgccFromTargetLibc {
passthru = (previousAttrs.passthru or { }) // {
inherit (libcCross) libgcc;
};
}
)
)
(
pkg:
pkg.overrideAttrs (
previousAttrs:
lib.optionalAttrs ((!langC) || langJit || enableLibGccOutput) {
outputs = previousAttrs.outputs ++ lib.optionals enableLibGccOutput [ "libgcc" ];
# This is a separate phase because gcc assembles its phase scripts
# in bash instead of nix (we should fix that).
preFixupPhases =
(previousAttrs.preFixupPhases or [ ])
++ lib.optionals ((!langC) || enableLibGccOutput) [ "preFixupLibGccPhase" ];
preFixupLibGccPhase =
# delete extra/unused builds of libgcc_s in non-langC builds
# (i.e. libgccjit, gnat, etc) to avoid potential confusion
lib.optionalString (!langC) ''
rm -f $out/lib/libgcc_s.so*
''
# move `libgcc_s.so` into its own output, `$libgcc`
# We maintain $libgcc/lib/$target/ structure to make sure target
# strip runs over libgcc_s.so and remove debug references to headers:
# https://github.com/NixOS/nixpkgs/issues/316114
+ lib.optionalString enableLibGccOutput (
''
# move libgcc from lib to its own output (libgcc)
mkdir -p $libgcc/${targetPlatformSlash}lib
mv $lib/${targetPlatformSlash}lib/libgcc_s.so $libgcc/${targetPlatformSlash}lib/
mv $lib/${targetPlatformSlash}lib/libgcc_s.so.${libgcc_s-version-major} $libgcc/${targetPlatformSlash}lib/
ln -s $libgcc/${targetPlatformSlash}lib/libgcc_s.so $lib/${targetPlatformSlash}lib/
ln -s $libgcc/${targetPlatformSlash}lib/libgcc_s.so.${libgcc_s-version-major} $lib/${targetPlatformSlash}lib/
''
+ lib.optionalString (targetPlatformSlash != "") ''
ln -s ${targetPlatformSlash}lib $libgcc/lib
''
#
# Nixpkgs ordinarily turns dynamic linking into pseudo-static linking:
# libraries are still loaded dynamically, exactly which copy of each
# library is loaded is permanently fixed at compile time (via RUNPATH).
# For libgcc_s we must revert to the "impure dynamic linking" style found
# in imperative software distributions. We must do this because
# `libgcc_s` calls `malloc()` and therefore has a `DT_NEEDED` for `libc`,
# which creates two problems:
#
# 1. A circular package dependency `glibc`<-`libgcc`<-`glibc`
#
# 2. According to the `-Wl,-rpath` flags added by Nixpkgs' `ld-wrapper`,
# the two versions of `glibc` in the cycle above are actually
# different packages. The later one is compiled by this `gcc`, but
# the earlier one was compiled by the compiler *that compiled* this
# `gcc` (usually the bootstrapFiles). In any event, the `glibc`
# dynamic loader won't honor that specificity without namespaced
# manual loads (`dlmopen()`). Once a `libc` is present in the address
# space of a process, that `libc` will be used to satisfy all
# `DT_NEEDED`s for `libc`, regardless of `RUNPATH`s.
#
# So we wipe the RUNPATH using `patchelf --set-rpath ""`. We can't use
# `patchelf --remove-rpath`, because at least as of patchelf 0.15.0 it
# will leave the old RUNPATH string in the file where the reference
# scanner can still find it:
#
# https://github.com/NixOS/patchelf/issues/453
#
# Note: we might be using the bootstrapFiles' copy of patchelf, so we have
# to keep doing it this way until both the issue is fixed *and* all the
# bootstrapFiles are regenerated, on every platform.
#
# This patchelfing is *not* effectively equivalent to copying
# `libgcc_s` into `glibc`'s outpath. There is one minor and one
# major difference:
#
# 1. (Minor): multiple builds of `glibc` (say, with different
# overrides or parameters) will all reference a single store
# path:
#
# /nix/store/xxx...xxx-gcc-libgcc/lib/libgcc_s.so.1
#
# This many-to-one referrer relationship will be visible in the store's
# dependency graph, and will be available to `nix-store -q` queries.
# Copying `libgcc_s` into each of its referrers would lose that
# information.
#
# 2. (Major): by referencing `libgcc_s.so.1`, rather than copying it, we
# are still able to run `nix-store -qd` on it to find out how it got
# built! Most importantly, we can see from that deriver which compiler
# was used to build it (or if it is part of the unpacked
# bootstrap-files). Copying `libgcc_s.so.1` from one outpath to
# another eliminates the ability to make these queries.
#
+ ''
patchelf --set-rpath "" $libgcc/lib/libgcc_s.so.${libgcc_s-version-major}
''
);
}
)
)
]
pkg:
pkg.overrideAttrs (
previousAttrs:
lib.optionalAttrs useLibgccFromTargetLibc {
passthru = (previousAttrs.passthru or { }) // {
inherit (libcCross) libgcc;
};
}
)
)
(
pkg:
pkg.overrideAttrs (
previousAttrs:
lib.optionalAttrs ((!langC) || langJit || enableLibGccOutput) {
outputs = previousAttrs.outputs ++ lib.optionals enableLibGccOutput [ "libgcc" ];
# This is a separate phase because gcc assembles its phase scripts
# in bash instead of nix (we should fix that).
preFixupPhases =
(previousAttrs.preFixupPhases or [ ])
++ lib.optionals ((!langC) || enableLibGccOutput) [ "preFixupLibGccPhase" ];
preFixupLibGccPhase =
# delete extra/unused builds of libgcc_s in non-langC builds
# (i.e. libgccjit, gnat, etc) to avoid potential confusion
lib.optionalString (!langC) ''
rm -f $out/lib/libgcc_s.so*
''
# move `libgcc_s.so` into its own output, `$libgcc`
# We maintain $libgcc/lib/$target/ structure to make sure target
# strip runs over libgcc_s.so and remove debug references to headers:
# https://github.com/NixOS/nixpkgs/issues/316114
+ lib.optionalString enableLibGccOutput (
''
# move libgcc from lib to its own output (libgcc)
mkdir -p $libgcc/${targetPlatformSlash}lib
mv $lib/${targetPlatformSlash}lib/libgcc_s.so $libgcc/${targetPlatformSlash}lib/
mv $lib/${targetPlatformSlash}lib/libgcc_s.so.${libgcc_s-version-major} $libgcc/${targetPlatformSlash}lib/
ln -s $libgcc/${targetPlatformSlash}lib/libgcc_s.so $lib/${targetPlatformSlash}lib/
ln -s $libgcc/${targetPlatformSlash}lib/libgcc_s.so.${libgcc_s-version-major} $lib/${targetPlatformSlash}lib/
''
+ lib.optionalString (targetPlatformSlash != "") ''
ln -s ${targetPlatformSlash}lib $libgcc/lib
''
#
# Nixpkgs ordinarily turns dynamic linking into pseudo-static linking:
# libraries are still loaded dynamically, exactly which copy of each
# library is loaded is permanently fixed at compile time (via RUNPATH).
# For libgcc_s we must revert to the "impure dynamic linking" style found
# in imperative software distributions. We must do this because
# `libgcc_s` calls `malloc()` and therefore has a `DT_NEEDED` for `libc`,
# which creates two problems:
#
# 1. A circular package dependency `glibc`<-`libgcc`<-`glibc`
#
# 2. According to the `-Wl,-rpath` flags added by Nixpkgs' `ld-wrapper`,
# the two versions of `glibc` in the cycle above are actually
# different packages. The later one is compiled by this `gcc`, but
# the earlier one was compiled by the compiler *that compiled* this
# `gcc` (usually the bootstrapFiles). In any event, the `glibc`
# dynamic loader won't honor that specificity without namespaced
# manual loads (`dlmopen()`). Once a `libc` is present in the address
# space of a process, that `libc` will be used to satisfy all
# `DT_NEEDED`s for `libc`, regardless of `RUNPATH`s.
#
# So we wipe the RUNPATH using `patchelf --set-rpath ""`. We can't use
# `patchelf --remove-rpath`, because at least as of patchelf 0.15.0 it
# will leave the old RUNPATH string in the file where the reference
# scanner can still find it:
#
# https://github.com/NixOS/patchelf/issues/453
#
# Note: we might be using the bootstrapFiles' copy of patchelf, so we have
# to keep doing it this way until both the issue is fixed *and* all the
# bootstrapFiles are regenerated, on every platform.
#
# This patchelfing is *not* effectively equivalent to copying
# `libgcc_s` into `glibc`'s outpath. There is one minor and one
# major difference:
#
# 1. (Minor): multiple builds of `glibc` (say, with different
# overrides or parameters) will all reference a single store
# path:
#
# /nix/store/xxx...xxx-gcc-libgcc/lib/libgcc_s.so.1
#
# This many-to-one referrer relationship will be visible in the store's
# dependency graph, and will be available to `nix-store -q` queries.
# Copying `libgcc_s` into each of its referrers would lose that
# information.
#
# 2. (Major): by referencing `libgcc_s.so.1`, rather than copying it, we
# are still able to run `nix-store -qd` on it to find out how it got
# built! Most importantly, we can see from that deriver which compiler
# was used to build it (or if it is part of the unpacked
# bootstrap-files). Copying `libgcc_s.so.1` from one outpath to
# another eliminates the ability to make these queries.
#
+ ''
patchelf --set-rpath "" $libgcc/lib/libgcc_s.so.${libgcc_s-version-major}
''
);
}
)
)
]
)
)
+29 -48
View File
@@ -82,12 +82,10 @@ let
atLeast14 = versionAtLeast version "14";
atLeast13 = versionAtLeast version "13";
atLeast12 = versionAtLeast version "12";
atLeast11 = versionAtLeast version "11";
is14 = majorVersion == "14";
is13 = majorVersion == "13";
is12 = majorVersion == "12";
is11 = majorVersion == "11";
is10 = majorVersion == "10";
# releases have a form: MAJOR.MINOR.MICRO, like 14.2.1
# snapshots have a form like MAJOR.MINOR.MICRO.DATE, like 14.2.1.20250322
@@ -101,7 +99,7 @@ let
# "14.2.0" -> "14.2.0"
baseVersion = lib.concatStringsSep "." (lib.take 3 (lib.splitVersion version));
disableBootstrap = atLeast11 && !stdenv.hostPlatform.isDarwin && (atLeast12 -> !profiledCompiler);
disableBootstrap = !stdenv.hostPlatform.isDarwin && (atLeast12 -> !profiledCompiler);
inherit (stdenv) buildPlatform hostPlatform targetPlatform;
targetConfig =
@@ -224,7 +222,7 @@ pipe
"mirror://gcc/snapshots/${majorVersion}-${snapDate}/gcc-${majorVersion}-${snapDate}.tar.xz"
else
"mirror://gcc/releases/gcc-${version}/gcc-${version}.tar.xz";
${if is10 || is11 || is13 then "hash" else "sha256"} = gccVersions.srcHashForVersion version;
${if is11 || is13 then "hash" else "sha256"} = gccVersions.srcHashForVersion version;
};
inherit patches;
@@ -342,21 +340,16 @@ pipe
buildFlags =
# we do not yet have Nix-driven profiling
assert atLeast12 -> (profiledCompiler -> !disableBootstrap);
if atLeast11 then
let
target =
optionalString (profiledCompiler) "profiled"
+ optionalString (
(lib.systems.equals targetPlatform hostPlatform)
&& (lib.systems.equals hostPlatform buildPlatform)
&& !disableBootstrap
) "bootstrap";
in
optional (target != "") target
else
optional (
(lib.systems.equals targetPlatform hostPlatform) && (lib.systems.equals hostPlatform buildPlatform)
) (if profiledCompiler then "profiledbootstrap" else "bootstrap");
let
target =
optionalString (profiledCompiler) "profiled"
+ optionalString (
(lib.systems.equals targetPlatform hostPlatform)
&& (lib.systems.equals hostPlatform buildPlatform)
&& !disableBootstrap
) "bootstrap";
in
optional (target != "") target;
inherit (callFile ./common/strip-attributes.nix { })
stripDebugList
@@ -421,8 +414,7 @@ pipe
;
isGNU = true;
hardeningUnsupportedFlags =
optional (!atLeast11) "zerocallusedregs"
++ optionals (!atLeast12) [
optionals (!atLeast12) [
"fortify3"
"trivialautovarinit"
]
@@ -452,36 +444,25 @@ pipe
platforms
teams
;
}
// optionalAttrs (!atLeast11) {
badPlatforms = [ "aarch64-darwin" ];
}
// optionalAttrs is10 {
badPlatforms =
if (!lib.systems.equals targetPlatform hostPlatform) then [ "aarch64-darwin" ] else [ ];
};
}
// optionalAttrs enableMultilib {
dontMoveLib64 = true;
}
))
(
[
(callPackage ./common/libgcc.nix {
inherit
version
langC
langCC
langJit
targetPlatform
hostPlatform
withoutTargetLibc
enableShared
libcCross
;
})
]
++ optionals atLeast11 [
(callPackage ./common/checksum.nix { inherit langC langCC; })
]
)
([
(callPackage ./common/libgcc.nix {
inherit
version
langC
langCC
langJit
targetPlatform
hostPlatform
withoutTargetLibc
enableShared
libcCross
;
})
(callPackage ./common/checksum.nix { inherit langC langCC; })
])
@@ -1,306 +0,0 @@
From 86f2f767ddffd9f7c6f1470b987ae7b0d251b988 Mon Sep 17 00:00:00 2001
From: Liu Hao <lh_mouse@126.com>
Date: Wed, 25 Apr 2018 21:54:19 +0800
Subject: [PATCH] Added 'mcf' thread model support from mcfgthread.
Signed-off-by: Liu Hao <lh_mouse@126.com>
---
config/gthr.m4 | 1 +
gcc/config.gcc | 3 +++
gcc/config/i386/mingw-mcfgthread.h | 1 +
gcc/config/i386/mingw-w64.h | 2 +-
gcc/config/i386/mingw32.h | 11 ++++++++++-
gcc/configure | 2 +-
gcc/configure.ac | 2 +-
libatomic/configure.tgt | 2 +-
libgcc/config.host | 6 ++++++
libgcc/config/i386/gthr-mcf.h | 1 +
libgcc/config/i386/t-mingw-mcfgthread | 2 ++
libgcc/configure | 1 +
libstdc++-v3/configure | 1 +
libstdc++-v3/libsupc++/atexit_thread.cc | 18 ++++++++++++++++++
libstdc++-v3/libsupc++/guard.cc | 23 +++++++++++++++++++++++
libstdc++-v3/src/c++11/thread.cc | 9 +++++++++
16 files changed, 80 insertions(+), 5 deletions(-)
create mode 100644 gcc/config/i386/mingw-mcfgthread.h
create mode 100644 libgcc/config/i386/gthr-mcf.h
create mode 100644 libgcc/config/i386/t-mingw-mcfgthread
diff --git a/config/gthr.m4 b/config/gthr.m4
index 7b29f1f3327..82e21fe1709 100644
--- a/config/gthr.m4
+++ b/config/gthr.m4
@@ -21,6 +21,7 @@ case $1 in
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
win32) thread_header=config/i386/gthr-win32.h ;;
+ mcf) thread_header=config/i386/gthr-mcf.h ;;
esac
AC_SUBST(thread_header)
])
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 46a9029acec..112c24e95a3 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1758,6 +1758,9 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
if test x$enable_threads = xposix ; then
tm_file="${tm_file} i386/mingw-pthread.h"
fi
+ if test x$enable_threads = xmcf ; then
+ tm_file="${tm_file} i386/mingw-mcfgthread.h"
+ fi
tm_file="${tm_file} i386/mingw32.h"
# This makes the logic if mingw's or the w64 feature set has to be used
case ${target} in
diff --git a/gcc/config/i386/mingw-mcfgthread.h b/gcc/config/i386/mingw-mcfgthread.h
new file mode 100644
index 00000000000..ec381a7798f
--- /dev/null
+++ b/gcc/config/i386/mingw-mcfgthread.h
@@ -0,0 +1 @@
+#define TARGET_USE_MCFGTHREAD 1
diff --git a/gcc/config/i386/mingw-w64.h b/gcc/config/i386/mingw-w64.h
index 484dc7a9e9f..a15bbeea500 100644
--- a/gcc/config/i386/mingw-w64.h
+++ b/gcc/config/i386/mingw-w64.h
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
"%{mwindows:-lgdi32 -lcomdlg32} " \
"%{fvtable-verify=preinit:-lvtv -lpsapi; \
fvtable-verify=std:-lvtv -lpsapi} " \
- "-ladvapi32 -lshell32 -luser32 -lkernel32"
+ LIB_MCFGTHREAD "-ladvapi32 -lshell32 -luser32 -lkernel32"
#undef SPEC_32
#undef SPEC_64
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 0612b87199a..76cea94f3b7 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -32,6 +32,14 @@ along with GCC; see the file COPYING3. If not see
| MASK_STACK_PROBE | MASK_ALIGN_DOUBLE \
| MASK_MS_BITFIELD_LAYOUT)
+#ifndef TARGET_USE_MCFGTHREAD
+#define CPP_MCFGTHREAD() ((void)0)
+#define LIB_MCFGTHREAD ""
+#else
+#define CPP_MCFGTHREAD() (builtin_define("__USING_MCFGTHREAD__"))
+#define LIB_MCFGTHREAD " -lmcfgthread "
+#endif
+
/* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
is for compatibility with native compiler. */
#define EXTRA_OS_CPP_BUILTINS() \
@@ -50,6 +58,7 @@ along with GCC; see the file COPYING3. If not see
builtin_define_std ("WIN64"); \
builtin_define ("_WIN64"); \
} \
+ CPP_MCFGTHREAD(); \
} \
while (0)
@@ -93,7 +102,7 @@ along with GCC; see the file COPYING3. If not see
"%{mwindows:-lgdi32 -lcomdlg32} " \
"%{fvtable-verify=preinit:-lvtv -lpsapi; \
fvtable-verify=std:-lvtv -lpsapi} " \
- "-ladvapi32 -lshell32 -luser32 -lkernel32"
+ LIB_MCFGTHREAD "-ladvapi32 -lshell32 -luser32 -lkernel32"
/* Weak symbols do not get resolved if using a Windows dll import lib.
Make the unwind registration references strong undefs. */
diff --git a/gcc/configure b/gcc/configure
index 6121e163259..52f0e00efe6 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -11693,7 +11693,7 @@ case ${enable_threads} in
target_thread_file='single'
;;
aix | dce | lynx | mipssde | posix | rtems | \
- single | tpf | vxworks | win32)
+ single | tpf | vxworks | win32 | mcf)
target_thread_file=${enable_threads}
;;
*)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index b066cc609e1..4ecdba88de7 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -1612,7 +1612,7 @@ case ${enable_threads} in
target_thread_file='single'
;;
aix | dce | lynx | mipssde | posix | rtems | \
- single | tpf | vxworks | win32)
+ single | tpf | vxworks | win32 | mcf)
target_thread_file=${enable_threads}
;;
*)
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index ea8c34f8c71..23134ad7363 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -145,7 +145,7 @@ case "${target}" in
*-*-mingw*)
# OS support for atomic primitives.
case ${target_thread_file} in
- win32)
+ win32 | mcf)
config_path="${config_path} mingw"
;;
posix)
diff --git a/libgcc/config.host b/libgcc/config.host
index 11b4acaff55..9fbd38650bd 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -737,6 +737,9 @@ i[34567]86-*-mingw*)
posix)
tmake_file="i386/t-mingw-pthread $tmake_file"
;;
+ mcf)
+ tmake_file="i386/t-mingw-mcfgthread $tmake_file"
+ ;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
if test x$ac_cv_sjlj_exceptions = xyes; then
@@ -761,6 +764,9 @@ x86_64-*-mingw*)
posix)
tmake_file="i386/t-mingw-pthread $tmake_file"
;;
+ mcf)
+ tmake_file="i386/t-mingw-mcfgthread $tmake_file"
+ ;;
esac
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
if test x$ac_cv_sjlj_exceptions = xyes; then
diff --git a/libgcc/config/i386/gthr-mcf.h b/libgcc/config/i386/gthr-mcf.h
new file mode 100644
index 00000000000..5ea2908361f
--- /dev/null
+++ b/libgcc/config/i386/gthr-mcf.h
@@ -0,0 +1 @@
+#include <mcfgthread/gthread.h>
diff --git a/libgcc/config/i386/t-mingw-mcfgthread b/libgcc/config/i386/t-mingw-mcfgthread
new file mode 100644
index 00000000000..4b9b10e32d6
--- /dev/null
+++ b/libgcc/config/i386/t-mingw-mcfgthread
@@ -0,0 +1,2 @@
+SHLIB_PTHREAD_CFLAG =
+SHLIB_PTHREAD_LDFLAG = -lmcfgthread
diff --git a/libgcc/configure b/libgcc/configure
index b2f3f870844..eff889dc3b3 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -5451,6 +5451,7 @@ case $target_thread_file in
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
win32) thread_header=config/i386/gthr-win32.h ;;
+ mcf) thread_header=config/i386/gthr-mcf.h ;;
esac
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index ba094be6f15..979a5ab9ace 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -15187,6 +15187,7 @@ case $target_thread_file in
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
win32) thread_header=config/i386/gthr-win32.h ;;
+ mcf) thread_header=config/i386/gthr-mcf.h ;;
esac
diff --git a/libstdc++-v3/libsupc++/atexit_thread.cc b/libstdc++-v3/libsupc++/atexit_thread.cc
index de920d714c6..665fb74bd6b 100644
--- a/libstdc++-v3/libsupc++/atexit_thread.cc
+++ b/libstdc++-v3/libsupc++/atexit_thread.cc
@@ -25,6 +25,22 @@
#include <cstdlib>
#include <new>
#include "bits/gthr.h"
+
+#ifdef __USING_MCFGTHREAD__
+
+#include <mcfgthread/gthread.h>
+
+extern "C" int
+__cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *),
+ void *obj, void *dso_handle)
+ _GLIBCXX_NOTHROW
+{
+ return ::_MCFCRT_AtThreadExit((void (*)(_MCFCRT_STD intptr_t))dtor, (_MCFCRT_STD intptr_t)obj) ? 0 : -1;
+ (void)dso_handle;
+}
+
+#else // __USING_MCFGTHREAD__
+
#ifdef _GLIBCXX_THREAD_ATEXIT_WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -167,3 +183,5 @@ __cxxabiv1::__cxa_thread_atexit (void (*dtor)(void *), void *obj, void */*dso_ha
}
#endif /* _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */
+
+#endif // __USING_MCFGTHREAD__
diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
index 3a2ec3ad0d6..8b4cc96199b 100644
--- a/libstdc++-v3/libsupc++/guard.cc
+++ b/libstdc++-v3/libsupc++/guard.cc
@@ -28,6 +28,27 @@
#include <cxxabi.h>
#include <exception>
#include <new>
+
+#ifdef __USING_MCFGTHREAD__
+
+#include <mcfgthread/gthread.h>
+
+namespace __cxxabiv1 {
+
+extern "C" int __cxa_guard_acquire(__guard *g){
+ return ::_MCFCRT_WaitForOnceFlagForever((::_MCFCRT_OnceFlag *)g) == ::_MCFCRT_kOnceResultInitial;
+}
+extern "C" void __cxa_guard_abort(__guard *g) throw() {
+ ::_MCFCRT_SignalOnceFlagAsAborted((::_MCFCRT_OnceFlag *)g);
+}
+extern "C" void __cxa_guard_release(__guard *g) throw() {
+ ::_MCFCRT_SignalOnceFlagAsFinished((::_MCFCRT_OnceFlag *)g);
+}
+
+}
+
+#else // __USING_MCFGTHREAD__
+
#include <ext/atomicity.h>
#include <ext/concurrence.h>
#include <bits/atomic_lockfree_defines.h>
@@ -425,3 +446,5 @@ namespace __cxxabiv1
#endif
}
}
+
+#endif
diff --git a/libstdc++-v3/src/c++11/thread.cc b/libstdc++-v3/src/c++11/thread.cc
index 8238817c2e9..0c6a1f85f6f 100644
--- a/libstdc++-v3/src/c++11/thread.cc
+++ b/libstdc++-v3/src/c++11/thread.cc
@@ -55,6 +55,15 @@ static inline int get_nprocs()
#elif defined(_GLIBCXX_USE_SC_NPROC_ONLN)
# include <unistd.h>
# define _GLIBCXX_NPROCS sysconf(_SC_NPROC_ONLN)
+#elif defined(_WIN32)
+# include <windows.h>
+static inline int get_nprocs()
+{
+ SYSTEM_INFO sysinfo;
+ GetSystemInfo(&sysinfo);
+ return (int)sysinfo.dwNumberOfProcessors;
+}
+# define _GLIBCXX_NPROCS get_nprocs()
#else
# define _GLIBCXX_NPROCS 0
#endif
--
2.17.0
@@ -1,34 +0,0 @@
From https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061#c5
--- a/gcc/genconditions.c 2019-01-01 12:37:19.064943662 +0100
+++ b/gcc/genconditions.c 2019-10-11 10:57:11.464595789 +0200
@@ -57,8 +57,9 @@ write_header (void)
\n\
/* It is necessary, but not entirely safe, to include the headers below\n\
in a generator program. As a defensive measure, don't do so when the\n\
- table isn't going to have anything in it. */\n\
-#if GCC_VERSION >= 3001\n\
+ table isn't going to have anything in it.\n\
+ Clang 9 is buggy and doesn't handle __builtin_constant_p correctly. */\n\
+#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
\n\
/* Do not allow checking to confuse the issue. */\n\
#undef CHECKING_P\n\
@@ -170,7 +171,7 @@ struct c_test\n\
vary at run time. It works in 3.0.1 and later; 3.0 only when not\n\
optimizing. */\n\
\n\
-#if GCC_VERSION >= 3001\n\
+#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
static const struct c_test insn_conditions[] = {\n");
traverse_c_tests (write_one_condition, 0);
@@ -191,7 +192,7 @@ write_writer (void)
" unsigned int i;\n"
" const char *p;\n"
" puts (\"(define_conditions [\");\n"
- "#if GCC_VERSION >= 3001\n"
+ "#if GCC_VERSION >= 3001 && __clang_major__ < 9\n"
" for (i = 0; i < ARRAY_SIZE (insn_conditions); i++)\n"
" {\n"
" printf (\" (%d \\\"\", insn_conditions[i].value);\n"
@@ -31,13 +31,11 @@ let
atLeast14 = lib.versionAtLeast version "14";
atLeast13 = lib.versionAtLeast version "13";
atLeast12 = lib.versionAtLeast version "12";
atLeast11 = lib.versionAtLeast version "11";
is15 = majorVersion == "15";
is14 = majorVersion == "14";
is13 = majorVersion == "13";
is12 = majorVersion == "12";
is11 = majorVersion == "11";
is10 = majorVersion == "10";
# We only apply these patches when building a native toolchain for
# aarch64-darwin, as it breaks building a foreign one:
@@ -96,7 +94,6 @@ in
./12/mangle-NIX_STORE-in-__FILE__.patch
];
"11" = [ ./no-sys-dirs-riscv.patch ];
"10" = [ ./no-sys-dirs-riscv.patch ];
}
."${majorVersion}" or [ ]
)
@@ -266,16 +263,6 @@ in
# Needed to build LLVM>18
./cfi_startproc-reorder-label-2.diff
];
"10" = [
(fetchpatch {
# There are no upstream release tags in https://github.com/iains/gcc-10-branch.
# d04fe55 is the commit from https://github.com/gcc-mirror/gcc/releases/tag/releases%2Fgcc-10.5.0
url = "https://github.com/iains/gcc-10-branch/compare/d04fe5541c53cb16d1ca5c80da044b4c7633dbc6...gcc-10-5Dr0-pre-0.diff";
hash = "sha256-kVUHZKtYqkWIcqxHG7yAOR2B60w4KWLoxzaiFD/FWYk=";
})
# Needed to build LLVM>18
./cfi_startproc-reorder-label-2.diff
];
}
.${majorVersion} or [ ]
)
@@ -306,27 +293,3 @@ in
url = "https://github.com/gcc-mirror/gcc/commit/d243f4009d8071b734df16cd70f4c5d09a373769.patch";
sha256 = "sha256-H97GZs2wwzfFGiFOgds/5KaweC+luCsWX3hRFf7+Sm4=";
})
## gcc 10.0 and older ##############################################################################
# Probably needed for gnat wrapper https://github.com/NixOS/nixpkgs/pull/62314
++ optional (langAda && is10) ./gnat-cflags.patch
++
# Backport native aarch64-darwin compilation fix from gcc12
# https://github.com/NixOS/nixpkgs/pull/167595
optional
(
is10
&& buildPlatform.system == "aarch64-darwin"
&& (!lib.systems.equals targetPlatform buildPlatform)
)
(fetchpatch {
name = "0008-darwin-aarch64-self-host-driver.patch";
url = "https://github.com/gcc-mirror/gcc/commit/834c8749ced550af3f17ebae4072fb7dfb90d271.diff";
sha256 = "sha256-XtykrPd5h/tsnjY1wGjzSOJ+AyyNLsfnjuOZ5Ryq9vA=";
})
# Fix undefined symbol errors when building older versions with clang
++ optional (
!atLeast11 && stdenv.cc.isClang && stdenv.hostPlatform.isDarwin
) ./clang-genconditions.patch
@@ -1,35 +0,0 @@
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 4e74252bd74..0d848b5b4e3 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -111,7 +111,7 @@ NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer
NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls
NO_REORDER_ADAFLAGS = -fno-toplevel-reorder
GNATLIBFLAGS = -W -Wall -gnatpg -nostdinc
-GNATLIBCFLAGS = -g -O2
+GNATLIBCFLAGS = -g -O2 $(CFLAGS_FOR_TARGET)
# Pretend that _Unwind_GetIPInfo is available for the target by default. This
# should be autodetected during the configuration of libada and passed down to
# here, but we need something for --disable-libada and hope for the best.
@@ -198,7 +198,7 @@ RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
# Link flags used to build gnat tools. By default we prefer to statically
# link with libgcc to avoid a dependency on shared libgcc (which is tricky
# to deal with as it may conflict with the libgcc provided by the system).
-GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc
+GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc $(CFLAGS_FOR_TARGET)
# End of variables for you to override.
diff --git a/libada/Makefile.in b/libada/Makefile.in
index 522b9207326..ca866c74471 100644
--- a/libada/Makefile.in
+++ b/libada/Makefile.in
@@ -59,7 +59,7 @@ LDFLAGS=
CFLAGS=-g
PICFLAG = @PICFLAG@
GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
-GNATLIBCFLAGS= -g -O2
+GNATLIBCFLAGS= -g -O2 $(CFLAGS)
GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
-fexceptions -DIN_RTS @have_getipinfo@ @have_capability@
@@ -5,7 +5,6 @@ let
"13" = "13.4.0";
"12" = "12.4.0";
"11" = "11.5.0";
"10" = "10.5.0";
};
fromMajorMinor = majorMinorVersion: majorMinorToVersionMap."${majorMinorVersion}";
@@ -21,7 +20,6 @@ let
"13.4.0" = "sha256-nEzm27BAVo/cVFWIrAPFy8lajb8MeqSQFwhDr7WcqPU=";
"12.4.0" = "sha256-cE9lJgTMvMsUvavzR4yVEciXiLEss7v/3tNzQZFqkXU=";
"11.5.0" = "sha256-puIYaOrVRc+H8MAfhCduS1KB1nIJhZHByJYkHwk2NHg=";
"10.5.0" = "sha256-JRCVQ/30bzl8NHtdi3osflaUpaUczkucbh6opxyjB8E=";
}
."${version}";
+4 -2
View File
@@ -950,8 +950,9 @@ mapAliases {
gcc8Stdenv = throw "gcc8Stdenv has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-11-20
gcc9 = throw "gcc9 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gcc9Stdenv = throw "gcc9Stdenv has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gcc10StdenvCompat =
if stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "11" then gcc10Stdenv else stdenv; # Added 2024-03-21
gcc10 = throw "gcc10 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gcc10Stdenv = throw "gcc10Stdenv has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gcc10StdenvCompat = throw "gcc10StdenvCompat has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gcc-arm-embedded-6 = throw "gcc-arm-embedded-6 has been removed from Nixpkgs as it is unmaintained and obsolete"; # Added 2025-04-12
gcc-arm-embedded-7 = throw "gcc-arm-embedded-7 has been removed from Nixpkgs as it is unmaintained and obsolete"; # Added 2025-04-12
gcc-arm-embedded-8 = throw "gcc-arm-embedded-8 has been removed from Nixpkgs as it is unmaintained and obsolete"; # Added 2025-04-12
@@ -971,6 +972,7 @@ mapAliases {
gfortran7 = throw "gfortran7 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-11-20
gfortran8 = throw "gfortran8 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2024-11-20
gfortran9 = throw "gfortran9 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gfortran10 = throw "gfortran10 has been removed from Nixpkgs, as it is unmaintained and obsolete"; # Added 2025-08-08
gg = go-graft; # Added 2025-03-07
ggobi = throw "'ggobi' has been removed from Nixpkgs, as it is unmaintained and broken"; # Added 2025-05-18
ghostwriter = makePlasma5Throw "ghostwriter"; # Added 2023-03-18
-2
View File
@@ -4861,7 +4861,6 @@ with pkgs;
extraBuildInputs = lib.optional stdenv.hostPlatform.isDarwin clang.cc;
};
gcc10Stdenv = overrideCC gccStdenv buildPackages.gcc10;
gcc11Stdenv = overrideCC gccStdenv buildPackages.gcc11;
gcc12Stdenv = overrideCC gccStdenv buildPackages.gcc12;
gcc13Stdenv = overrideCC gccStdenv buildPackages.gcc13;
@@ -4965,7 +4964,6 @@ with pkgs;
});
inherit (callPackage ../development/compilers/gcc/all.nix { inherit noSysDirs; })
gcc10
gcc11
gcc12
gcc13