From 4c7774e43557bc5132e52b897c1609bff655ca21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Fri, 20 Jun 2025 09:46:13 +0200 Subject: [PATCH] fixup! aocc: init at 5.0.0 --- pkgs/aocc/default.nix | 25 ++++--------------------- pkgs/aocc/unwrapped.nix | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/pkgs/aocc/default.nix b/pkgs/aocc/default.nix index 563a3e3..ec9a521 100644 --- a/pkgs/aocc/default.nix +++ b/pkgs/aocc/default.nix @@ -1,29 +1,12 @@ -{ lib +{ wrapCCWith , aoccUnwrapped -, wrapCCWith }: -let +wrapCCWith { cc = aoccUnwrapped; - stdenv = aoccUnwrapped.stdenv; - targetConfig = stdenv.targetPlatform.config; - - gcc = stdenv.cc; - -in wrapCCWith { - inherit cc; extraBuildCommands = '' - echo "-isystem ${cc}/include" >> $out/nix-support/cc-cflags - - echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags - echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags - echo "-L${cc}/lib" >> $out/nix-support/cc-ldflags - - # Need the gcc in the path - echo 'export "PATH=${gcc}/bin:$PATH"' >> $out/nix-support/cc-wrapper-hook - - # Disable hardening by default - echo "" > $out/nix-support/add-hardening.sh + wrap aocc $wrapper $ccPath/clang + wrap aocc++ $wrapper $ccPath/clang++ ''; } diff --git a/pkgs/aocc/unwrapped.nix b/pkgs/aocc/unwrapped.nix index 70068fd..6ca462d 100644 --- a/pkgs/aocc/unwrapped.nix +++ b/pkgs/aocc/unwrapped.nix @@ -10,12 +10,13 @@ let # in newer nixpkgs the runtime is hsakmt - rocmRuntime = if rocmPackages ? hsakmt then - rocmPackages.hsakmt - else - rocmPackages.rocm-runtime; + rocmRuntime = + if rocmPackages ? hsakmt then + rocmPackages.hsakmt + else + rocmPackages.rocm-runtime; in -stdenv.mkDerivation (finalAttrs: { +stdenv.mkDerivation { pname = "aocc-compiler"; version = "5.0.0"; @@ -41,9 +42,10 @@ stdenv.mkDerivation (finalAttrs: { ln -s ${lib.getLib libffi}/lib/libffi.so $out/lib/libffi.so.6 ''; - passthru = { - isClang = true; - }; + passthru = { + inherit rocmRuntime; + isClang = true; # Needed for wrapCCWith + }; - meta.mainProgram = "clang"; -}) + meta.mainProgram = "clang"; +}