From c56c679c367753a67317b6c00647a66e7795994d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 2 Jan 2024 12:00:36 +0000 Subject: [PATCH] binaryen: fix the build Current `binaryen` fails to build against `gcc-12` as: https://hydra.nixos.org/build/245455591 [100%] Linking CXX executable ../../bin/binaryen-unittests ld: /nix/store/...-gtest-1.12.1/lib/libgtest.so: undefined reference to `std::ios_base_library_init()@GLIBCXX_3.4.32' collect2: error: ld returned 1 exit status It is a typical mix of libraries built with `gcc-12` and bianries linked with `gcc-12`'s `libstdc++`. The change switches back to a default compiler and backports an upstream `fmin` fix to amend the test. --- pkgs/development/compilers/binaryen/default.nix | 7 +++++++ pkgs/top-level/all-packages.nix | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/binaryen/default.nix b/pkgs/development/compilers/binaryen/default.nix index 7b616faf8d8d..bd59b66f51fa 100644 --- a/pkgs/development/compilers/binaryen/default.nix +++ b/pkgs/development/compilers/binaryen/default.nix @@ -20,6 +20,13 @@ stdenv.mkDerivation rec { url = "https://github.com/WebAssembly/binaryen/commit/889422e0c92552ff484659f9b41e777ba7ab35c1.patch"; hash = "sha256-acM8mytL9nhm4np9tpUbd1X0wJ7y308HV2fvgcAW1lY="; }) + + # Fix fmin tests on gcc-13: https://github.com/WebAssembly/binaryen/pull/5994 + (fetchpatch { + name = "gcc-13.patch"; + url = "https://github.com/WebAssembly/binaryen/commit/1e17dfb695a19d5d41f1f88411fbcbc5f2408c8f.patch"; + hash = "sha256-5JZh15CXkg5XdTG8eRJXPwO+zmymYeFjKbHutRPTmlU="; + }) ]; nativeBuildInputs = [ cmake python3 ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a288dd73a804..ad24a67dd9b2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15575,10 +15575,10 @@ with pkgs; bigloo = callPackage ../development/compilers/bigloo { }; - binaryen = pin-to-gcc12-if-gcc13 (callPackage ../development/compilers/binaryen { + binaryen = callPackage ../development/compilers/binaryen { nodejs = nodejs-slim; inherit (python3Packages) filecheck; - }); + }; blueprint-compiler = callPackage ../development/compilers/blueprint { };