From 93d9c770e87af8dab1bc065ad1cdc2f6366dbbba Mon Sep 17 00:00:00 2001 From: Aleix Roca Nonell Date: Mon, 26 May 2025 10:29:16 +0200 Subject: [PATCH] Fix C runtime objects path Some gcc versions append an extension to the patch version number, but this exetension is not part of the installation path. This patch removes the extension to the patch version. --- pkgs/llvm-ompss2/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/llvm-ompss2/default.nix b/pkgs/llvm-ompss2/default.nix index 81b972a..8bf3c07 100644 --- a/pkgs/llvm-ompss2/default.nix +++ b/pkgs/llvm-ompss2/default.nix @@ -34,14 +34,15 @@ let targetConfig = stdenv.targetPlatform.config; inherit gcc; cc = clangOmpss2Unwrapped; + gccVersion = lib.strings.concatStringsSep "." [(lib.versions.major gcc.version) (lib.versions.minor gcc.version) (lib.versions.patch gcc.version)]; in wrapCCWith { inherit cc bintools; # extraPackages adds packages to depsTargetTargetPropagated extraPackages = lib.optional (openmp != null) openmp; extraBuildCommands = '' echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags - echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags - echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags + echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-cflags + echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-ldflags echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags for dir in ${gcc.cc}/include/c++/*; do