opencomposite: add meta.platforms (#357198)
[NixPkgs.git] / lib / systems / examples.nix
blob8433042838dc6eace607ede35872850fdfbb5a3e
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 }:
5 let
6   platforms = import ./platforms.nix { inherit lib; };
8   riscv = bits: {
9     config = "riscv${bits}-unknown-linux-gnu";
10   };
13 rec {
14   #
15   # Linux
16   #
17   powernv = {
18     config = "powerpc64le-unknown-linux-gnu";
19   };
20   musl-power = {
21     config = "powerpc64le-unknown-linux-musl";
22   };
24   ppc64 = {
25     config = "powerpc64-unknown-linux-gnuabielfv2";
26   };
27   ppc64-musl = {
28     config = "powerpc64-unknown-linux-musl";
29     gcc = { abi = "elfv2"; };
30   };
32   sheevaplug = {
33     config = "armv5tel-unknown-linux-gnueabi";
34   } // platforms.sheevaplug;
36   raspberryPi = {
37     config = "armv6l-unknown-linux-gnueabihf";
38   } // platforms.raspberrypi;
40   bluefield2 = {
41     config = "aarch64-unknown-linux-gnu";
42   } // platforms.bluefield2;
44   remarkable1 = {
45     config = "armv7l-unknown-linux-gnueabihf";
46   } // platforms.zero-gravitas;
48   remarkable2 = {
49     config = "armv7l-unknown-linux-gnueabihf";
50   } // platforms.zero-sugar;
52   armv7l-hf-multiplatform = {
53     config = "armv7l-unknown-linux-gnueabihf";
54   };
56   aarch64-multiplatform = {
57     config = "aarch64-unknown-linux-gnu";
58   };
60   armv7a-android-prebuilt = {
61     config = "armv7a-unknown-linux-androideabi";
62     rust.rustcTarget = "armv7-linux-androideabi";
63     androidSdkVersion = "33";
64     androidNdkVersion = "26";
65     useAndroidPrebuilt = true;
66   } // platforms.armv7a-android;
68   aarch64-android-prebuilt = {
69     config = "aarch64-unknown-linux-android";
70     rust.rustcTarget = "aarch64-linux-android";
71     androidSdkVersion = "33";
72     androidNdkVersion = "26";
73     useAndroidPrebuilt = true;
74   };
76   aarch64-android = {
77     config = "aarch64-unknown-linux-android";
78     androidSdkVersion = "33";
79     androidNdkVersion = "26";
80     libc = "bionic";
81     useAndroidPrebuilt = false;
82     useLLVM = true;
83   };
85   pogoplug4 = {
86     config = "armv5tel-unknown-linux-gnueabi";
87   } // platforms.pogoplug4;
89   ben-nanonote = {
90     config = "mipsel-unknown-linux-uclibc";
91   } // platforms.ben_nanonote;
93   fuloongminipc = {
94     config = "mipsel-unknown-linux-gnu";
95   } // platforms.fuloong2f_n32;
97   # can execute on 32bit chip
98   mips-linux-gnu           = { config = "mips-unknown-linux-gnu";           } // platforms.gcc_mips32r2_o32;
99   mipsel-linux-gnu         = { config = "mipsel-unknown-linux-gnu";         } // platforms.gcc_mips32r2_o32;
101   # require 64bit chip (for more registers, 64-bit floating point, 64-bit "long long") but use 32bit pointers
102   mips64-linux-gnuabin32   = { config = "mips64-unknown-linux-gnuabin32";   } // platforms.gcc_mips64r2_n32;
103   mips64el-linux-gnuabin32 = { config = "mips64el-unknown-linux-gnuabin32"; } // platforms.gcc_mips64r2_n32;
105   # 64bit pointers
106   mips64-linux-gnuabi64    = { config = "mips64-unknown-linux-gnuabi64";    } // platforms.gcc_mips64r2_64;
107   mips64el-linux-gnuabi64  = { config = "mips64el-unknown-linux-gnuabi64";  } // platforms.gcc_mips64r2_64;
109   muslpi = raspberryPi // {
110     config = "armv6l-unknown-linux-musleabihf";
111   };
113   aarch64-multiplatform-musl = {
114     config = "aarch64-unknown-linux-musl";
115   };
117   gnu64 = { config = "x86_64-unknown-linux-gnu"; };
118   gnu64_simplekernel = gnu64 // platforms.pc_simplekernel; # see test/cross/default.nix
119   gnu32  = { config = "i686-unknown-linux-gnu"; };
121   musl64 = { config = "x86_64-unknown-linux-musl"; };
122   musl32  = { config = "i686-unknown-linux-musl"; };
124   riscv64 = riscv "64";
125   riscv32 = riscv "32";
127   riscv64-embedded = {
128     config = "riscv64-none-elf";
129     libc = "newlib";
130   };
132   riscv32-embedded = {
133     config = "riscv32-none-elf";
134     libc = "newlib";
135   };
137   mips64-embedded = {
138     config = "mips64-none-elf";
139     libc = "newlib";
140   };
142   mips-embedded = {
143     config = "mips-none-elf";
144     libc = "newlib";
145   };
147   loongarch64-linux = {
148     config = "loongarch64-unknown-linux-gnu";
149   };
151   mmix = {
152     config = "mmix-unknown-mmixware";
153     libc = "newlib";
154   };
156   rx-embedded = {
157     config = "rx-none-elf";
158     libc = "newlib";
159   };
161   msp430 = {
162     config = "msp430-elf";
163     libc = "newlib";
164   };
166   avr = {
167     config = "avr";
168   };
170   vc4 = {
171     config = "vc4-elf";
172     libc = "newlib";
173   };
175   or1k = {
176     config = "or1k-elf";
177     libc = "newlib";
178   };
180   m68k = {
181     config = "m68k-unknown-linux-gnu";
182   };
184   s390 = {
185     config = "s390-unknown-linux-gnu";
186   };
188   s390x = {
189     config = "s390x-unknown-linux-gnu";
190   };
192   arm-embedded = {
193     config = "arm-none-eabi";
194     libc = "newlib";
195   };
196   armhf-embedded = {
197     config = "arm-none-eabihf";
198     libc = "newlib";
199     # GCC8+ does not build without this
200     # (https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg552339.html):
201     gcc = {
202       arch = "armv5t";
203       fpu = "vfp";
204     };
205   };
207   aarch64-embedded = {
208     config = "aarch64-none-elf";
209     libc = "newlib";
210     rust.rustcTarget = "aarch64-unknown-none";
211   };
213   aarch64be-embedded = {
214     config = "aarch64_be-none-elf";
215     libc = "newlib";
216   };
218   ppc-embedded = {
219     config = "powerpc-none-eabi";
220     libc = "newlib";
221   };
223   ppcle-embedded = {
224     config = "powerpcle-none-eabi";
225     libc = "newlib";
226   };
228   i686-embedded = {
229     config = "i686-elf";
230     libc = "newlib";
231   };
233   x86_64-embedded = {
234     config = "x86_64-elf";
235     libc = "newlib";
236   };
238   microblaze-embedded = {
239     config = "microblazeel-none-elf";
240     libc = "newlib";
241   };
243   #
244   # Redox
245   #
247   x86_64-unknown-redox = {
248     config = "x86_64-unknown-redox";
249     libc = "relibc";
250   };
252   #
253   # Darwin
254   #
256   iphone64 = {
257     config = "aarch64-apple-ios";
258     # config = "aarch64-apple-darwin14";
259     darwinSdkVersion = "14.3";
260     xcodeVer = "12.3";
261     xcodePlatform = "iPhoneOS";
262     useiOSPrebuilt = true;
263   };
265   iphone32 = {
266     config = "armv7a-apple-ios";
267     # config = "arm-apple-darwin10";
268     darwinSdkVersion = "14.3";
269     xcodeVer = "12.3";
270     xcodePlatform = "iPhoneOS";
271     useiOSPrebuilt = true;
272   };
274   iphone64-simulator = {
275     config = "x86_64-apple-ios";
276     # config = "x86_64-apple-darwin14";
277     darwinSdkVersion = "14.3";
278     xcodeVer = "12.3";
279     xcodePlatform = "iPhoneSimulator";
280     darwinPlatform = "ios-simulator";
281     useiOSPrebuilt = true;
282   };
284   iphone32-simulator = {
285     config = "i686-apple-ios";
286     # config = "i386-apple-darwin11";
287     darwinSdkVersion = "14.3";
288     xcodeVer = "12.3";
289     xcodePlatform = "iPhoneSimulator";
290     darwinPlatform = "ios-simulator";
291     useiOSPrebuilt = true;
292   };
294   aarch64-darwin = {
295     config = "aarch64-apple-darwin";
296     xcodePlatform = "MacOSX";
297     platform = {};
298   };
300   x86_64-darwin = {
301     config = "x86_64-apple-darwin";
302     xcodePlatform = "MacOSX";
303     platform = {};
304   };
306   #
307   # Windows
308   #
310   # 32 bit mingw-w64
311   mingw32 = {
312     config = "i686-w64-mingw32";
313     libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
314   };
316   # 64 bit mingw-w64
317   mingwW64 = {
318     # That's the triplet they use in the mingw-w64 docs.
319     config = "x86_64-w64-mingw32";
320     libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
321   };
323   ucrt64 = {
324     config = "x86_64-w64-mingw32";
325     libc = "ucrt"; # This distinguishes the mingw (non posix) toolchain
326   };
328   # LLVM-based mingw-w64 for ARM
329   ucrtAarch64 = {
330     config = "aarch64-w64-mingw32";
331     libc = "ucrt";
332     rust.rustcTarget = "aarch64-pc-windows-gnullvm";
333     useLLVM = true;
334   };
336   # BSDs
338   x86_64-freebsd = {
339     config = "x86_64-unknown-freebsd";
340     useLLVM = true;
341   };
343   x86_64-netbsd = {
344     config = "x86_64-unknown-netbsd";
345   };
347   # this is broken and never worked fully
348   x86_64-netbsd-llvm = {
349     config = "x86_64-unknown-netbsd";
350     useLLVM = true;
351   };
353   x86_64-openbsd = {
354     config = "x86_64-unknown-openbsd";
355     useLLVM = true;
356   };
358   #
359   # WASM
360   #
362   wasi32 = {
363     config = "wasm32-unknown-wasi";
364     useLLVM = true;
365   };
367   wasm32-unknown-none = {
368     config = "wasm32-unknown-none";
369     rust.rustcTarget = "wasm32-unknown-unknown";
370     useLLVM = true;
371   };
373   # Ghcjs
374   ghcjs = {
375     # This triple is special to GHC/Cabal/GHCJS and not recognized by autotools
376     # See: https://gitlab.haskell.org/ghc/ghc/-/commit/6636b670233522f01d002c9b97827d00289dbf5c
377     # https://github.com/ghcjs/ghcjs/issues/53
378     config = "javascript-unknown-ghcjs";
379   };