nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1# These can be passed to nixpkgs as either the `localSystem` or
2# `crossSystem`. They are put here for user convenience, but also used by cross
3# tests and linux cross stdenv building, so handle with care!
4{ lib }:
5let
6 platforms = import ./platforms.nix { inherit lib; };
7
8 riscv = bits: {
9 config = "riscv${bits}-unknown-linux-gnu";
10 };
11in
12
13rec {
14 #
15 # Linux
16 #
17 powernv = {
18 config = "powerpc64le-unknown-linux-gnu";
19 };
20 musl-power = {
21 config = "powerpc64le-unknown-linux-musl";
22 };
23
24 ppc64-elfv1 = {
25 config = "powerpc64-unknown-linux-gnuabielfv1";
26 };
27 ppc64-elfv2 = {
28 config = "powerpc64-unknown-linux-gnuabielfv2";
29 };
30 ppc64 = ppc64-elfv2;
31 ppc64-musl = {
32 config = "powerpc64-unknown-linux-musl";
33 gcc = {
34 abi = "elfv2";
35 };
36 };
37
38 ppc32 = {
39 config = "powerpc-unknown-linux-gnu";
40 rust.rustcTarget = "powerpc-unknown-linux-gnu";
41 };
42
43 sheevaplug = {
44 config = "armv5tel-unknown-linux-gnueabi";
45 }
46 // platforms.sheevaplug;
47
48 raspberryPi = {
49 config = "armv6l-unknown-linux-gnueabihf";
50 }
51 // platforms.raspberrypi;
52
53 bluefield2 = {
54 config = "aarch64-unknown-linux-gnu";
55 }
56 // platforms.bluefield2;
57
58 remarkable1 = {
59 config = "armv7l-unknown-linux-gnueabihf";
60 }
61 // platforms.zero-gravitas;
62
63 remarkable2 = {
64 config = "armv7l-unknown-linux-gnueabihf";
65 }
66 // platforms.zero-sugar;
67
68 armv7l-hf-multiplatform = {
69 config = "armv7l-unknown-linux-gnueabihf";
70 };
71
72 aarch64-multiplatform = {
73 config = "aarch64-unknown-linux-gnu";
74 };
75
76 armv7a-android-prebuilt = {
77 config = "armv7a-unknown-linux-androideabi";
78 rust.rustcTarget = "armv7-linux-androideabi";
79 androidSdkVersion = "35";
80 androidNdkVersion = "27";
81 useAndroidPrebuilt = true;
82 }
83 // platforms.armv7a-android;
84
85 aarch64-android-prebuilt = {
86 config = "aarch64-unknown-linux-android";
87 rust.rustcTarget = "aarch64-linux-android";
88 androidSdkVersion = "35";
89 androidNdkVersion = "27";
90 useAndroidPrebuilt = true;
91 };
92
93 aarch64-android = {
94 config = "aarch64-unknown-linux-android";
95 androidSdkVersion = "35";
96 androidNdkVersion = "27";
97 libc = "bionic";
98 useAndroidPrebuilt = false;
99 useLLVM = true;
100 };
101
102 pogoplug4 = {
103 config = "armv5tel-unknown-linux-gnueabi";
104 }
105 // platforms.pogoplug4;
106
107 ben-nanonote = {
108 config = "mipsel-unknown-linux-uclibc";
109 }
110 // platforms.ben_nanonote;
111
112 fuloongminipc = {
113 config = "mipsel-unknown-linux-gnu";
114 }
115 // platforms.fuloong2f_n32;
116
117 # can execute on 32bit chip
118 mips-linux-gnu = {
119 config = "mips-unknown-linux-gnu";
120 }
121 // platforms.gcc_mips32r2_o32;
122 mipsel-linux-gnu = {
123 config = "mipsel-unknown-linux-gnu";
124 }
125 // platforms.gcc_mips32r2_o32;
126
127 # require 64bit chip (for more registers, 64-bit floating point, 64-bit "long long") but use 32bit pointers
128 mips64-linux-gnuabin32 = {
129 config = "mips64-unknown-linux-gnuabin32";
130 }
131 // platforms.gcc_mips64r2_n32;
132 mips64el-linux-gnuabin32 = {
133 config = "mips64el-unknown-linux-gnuabin32";
134 }
135 // platforms.gcc_mips64r2_n32;
136
137 # 64bit pointers
138 mips64-linux-gnuabi64 = {
139 config = "mips64-unknown-linux-gnuabi64";
140 }
141 // platforms.gcc_mips64r2_64;
142 mips64el-linux-gnuabi64 = {
143 config = "mips64el-unknown-linux-gnuabi64";
144 }
145 // platforms.gcc_mips64r2_64;
146
147 muslpi = raspberryPi // {
148 config = "armv6l-unknown-linux-musleabihf";
149 };
150
151 aarch64-multiplatform-musl = {
152 config = "aarch64-unknown-linux-musl";
153 };
154
155 gnu64 = {
156 config = "x86_64-unknown-linux-gnu";
157 };
158 gnu64_simplekernel = gnu64 // platforms.pc_simplekernel; # see test/cross/default.nix
159 gnu32 = {
160 config = "i686-unknown-linux-gnu";
161 };
162
163 musl64 = {
164 config = "x86_64-unknown-linux-musl";
165 };
166 musl32 = {
167 config = "i686-unknown-linux-musl";
168 };
169
170 riscv64 = riscv "64";
171 riscv32 = riscv "32";
172
173 riscv64-musl = {
174 config = "riscv64-unknown-linux-musl";
175 };
176
177 riscv64-embedded = {
178 config = "riscv64-none-elf";
179 libc = "newlib";
180 };
181
182 riscv32-embedded = {
183 config = "riscv32-none-elf";
184 libc = "newlib";
185 };
186
187 mips64-embedded = {
188 config = "mips64-none-elf";
189 libc = "newlib";
190 };
191
192 mips-embedded = {
193 config = "mips-none-elf";
194 libc = "newlib";
195 };
196
197 # https://github.com/loongson/la-softdev-convention/blob/master/la-softdev-convention.adoc#10-operating-system-package-build-requirements
198 loongarch64-linux = lib.recursiveUpdate platforms.loongarch64-multiplatform {
199 config = "loongarch64-unknown-linux-gnu";
200 };
201 loongarch64-linux-embedded = lib.recursiveUpdate platforms.loongarch64-multiplatform {
202 config = "loongarch64-unknown-linux-gnu";
203 gcc = {
204 arch = "loongarch64";
205 strict-align = true;
206 };
207 };
208
209 mmix = {
210 config = "mmix-unknown-mmixware";
211 libc = "newlib";
212 };
213
214 rx-embedded = {
215 config = "rx-none-elf";
216 libc = "newlib";
217 };
218
219 msp430 = {
220 config = "msp430-elf";
221 libc = "newlib";
222 };
223
224 avr = {
225 config = "avr";
226 };
227
228 vc4 = {
229 config = "vc4-elf";
230 libc = "newlib";
231 };
232
233 or1k = {
234 config = "or1k-elf";
235 libc = "newlib";
236 };
237
238 m68k = {
239 config = "m68k-unknown-linux-gnu";
240 };
241
242 s390 = {
243 config = "s390-unknown-linux-gnu";
244 };
245
246 s390x = {
247 config = "s390x-unknown-linux-gnu";
248 };
249
250 arm-embedded = {
251 config = "arm-none-eabi";
252 libc = "newlib";
253 };
254 arm-embedded-nano = {
255 config = "arm-none-eabi";
256 libc = "newlib-nano";
257 };
258 armhf-embedded = {
259 config = "arm-none-eabihf";
260 libc = "newlib";
261 # GCC8+ does not build without this
262 # (https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg552339.html):
263 gcc = {
264 arch = "armv5t";
265 fpu = "vfp";
266 };
267 };
268
269 aarch64-embedded = {
270 config = "aarch64-none-elf";
271 libc = "newlib";
272 rust.rustcTarget = "aarch64-unknown-none";
273 };
274
275 aarch64be-embedded = {
276 config = "aarch64_be-none-elf";
277 libc = "newlib";
278 };
279
280 ppc-embedded = {
281 config = "powerpc-none-eabi";
282 libc = "newlib";
283 };
284
285 ppcle-embedded = {
286 config = "powerpcle-none-eabi";
287 libc = "newlib";
288 };
289
290 i686-embedded = {
291 config = "i686-elf";
292 libc = "newlib";
293 };
294
295 x86_64-embedded = {
296 config = "x86_64-elf";
297 libc = "newlib";
298 };
299
300 microblaze-embedded = {
301 config = "microblazeel-none-elf";
302 libc = "newlib";
303 };
304
305 #
306 # Darwin
307 #
308
309 iphone64 = {
310 config = "arm64-apple-ios";
311 # config = "aarch64-apple-darwin14";
312 darwinSdkVersion = "14.3";
313 xcodeVer = "12.3";
314 xcodePlatform = "iPhoneOS";
315 useiOSPrebuilt = true;
316 };
317
318 iphone64-simulator = {
319 config = "x86_64-apple-ios";
320 # config = "x86_64-apple-darwin14";
321 darwinSdkVersion = "14.3";
322 xcodeVer = "12.3";
323 xcodePlatform = "iPhoneSimulator";
324 darwinPlatform = "ios-simulator";
325 useiOSPrebuilt = true;
326 };
327
328 aarch64-darwin = {
329 config = "arm64-apple-darwin";
330 xcodePlatform = "MacOSX";
331 platform = { };
332 };
333
334 x86_64-darwin = {
335 config = "x86_64-apple-darwin";
336 xcodePlatform = "MacOSX";
337 platform = { };
338 };
339
340 #
341 # UEFI
342 #
343
344 x86_64-unknown-uefi = {
345 config = "x86_64-unknown-uefi";
346 libc = null;
347 useLLVM = true;
348 linker = "lld";
349 };
350
351 aarch64-unknown-uefi = {
352 config = "aarch64-unknown-uefi";
353 libc = null;
354 useLLVM = true;
355 linker = "lld";
356 };
357
358 #
359 # Windows
360 #
361
362 # mingw-w64 with MSVCRT for i686
363 mingw-msvcrt-i686 = {
364 config = "i686-w64-mingw32";
365 libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
366 };
367
368 # mingw-w64 with MSVCRT for x86_64
369 mingw-msvcrt-x86_64 = {
370 # That's the triplet they use in the mingw-w64 docs.
371 config = "x86_64-w64-mingw32";
372 libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
373 };
374
375 # mingw-w64 with UCRT for x86_64, default compiler
376 mingw-ucrt-x86_64 = {
377 config = "x86_64-w64-mingw32";
378 libc = "ucrt"; # This distinguishes the mingw (non posix) toolchain
379 };
380
381 # mingw-w64 with UCRT for x86_64, LLVM
382 mingw-ucrt-x86_64-llvm = {
383 config = "x86_64-w64-mingw32";
384 libc = "ucrt";
385 rust.rustcTarget = "x86_64-pc-windows-gnullvm";
386 useLLVM = true;
387 };
388
389 # mingw-w64 with ucrt for Aarch64, default compiler (which is LLVM
390 # because GCC does not support this platform yet).
391 mingw-ucrt-aarch64 = {
392 config = "aarch64-w64-mingw32";
393 libc = "ucrt";
394 rust.rustcTarget = "aarch64-pc-windows-gnullvm";
395 useLLVM = true;
396 };
397
398 # mingw-64 back compat
399 # TODO: Warn after 26.05, and remove after 26.11.
400 mingw32 = mingw-msvcrt-i686;
401 mingwW64 = mingw-msvcrt-x86_64;
402 ucrt64 = mingw-ucrt-x86_64;
403 ucrtAarch64 = mingw-ucrt-aarch64;
404
405 # Target the MSVC ABI
406 x86_64-windows = {
407 config = "x86_64-pc-windows-msvc";
408 useLLVM = true;
409 };
410
411 aarch64-windows = {
412 config = "aarch64-pc-windows-msvc";
413 useLLVM = true;
414 };
415
416 x86_64-cygwin = {
417 config = "x86_64-pc-cygwin";
418 };
419
420 # BSDs
421
422 aarch64-freebsd = {
423 config = "aarch64-unknown-freebsd";
424 useLLVM = true;
425 };
426
427 x86_64-freebsd = {
428 config = "x86_64-unknown-freebsd";
429 useLLVM = true;
430 };
431
432 x86_64-netbsd = {
433 config = "x86_64-unknown-netbsd";
434 };
435
436 # this is broken and never worked fully
437 x86_64-netbsd-llvm = {
438 config = "x86_64-unknown-netbsd";
439 useLLVM = true;
440 };
441
442 x86_64-openbsd = {
443 config = "x86_64-unknown-openbsd";
444 useLLVM = true;
445 };
446
447 #
448 # WASM
449 #
450
451 wasi32 = {
452 config = "wasm32-unknown-wasi";
453 useLLVM = true;
454 };
455
456 wasm32-unknown-none = {
457 config = "wasm32-unknown-none";
458 rust.rustcTarget = "wasm32-unknown-unknown";
459 useLLVM = true;
460 };
461
462 # Ghcjs
463 ghcjs = {
464 # This triple is special to GHC/Cabal/GHCJS and not recognized by autotools
465 # See: https://gitlab.haskell.org/ghc/ghc/-/commit/6636b670233522f01d002c9b97827d00289dbf5c
466 # https://github.com/ghcjs/ghcjs/issues/53
467 config = "javascript-unknown-ghcjs";
468 };
469}