fixup! aocc: init at 5.0.0

This commit is contained in:
2025-06-20 09:46:13 +02:00
parent d22a0b4daa
commit d47b9d48b5
2 changed files with 15 additions and 26 deletions

View File

@@ -1,29 +1,16 @@
{ lib
{ wrapCCWith
, aoccUnwrapped
, wrapCCWith
}:
let
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++
'';
}