Compare commits

...

6 Commits

Author SHA1 Message Date
whispers
f7b16131d9 usrsctp: make unused-but-set-variable non-fatal for gcc 16
since usrsctp builds with -Werror by default, and gcc 16's unused
variable analysis is better than previous versions, this causes a build
failure. a fix for this particular variable has been submitted upstream,
but this is sufficient in the interim.
2026-07-24 13:31:31 +02:00
whispers
6c37551652 jemalloc: add patch to fix build under gcc 16
jemalloc used the nonstandard `std::__throw_bad_alloc`, which is no
longer visible in GCC 16. this upstream patch makes it conditional on
exceptions and defers to either `throw std::bad_alloc()` or
`std::terminate` as appropriate, and fixes the build.
2026-07-24 13:31:18 +02:00
whispers
aab37bd258 sourceHighlight: patch to fix build with gcc 16
The `ranges` name in the test here conflicts with the
`namespace std::ranges { }` from GCC 16, causing this test to fail to
build with "error: reference to 'ranges' is ambiguous". To avoid this,
we simply rename the variable.
2026-07-24 13:31:06 +02:00
whispers
017fed1d63 gcc: 15 -> 16
changes: https://gcc.gnu.org/gcc-16/changes.html
porting guide: https://gcc.gnu.org/gcc-16/porting_to.html
2026-07-24 13:23:18 +02:00
whispers
f46e80f6c5 minimal-bootstrap.gcc-glibc: 15.3.0 -> 16.1.0
https://gcc.gnu.org/gcc-16/changes.html
2026-07-24 13:23:18 +02:00
whispers
8c8bcc8565 minimal-bootstrap.gcc-latest: 15.3.0 -> 16.1.0
https://gcc.gnu.org/gcc-16/changes.html
2026-07-24 13:23:14 +02:00
8 changed files with 85 additions and 5 deletions

View File

@@ -16,6 +16,8 @@
+nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.zst";
```
- GCC has been updated from GCC 15 to GCC 16. This introduces some backwards-incompatible changes. Refer to the [upstream porting guide](https://gcc.gnu.org/gcc-16/porting_to.html) for details.
## Backward Incompatibilities {#sec-nixpkgs-release-26.11-incompatibilities}
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

View File

@@ -2,6 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
autoreconfHook,
# By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
# then stops downstream builds (mariadb in particular) from detecting it. This
@@ -59,6 +60,16 @@ stdenv.mkDerivation (finalAttrs: {
# A (longer) patch addressing the failure posted upstream at:
# https://github.com/jemalloc/jemalloc/pull/2954
./skip-extent-test-with-prof-active.patch
# the nonstandard `std::__throw_bad_alloc` is no longer exposed in gcc 16.
# this makes it conditional on exceptions and defers to either
# `throw std::bad_alloc()` or `std::terminate` as appropriate.
# https://github.com/jemalloc/jemalloc/pull/2900
(fetchpatch {
name = "jemalloc-dont-use-nonstandard-throw-bad-alloc.patch";
url = "https://github.com/jemalloc/jemalloc/commit/1a15fe33a48c52bfe26ea83e49f0d317a47da3ea.patch";
hash = "sha256-pL9fo8UMSbFlHCo3LFFkw0qBsdrVHcEJIkLutZYa2Yg=";
})
];
nativeBuildInputs = [

View File

@@ -0,0 +1,57 @@
diff --git a/lib/tests/test_regexranges_main.cpp b/lib/tests/test_regexranges_main.cpp
index 567d79230c..e28bba47e5 100644
--- a/lib/tests/test_regexranges_main.cpp
+++ b/lib/tests/test_regexranges_main.cpp
@@ -12,26 +12,26 @@
using namespace std;
using namespace srchilite;
-RegexRanges ranges;
+RegexRanges regexRanges;
void check_range_regex(const string &s, bool expectedTrue = true) {
cout << "checking " << s << endl;
if (expectedTrue)
- assertTrue(ranges.addRegexRange(s));
+ assertTrue(regexRanges.addRegexRange(s));
else
- assertFalse(ranges.addRegexRange(s));
+ assertFalse(regexRanges.addRegexRange(s));
}
void check_match(const string &line, const string &expected = "") {
cout << "searching inside " << line;
const boost::regex *matched = 0;
if (expected != "") {
- matched = ranges.matches(line);
+ matched = regexRanges.matches(line);
assertTrue(matched != 0);
assertEquals(expected, matched->str());
cout << " found " << *matched << endl;
} else {
- assertTrue(ranges.matches(line) == 0);
+ assertTrue(regexRanges.matches(line) == 0);
cout << " not found" << endl;
}
}
@@ -39,9 +39,9 @@
void check_in_range(const string &s, bool expectedTrue = true) {
cout << "checking " << s << "... ";
if (expectedTrue) {
- assertTrue(ranges.isInRange(s));
+ assertTrue(regexRanges.isInRange(s));
} else {
- assertFalse(ranges.isInRange(s));
+ assertFalse(regexRanges.isInRange(s));
}
cout << expectedTrue << endl;
}
@@ -57,7 +57,7 @@
check_range_regex("{notclosed");
// reset regular expressions
- ranges.clear();
+ regexRanges.clear();
check_range_regex("/// foo");
check_range_regex("/// bar");

View File

@@ -37,6 +37,11 @@ stdenv.mkDerivation rec {
url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9";
hash = "sha256-wmSLgLnLuFE+IC6AjxzZp/HEnaOCS1VfY2cac0T7Y+w=";
})
# GCC 16 detects ambiguity in the `ranges` name in a test (conflicts with
# `namespace std::range { }` from GCC), so we rename the variable to
# disambiguate.
./gcc16-disambiguate-regex-ranges-test.patch
]
++ lib.optionals stdenv.cc.isClang [
# Adds compatibility with C++17 by removing the `register` storage class specifier.

View File

@@ -38,6 +38,11 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [ cmake ];
# GCC 16's unused variable analysis is more advanced, leading to a build
# failure since usrsctp builds with -Wno-error.
# https://github.com/sctplab/usrsctp/pull/744
cmakeFlags = [ (lib.cmakeFeature "CMAKE_C_FLAGS" "-Wno-error=unused-but-set-variable") ];
# https://github.com/sctplab/usrsctp/issues/662
postPatch = ''
substituteInPlace usrsctplib/CMakeLists.txt \

View File

@@ -22,7 +22,7 @@
}:
let
pname = "gcc";
version = "15.3.0";
version = "16.1.0";
linkerName =
{
i686-linux = "ld-linux.so.2";
@@ -32,7 +32,7 @@ let
src = fetchurl {
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
hash = "sha256-+lnBvu+JlfJ8TXHB3yJ1hxiTFdPm+v8btDBuYbDFMOs=";
hash = "sha256-UO+02Uwzl6/zsNYaWr10i03THZ0/Kre+BbFx02pRD3k=";
};
gmpVersion = "6.3.0";

View File

@@ -21,11 +21,11 @@
}:
let
pname = "gcc";
version = "15.3.0";
version = "16.1.0";
src = fetchurl {
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.xz";
hash = "sha256-+lnBvu+JlfJ8TXHB3yJ1hxiTFdPm+v8btDBuYbDFMOs=";
hash = "sha256-UO+02Uwzl6/zsNYaWr10i03THZ0/Kre+BbFx02pRD3k=";
};
gmpVersion = "6.3.0";

View File

@@ -3266,7 +3266,7 @@ with pkgs;
gerbilPackages-unstable = pkgs.gerbil-support.gerbilPackages-unstable; # NB: don't recurseIntoAttrs for (unstable!) libraries
glow-lang = pkgs.gerbilPackages-unstable.glow-lang;
default-gcc-version = 15;
default-gcc-version = 16;
gcc = pkgs.${"gcc${toString default-gcc-version}"};
gccFun = callPackage ../development/compilers/gcc;
gcc-unwrapped = gcc.cc;