File tree Expand file tree Collapse file tree 3 files changed +51
-15
lines changed Expand file tree Collapse file tree 3 files changed +51
-15
lines changed Original file line number Diff line number Diff line change 44 inputs = {
55 nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable" ;
66 flake-parts . url = "github:hercules-ci/flake-parts" ;
7+ nixpkgs-for-llvm . url = "github:NixOS/nixpkgs/nixos-unstable-small" ;
78 mill-ivy-fetcher . url = "github:Avimitin/mill-ivy-fetcher" ;
89 circt-follow . url = "github:sequencer/zaozi" ;
910 treefmt-nix . url = "github:numtide/treefmt-nix" ;
Original file line number Diff line number Diff line change 1+ { self } :
2+
13final : prev :
24
35let
4- llvmForRVV_attrName = "llvmPackages_19" ;
5- rv32_pkgs = final . pkgsCross . riscv32-embedded ;
6+ llvmForRVV_attrName = "llvmPackages_git" ;
7+ rv32_pkgs =
8+ self . inputs . nixpkgs-for-llvm . legacyPackages . "${ final . system } " . pkgsCross . riscv32-embedded ;
69 rv32_buildPkgs = rv32_pkgs . buildPackages ;
710in
811rec {
9295 newlib = rv32_pkgs . stdenv . cc . libc . overrideAttrs ( oldAttrs : {
9396 CFLAGS_FOR_TARGET = "-march=rv32imacf_zvl128b_zve32f -mabi=ilp32f" ;
9497 } ) ;
98+
99+ llvmPackages = rv32_buildPkgs . ${ llvmForRVV_attrName } ;
100+ patchedCC =
101+ let
102+ llvmSrc = prev . fetchFromGitHub {
103+ owner = "topperc" ;
104+ repo = "llvm-project" ;
105+ rev = "bb123ff9401b517d877de4ed6fd9ea61edf49dbb" ;
106+ hash = "sha256-6ca5FhSsG5Qik7wi6Vn3OmUmKR/hULSDniu4JLo+5jM=" ;
107+ } ;
108+ in
109+ llvmPackages . clang-unwrapped . override {
110+ monorepoSrc = llvmSrc ;
111+ libllvm = llvmPackages . libllvm . override { monorepoSrc = llvmSrc ; } ;
112+ } ;
95113 in
96114 rv32_buildPkgs . wrapCCWith rec {
97- cc = rv32_buildPkgs . ${ llvmForRVV_attrName } . clang-unwrapped ;
115+ cc = patchedCC ;
98116 libc = newlib ;
99117 bintools = rv32_pkgs . stdenv . cc . bintools . override {
100118 inherit libc ; # we must keep consistency of bintools libc and compiler libc
You can’t perform that action at this time.
0 commit comments