File tree Expand file tree Collapse file tree 4 files changed +64
-27
lines changed Expand file tree Collapse file tree 4 files changed +64
-27
lines changed Original file line number Diff line number Diff line change 1- version = "3.9.2 "
1+ version = "3.9.4 "
22
33maxColumn = 120
44align.preset = most
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" ;
1314 inputs @{
1415 self ,
1516 nixpkgs ,
17+ nixpkgs-for-llvm ,
1618 mill-ivy-fetcher ,
1719 circt-follow ,
1820 ...
5153 mill-ivy-fetcher . overlays . default
5254 # Follow CIRCT from sequencer/zaozi overlay
5355 circt-follow . overlays . default
56+ # pin riscv32 packages to avoid consistent breakage
57+ ( final : prev : {
58+ rv32_nixpkgs = nixpkgs-for-llvm . legacyPackages . "${ system } " . pkgsCross . riscv32-embedded ;
59+ } )
5460 overlay
5561 ] ;
5662 } ;
Original file line number Diff line number Diff line change 11final : prev :
22
33let
4- llvmForRVV_attrName = "llvmPackages_19 " ;
5- rv32_pkgs = final . pkgsCross . riscv32-embedded ;
6- rv32_buildPkgs = rv32_pkgs . buildPackages ;
4+ llvmForRVV_attrName = "llvmPackages_git " ;
5+ rv32_pkgs = final . rv32_nixpkgs ;
6+ rv32_buildPkgs = final . rv32_nixpkgs . buildPackages ;
77in
88rec {
9- inherit rv32_pkgs rv32_buildPkgs ; # for easier inspection
10-
119 getEnv' =
1210 key :
1311 let
9290 newlib = rv32_pkgs . stdenv . cc . libc . overrideAttrs ( oldAttrs : {
9391 CFLAGS_FOR_TARGET = "-march=rv32imacf_zvl128b_zve32f -mabi=ilp32f" ;
9492 } ) ;
93+
94+ llvmPackages = rv32_buildPkgs . ${ llvmForRVV_attrName } ;
95+ patchedCC =
96+ let
97+ llvmSrc = prev . fetchFromGitHub {
98+ owner = "topperc" ;
99+ repo = "llvm-project" ;
100+ rev = "bb123ff9401b517d877de4ed6fd9ea61edf49dbb" ;
101+ hash = "sha256-6ca5FhSsG5Qik7wi6Vn3OmUmKR/hULSDniu4JLo+5jM=" ;
102+ } ;
103+ vscalePatch = prev . fetchpatch {
104+ url = "https://github.com/llvm/llvm-project/pull/140195.patch" ;
105+ hash = "sha256-fevg7xQ/9RuOvGnT9uBhBAoM0wq+hB0tvidsg2LkxG8=" ;
106+ stripLen = 1 ;
107+ } ;
108+ in
109+ llvmPackages . clang-unwrapped . override {
110+ monorepoSrc = llvmSrc ;
111+ libllvm = ( llvmPackages . libllvm . override { monorepoSrc = llvmSrc ; } ) . overrideAttrs ( old : {
112+ patches = old . patches ++ [ vscalePatch ] ;
113+ } ) ;
114+ } ;
95115 in
96116 rv32_buildPkgs . wrapCCWith rec {
97- cc = rv32_buildPkgs . ${ llvmForRVV_attrName } . clang-unwrapped ;
117+ cc = patchedCC ;
98118 libc = newlib ;
99119 bintools = rv32_pkgs . stdenv . cc . bintools . override {
100120 inherit libc ; # we must keep consistency of bintools libc and compiler libc
You can’t perform that action at this time.
0 commit comments