Skip to content

Commit 434c8a7

Browse files
committed
additional loongarch options
1 parent 2460d70 commit 434c8a7

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
hyperfsFromPkgs = pkgs:
1717
pkgs.callPackage ./src/pkgs/hyperfs { inherit libhc; };
1818

19+
overlays = [
20+
(import ./src/cross-overlays.nix)
21+
];
22+
1923
in rec {
2024
hyperfs = hyperfsFromPkgs pkgs;
2125

src/archs.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,7 @@
4343
};
4444
loongarch = {
4545
config = "loongarch64-linux-musl";
46+
gcc.arch = "loongarch64";
47+
gcc.abi = "lp64";
4648
};
4749
}

src/cross-overlays.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,16 @@
2323
p11-kit = super.p11-kit.overrideAttrs { doCheck = false; };
2424
})
2525

26+
# Add musl support for loongarch64
27+
(self: super: {
28+
musl = if super.stdenv.hostPlatform.config == "loongarch64-linux-musl"
29+
then super.musl.overrideAttrs (oldAttrs: {
30+
meta = oldAttrs.meta // {
31+
platforms = oldAttrs.meta.platforms ++ ["loongarch64-linux"];
32+
badPlatforms = [];
33+
};
34+
})
35+
else super.musl;
36+
})
37+
2638
]

0 commit comments

Comments
 (0)