lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #227560 from jackyliu16/loongnix-commit

lib.platforms.loongarch64: init

authored by

Weijia Wang and committed by
GitHub
b2ef7956 c0f57c1d

+56 -7
+1
lib/systems/default.nix
··· 136 136 else if final.isPower then "powerpc" 137 137 else if final.isRiscV then "riscv" 138 138 else if final.isS390 then "s390" 139 + else if final.isLoongArch64 then "loongarch" 139 140 else final.parsed.cpu.name; 140 141 141 142 qemuArch =
+2 -1
lib/systems/doubles.nix
··· 26 26 27 27 # Linux 28 28 "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" 29 - "armv7l-linux" "i686-linux" "m68k-linux" "microblaze-linux" 29 + "armv7l-linux" "i686-linux" "loongarch64-linux" "m68k-linux" "microblaze-linux" 30 30 "microblazeel-linux" "mipsel-linux" "mips64el-linux" "powerpc64-linux" 31 31 "powerpc64le-linux" "riscv32-linux" "riscv64-linux" "s390-linux" 32 32 "s390x-linux" "x86_64-linux" ··· 86 86 m68k = filterDoubles predicates.isM68k; 87 87 s390 = filterDoubles predicates.isS390; 88 88 s390x = filterDoubles predicates.isS390x; 89 + loongarch64 = filterDoubles predicates.isLoongArch64; 89 90 js = filterDoubles predicates.isJavaScript; 90 91 91 92 bigEndian = filterDoubles predicates.isBigEndian;
+4
lib/systems/examples.nix
··· 90 90 config = "mipsel-unknown-linux-gnu"; 91 91 } // platforms.fuloong2f_n32; 92 92 93 + loongarch64-linux = { 94 + config = "loongarch64-unknown-linux-gnu"; 95 + }; 96 + 93 97 # can execute on 32bit chip 94 98 mips-linux-gnu = { config = "mips-unknown-linux-gnu"; } // platforms.gcc_mips32r2_o32; 95 99 mipsel-linux-gnu = { config = "mipsel-unknown-linux-gnu"; } // platforms.gcc_mips32r2_o32;
+1
lib/systems/inspect.nix
··· 57 57 isM68k = { cpu = { family = "m68k"; }; }; 58 58 isS390 = { cpu = { family = "s390"; }; }; 59 59 isS390x = { cpu = { family = "s390"; bits = 64; }; }; 60 + isLoongArch64 = { cpu = { family = "loongarch"; bits = 64; }; }; 60 61 isJavaScript = { cpu = cpuTypes.javascript; }; 61 62 62 63 is32bit = { cpu = { bits = 32; }; };
+2
lib/systems/parse.nix
··· 131 131 132 132 or1k = { bits = 32; significantByte = bigEndian; family = "or1k"; }; 133 133 134 + loongarch64 = { bits = 64; significantByte = littleEndian; family = "loongarch"; }; 135 + 134 136 javascript = { bits = 32; significantByte = littleEndian; family = "javascript"; }; 135 137 }; 136 138
+1 -1
lib/tests/systems.nix
··· 34 34 testredox = mseteq redox [ "x86_64-redox" ]; 35 35 testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */); 36 36 testillumos = mseteq illumos [ "x86_64-solaris" ]; 37 - testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mips64el-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" "microblaze-linux" "microblazeel-linux" ]; 37 + testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mips64el-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" "microblaze-linux" "microblazeel-linux" "loongarch64-linux" ]; 38 38 testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" ]; 39 39 testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]; 40 40 testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ];
+4
nixos/modules/system/boot/binfmt.nix
··· 125 125 magicOrExtension = ''\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf3\x00''; 126 126 mask = ''\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff''; 127 127 }; 128 + loongarch64-linux = { 129 + magicOrExtension = ''\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01''; 130 + mask = ''\xff\xff\xff\xff\xff\xff\xff\xfc\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff''; 131 + }; 128 132 wasm32-wasi = { 129 133 magicOrExtension = ''\x00asm''; 130 134 mask = ''\xff\xff\xff\xff'';
+1
pkgs/build-support/bintools-wrapper/default.nix
··· 88 88 else if targetPlatform.isMips then "${sharedLibraryLoader}/lib/ld.so.1" 89 89 # `ld-linux-riscv{32,64}-<abi>.so.1` 90 90 else if targetPlatform.isRiscV then "${sharedLibraryLoader}/lib/ld-linux-riscv*.so.1" 91 + else if targetPlatform.isLoongArch64 then "${sharedLibraryLoader}/lib/ld-linux-loongarch*.so.1" 91 92 else if targetPlatform.isDarwin then "/usr/lib/dyld" 92 93 else if targetPlatform.isFreeBSD then "/libexec/ld-elf.so.1" 93 94 else if lib.hasSuffix "pc-gnu" targetPlatform.config then "ld.so.1"
+1
pkgs/development/libraries/libseccomp/default.nix
··· 42 42 platforms = platforms.linux; 43 43 badPlatforms = [ 44 44 "alpha-linux" 45 + "loongarch64-linux" 45 46 "riscv32-linux" 46 47 "sparc-linux" 47 48 "sparc64-linux"
+1 -1
pkgs/development/tools/misc/binutils/default.nix
··· 1 1 let 2 - withGold = platform: platform.parsed.kernel.execFormat.name == "elf" && !platform.isRiscV; 2 + withGold = platform: platform.parsed.kernel.execFormat.name == "elf" && !platform.isRiscV && !platform.isLoongArch64; 3 3 in 4 4 5 5 { stdenv
+1 -1
pkgs/os-specific/linux/fuse/common.nix
··· 24 24 25 25 patches = 26 26 lib.optional 27 - (!isFuse3 && stdenv.isAarch64) 27 + (!isFuse3 && (stdenv.isAarch64 || stdenv.hostPlatform.isLoongArch64)) 28 28 (fetchpatch { 29 29 url = "https://github.com/libfuse/libfuse/commit/914871b20a901e3e1e981c92bc42b1c93b7ab81b.patch"; 30 30 sha256 = "1w4j6f1awjrycycpvmlv0x5v9gprllh4dnbjxl4dyl2jgbkaw6pa";
+5 -2
pkgs/tools/text/gnugrep/default.nix
··· 1 - { lib, stdenv, fetchurl, pcre, libiconv, perl }: 1 + { lib, stdenv, fetchurl, pcre, libiconv, perl, autoreconfHook }: 2 2 3 3 # Note: this package is used for bootstrapping fetchurl, and thus 4 4 # cannot use fetchpatch! All mutable patches (generated by GitHub or ··· 16 16 sha256 = "0g42svbc1nq5bamxfj6x7320wli4dlj86padk0hwgbk04hqxl42w"; 17 17 }; 18 18 19 + # https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=b50c6442e43d79471a31a2a202d3e50c0557446f 20 + patches = lib.optional stdenv.hostPlatform.isLoongArch64 ./sigsegv-loongarch.patch; 21 + 19 22 # Perl is needed for testing 20 - nativeBuildInputs = [ perl ]; 23 + nativeBuildInputs = [ perl ] ++ lib.optional stdenv.hostPlatform.isLoongArch64 autoreconfHook; 21 24 outputs = [ "out" "info" ]; # the man pages are rather small 22 25 23 26 buildInputs = [ pcre libiconv ];
+31
pkgs/tools/text/gnugrep/sigsegv-loongarch.patch
··· 1 + From b50c6442e43d79471a31a2a202d3e50c0557446f Mon Sep 17 00:00:00 2001 2 + From: Sun Haiyong <youbest@sina.com> 3 + Date: Sat, 4 Sep 2021 15:06:43 +0200 4 + Subject: sigsegv: Improve cross-compilation support for LoongArch CPU. 5 + 6 + * m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack grows 7 + down on LoongArch. 8 + --- 9 + m4/stack-direction.m4 | 3 ++- 10 + 1 file changed, 2 insertions(+), 1 deletion(-) 11 + 12 + diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4 13 + index 9328725..e682be9 100644 14 + --- a/m4/stack-direction.m4 15 + +++ b/m4/stack-direction.m4 16 + @@ -1,4 +1,4 @@ 17 + -# stack-direction.m4 serial 7 18 + +# stack-direction.m4 serial 8 19 + dnl Copyright (C) 2002-2021 Free Software Foundation, Inc. 20 + dnl This file is free software, distributed under the terms of the GNU 21 + dnl General Public License. As a special exception to the GNU General 22 + @@ -32,6 +32,7 @@ AC_DEFUN([SV_STACK_DIRECTION], 23 + i?86 | x86_64 | \ 24 + i860 | \ 25 + ia64 | \ 26 + + loongarch* | \ 27 + m32r | \ 28 + m68* | \ 29 + m88k | \ 30 + -- 31 + cgit v1.1
+1 -1
pkgs/top-level/all-packages.nix
··· 26321 26321 busybox = callPackage ../os-specific/linux/busybox { }; 26322 26322 busybox-sandbox-shell = callPackage ../os-specific/linux/busybox/sandbox-shell.nix { 26323 26323 # musl roadmap has RISC-V support projected for 1.1.20 26324 - busybox = if !stdenv.hostPlatform.isRiscV && stdenv.hostPlatform.libc != "bionic" 26324 + busybox = if !stdenv.hostPlatform.isRiscV && !stdenv.hostPlatform.isLoongArch64 && stdenv.hostPlatform.libc != "bionic" 26325 26325 then pkgsStatic.busybox 26326 26326 else busybox; 26327 26327 };