Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
56378be
libphonenumber: don't depend on openjdk (not upstreamed)
wegank Apr 30, 2025
820aab0
[staging] gst_all_1.gst-devtools: disable rust components (not upstre…
wegank May 1, 2025
4d0490d
qt5.qtwebengine: add loongarch64-linux support (not upstreamed)
wegank May 2, 2025
5d89589
qt6.qtwebengine: add loongarch64-linux support (not upstreamed)
wegank May 3, 2025
884afc4
linux: use generic installation script on loongarch64 (upstreaming in…
wegank Jul 20, 2025
c24e523
[hack] iso_graphical: enable on loongarch64-linux (not upstreamable)
wegank May 2, 2025
2a25760
postgresql: skip check on loongarch64 (not upstreamed)
wegank May 6, 2025
ddb9b22
hydra: disable darcs support (not upstreamable)
wegank May 6, 2025
3548c16
[hack] make-disk-image: set touchEFIVars to true (not upstreamable)
wegank May 7, 2025
c90e877
rdma-core: disable man page on loongarch64 (not upstreamable)
qbisi Jul 23, 2025
0044b79
redis: disable more tests on loongarch64 (not upstreamed)
wegank Aug 1, 2025
376cdc8
android-tools: fix loongarch64-linux build (not upstreamed)
wegank Aug 17, 2025
c7502fc
gst_all_1.gst-plugins-rs: skip check on loongarch64 (not upstreamed)
wegank Aug 25, 2025
ae4d0bd
buildGo125Module: set mcmodel to normal on loongarch64 (not upstreamed)
wegank Sep 11, 2025
945d2a5
typescript: disable dprint (not upstreamable)
wegank Oct 2, 2025
0125f55
tpm2-tools: disable pandoc on loongarch64-linux (not upstreamed)
wegank Nov 11, 2025
665a521
fwupd: disable valgrind on loongarch64-linux (not upstreamed)
wegank Nov 11, 2025
9ddf2be
firefox: fix loongarch64-linux build (not upstreamed)
wegank Dec 9, 2025
05114f1
redis: disable integration/replication test on loongarch64 (not upstr…
darkyzhou Dec 9, 2025
9605383
brotli: fix loongarch64-linux build (not upstreamed)
wegank Dec 30, 2025
6f85650
docker: use runc v1.4.0 on loongarch64 for updated libseccomp-golang …
darkyzhou Jan 3, 2026
ca8399a
ghc: refactor 9.6.6-debian-binary for multi-arch support (not upstrea…
darkyzhou Jan 4, 2026
b786589
ghc: add GHCi enablement patches for loongarch64-linux (not upstreamed)
darkyzhou Jan 4, 2026
a1840ca
ghc: add LoongArch64 NCG support for 9.14+ (not upstreamed)
darkyzhou Jan 4, 2026
f89fd4a
ghc: add loongarch64-linux support (not upstreamed)
darkyzhou Jan 4, 2026
d296742
haskellPackages.attoparsec: disable tests on loongarch64-linux (not u…
darkyzhou Jan 4, 2026
bc67b77
haskellPackages.yaml: disable separate bin output (not upstreamable)
wegank Jan 5, 2026
a5e36ee
haskellPackages.{crypton,crypton-x509-validation,tls}: disable tests …
wegank Jan 5, 2026
a8e1b9c
vlc: libbluray-full -> libbluray (not upstreamable)
wegank Jan 6, 2026
e5703fe
latx: init at 1.6.4
darkyzhou Jan 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/systems/flake-systems.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# mandated by their platform tier.
"aarch64-darwin"
# "armv5tel-linux" is excluded because it is not bootstrapped
"loongarch64-linux"
"powerpc64le-linux"
"riscv64-linux"
"x86_64-freebsd"
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/make-disk-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
installBootLoader ? true,

# Whether to output have EFIVARS available in $out/efi-vars.fd and use it during disk creation
touchEFIVars ? false,
touchEFIVars ? true,

# OVMF firmware derivation
OVMF ? pkgs.OVMF.fd,
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/installer/cd-dvd/iso-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,10 @@ in

isoImage.volumeID = lib.mkOption {
# nixos-$EDITION-$RELEASE-$ARCH
# HACK (NOT UPSTREAMABLE!!!)
default = "nixos${
lib.optionalString (config.isoImage.edition != "") "-${config.isoImage.edition}"
}-${config.system.nixos.release}-${pkgs.stdenv.hostPlatform.uname.processor}";
}-${config.system.nixos.release}-loong64";
type = lib.types.str;
description = ''
Specifies the label or volume ID of the generated ISO image.
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,7 @@
./virtualisation/incus-agent.nix
./virtualisation/incus.nix
./virtualisation/kvmgt.nix
./virtualisation/latx.nix
./virtualisation/libvirtd.nix
./virtualisation/lxc.nix
./virtualisation/lxcfs.nix
Expand Down
80 changes: 80 additions & 0 deletions nixos/modules/virtualisation/latx.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
config,
lib,
pkgs,
utils,
...
}:
let
cfg = config.virtualisation.latx;
in
{
options = {
virtualisation.latx = {
enable = lib.mkEnableOption "Loongson Architecture Translator for x86 applications";

package = lib.mkOption {
type = lib.types.package;
default = pkgs.pkgsStatic.latx;
defaultText = lib.literalExpression "pkgs.pkgsStatic.latx";
description = ''
The LATX package to use. The binfmt interpreter requires a statically
linked binary, so the default uses pkgsStatic.
'';
};
};
};

config = lib.mkIf cfg.enable {
assertions = [
{
assertion = pkgs.stdenv.hostPlatform.isLoongArch64;
message = "LATX is only supported on LoongArch64 systems";
}
{
# https://github.com/lat-opensource/lat/blob/5f6d966ed4b123c815f9b249baec88f3ebe61a15/latxbuild/build-release.sh#L95
assertion = (config.boot.kernel.sysctl."vm.mmap_min_addr" or 65536) >= 65536;
message = "LATX requires vm.mmap_min_addr >= 65536 for compatibility";
}
{
assertion = !(builtins.elem "x86_64-linux" config.boot.binfmt.emulatedSystems);
message = "Cannot use both LATX and boot.binfmt.emulatedSystems for x86_64-linux. Choose one.";
}
{
assertion = !(builtins.elem "i686-linux" config.boot.binfmt.emulatedSystems);
message = "Cannot use both LATX and boot.binfmt.emulatedSystems for i686-linux. Choose one.";
}
];

environment.systemPackages = [ cfg.package ];

nix.settings = {
extra-platforms = [
"x86_64-linux"
"i686-linux"
];
extra-sandbox-paths = [
"/run/binfmt"
"${cfg.package}"
];
};

boot.binfmt.registrations.latx-x86_64 = {
inherit (utils.binfmtMagics.x86_64-linux) magicOrExtension mask;
interpreter = lib.getExe' cfg.package "latx-x86_64";
interpreterSandboxPath = cfg.package;
fixBinary = true;
preserveArgvZero = true;
wrapInterpreterInShell = false;
};

boot.binfmt.registrations.latx-i386 = {
inherit (utils.binfmtMagics.i386-linux) magicOrExtension mask;
interpreter = lib.getExe' cfg.package "latx-i386";
interpreterSandboxPath = cfg.package;
fixBinary = true;
preserveArgvZero = true;
wrapInterpreterInShell = false;
};
};
}
1 change: 1 addition & 0 deletions nixos/release-combined.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
supportedSystems ? [
"aarch64-linux"
"x86_64-linux"
"loongarch64-linux"
],
limitedSupportedSystems ? [ ],
}:
Expand Down
1 change: 1 addition & 0 deletions nixos/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ with import ../lib;
supportedSystems ? [
"x86_64-linux"
"aarch64-linux"
"loongarch64-linux"
],
configuration ? { },

Expand Down
15 changes: 12 additions & 3 deletions pkgs/applications/virtualization/docker/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{ lib, callPackage }:
{
lib,
stdenv,
callPackage,
}:

let
dockerGen =
Expand Down Expand Up @@ -443,8 +447,13 @@ in
cliHash = "sha256-8VpFDYn9mRFv7BnHek2+HvIu6jNPYNC1asozJvRX/A4=";
mobyRev = "docker-v${version}";
mobyHash = "sha256-yB6FF4tzi6R+wH6U0JS8PMZGVRl1gWCY2Cjb/JR+62w=";
runcRev = "v1.3.4";
runcHash = "sha256-1IfY08sBoDpbLrwz1AKBRSTuCZyOgQzYPHTDUI6fOZ8=";
# loongarch64 needs runc 1.4.0+ for libseccomp-golang to support loongarch64
runcRev = if stdenv.hostPlatform.isLoongArch64 then "v1.4.0" else "v1.3.4";
runcHash =
if stdenv.hostPlatform.isLoongArch64 then
"sha256-XPS9qWgDyKVLYs/QqWof6ydVK1T41QD8yDpvztc3NMc="
else
"sha256-1IfY08sBoDpbLrwz1AKBRSTuCZyOgQzYPHTDUI6fOZ8=";
containerdRev = "v2.2.0";
containerdHash = "sha256-LXBGA03FTrrbxlH+DxPBFtp3/AYQf096YE2rpe6A+WM=";
tiniRev = "369448a167e8b3da4ca5bca0b3307500c3371828";
Expand Down
142 changes: 142 additions & 0 deletions pkgs/applications/virtualization/latx/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
lib,
stdenv,
fetchgit,
pkg-config,
perl,
flex,
bison,
zlib,
glib,
git,
openssl,
libdrm,
pcre2,
python3,
ninja,
meson,
makeWrapper,
enableKzt ? !stdenv.hostPlatform.isStatic,
}:

assert lib.assertMsg (
enableKzt -> !stdenv.hostPlatform.isStatic
) "latx: enableKzt cannot be used with static, as it causes build failures";

stdenv.mkDerivation rec {
pname = "latx";
version = "1.6.4";

src = fetchgit {
url = "https://github.com/lat-opensource/lat.git";
rev = version;
sha256 = "sha256-kSAQbsDuj39lvhMDqraWI4BLPWhduBEU8GW7XRdNRkE=";
fetchSubmodules = false;
leaveDotGit = true;
};

patches = lib.optionals stdenv.hostPlatform.isStatic [
./support-static-musl.patch
];

postPatch = ''
# Support cross-compilation by using target readelf binary
substituteInPlace configure \
--replace-fail "readelf" "${stdenv.cc.targetPrefix}readelf"
'';

nativeBuildInputs = [
makeWrapper
pkg-config
git
flex
bison
ninja
perl
meson
python3
stdenv.cc.bintools
];

buildInputs = [
zlib
glib
openssl
libdrm
pcre2
]
++ lib.optionals stdenv.hostPlatform.isStatic [
zlib.static
];

configurePhase = ''
runHook preConfigure

mkdir -p build32
pushd build32
../configure \
--target-list=i386-linux-user \
--extra-ldflags=-ldl \
--optimize-O1 \
--disable-debug-info \
--disable-blobs \
--disable-docs \
--disable-werror \
--disable-pie \
--disable-gcrypt \
--disable-linux-io-uring \
--enable-latx \
--enable-guest-base-zero \
${lib.optionalString stdenv.hostPlatform.isStatic "--static"}
popd

mkdir -p build64
pushd build64
../configure \
--target-list=x86_64-linux-user \
--extra-ldflags=-ldl \
--optimize-O1 \
--disable-debug-info \
--disable-blobs \
--disable-docs \
--disable-werror \
--disable-linux-io-uring \
--enable-latx \
${lib.optionalString stdenv.hostPlatform.isStatic "--static"} \
${lib.optionalString enableKzt "--enable-kzt"}
popd

runHook postConfigure
'';

buildPhase = ''
runHook preBuild

echo "Building latx-i386..."
ninja -v -C build32 -j$NIX_BUILD_CORES

echo "Building latx-x86_64..."
ninja -v -C build64 -j$NIX_BUILD_CORES

runHook postBuild
'';

installPhase = ''
runHook preInstall

mkdir -p $out/bin
install -Dm755 build32/latx-i386 $out/bin/latx-i386
install -Dm755 build64/latx-x86_64 $out/bin/latx-x86_64

runHook postInstall
'';

meta = with lib; {
homepage = "https://github.com/lat-opensource/lat";
description = "Loongson Architecture Translator for x86 applications";
license = licenses.gpl2Plus;
platforms = platforms.loongarch64;
maintainers = with maintainers; [ darkyzhou ];
teams = with teams; [ loongarch64 ];
};
}
Loading
Loading