about summary refs log tree commit diff
path: root/lib/systems/parse.nix
AgeCommit message (Collapse)AuthorFilesLines
7 dayslib.systems.examples: add wasm32-unknown-noneIlan Joselevich1-2/+3
This system was added to use the nixpkgs cross compilation logic when compiling to wasm32-unknown-unknown in rust.
2024-05-26openbsd: init at 7.5Ali Abrar1-0/+1
2024-04-30treewide: freebsd13 -> freebsdJohn Ericson1-5/+1
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2024-03-19Avoid top-level `with ...;` in lib/systems/parse.nixPhilip Taron1-16/+43
2024-03-19lib/systems: inherit from lib.systems.inspect.predicates in ↵Philip Taron1-1/+8
lib/systems/parse.nix
2024-03-19lib/systems: use lib.systems.parse and lib.systems.inspect.predicates ↵Philip Taron1-1/+1
instead of re-importing
2023-10-22lib/systems/parse.nix: add, use removeAbiSuffixAdam Joseph1-1/+10
gnu-config will ignore the portion of a triple matching the regex `e?abi.*$` when determining the validity of a triple. In other words, `i386-linuxabichickenlips` is a valid triple. This commit updates our parsing routines to match gnu-config. I was recently surprised to discover that it is in fact possible to shoehorn ABI flavors into nix doubles in a way which preserves their property of being a (non-canonical) subset of the valid gnu-config triples. This commit is required in order to exploit that discovery to add automatic detection of ILP32 platforms (64-bit void*, 32-bit int, like the Apple Watch and MIPS n32) to Nix.
2023-06-18lib/systems/parse.nix: show respect where deservedAdam Joseph1-0/+2
The eminent Donald E. Knuth should be recognized as having equal standing with such entities as IBM, Apple, and the Personal Computer. We should acknowledge this by including him as a "vendor". Also, `gnu-config` recognizes `mmix-knuth-*` triples (and in fact requires `vendor="knuth"` when `cpu="mmix"`) -- so we sort of have to. But we should do it anyways.
2023-06-01lib.systems: remove mipsisa(32|64)r6 triplesAlyssa Ross1-8/+4
These arc the same as the normal triples apart for a difference in -march, so there's no need for them to be separate triples.
2023-04-27lib.platforms.loongarch64: initjackyliu161-0/+2
2023-03-08haskell.compiler.ghcHEAD: 9.7.20221224 -> 9.7.20230217sternenseemann1-1/+1
- Christmas is over! - Upstream has changed the name of the target triplet used for the JS backend from js-unknown-ghcjs to javascript-unknown-ghcjs, since Cabal calls the architecture "javascript": https://gitlab.haskell.org/ghc/ghc/-/commit/6636b670233522f01d002c9b97827d00289dbf5c Since the triplet is made up anyways, i.e. autoconf does not support it and Rust uses different triplets for its emscripten backends, we'll just change it as well. - Upstream fixed the problem with ar(1) being invoked incorrectly by stage0: https://gitlab.haskell.org/ghc/ghc/-/commit/e987e345c807035e4637ca3eae227ae501e16c42
2023-01-21lib/systems/parse: stop considering armv8a able to execute armv7lAtemu1-13/+2
In the past, most (if not all) armv8 CPUs could also execute armv7. However, with the advent of Apple Silicon, aarch64 CPUs without any aarch32 capabilities are now wide-spread among users.
2023-01-09add mipsisa{32,64}r6[el], closes 209952Adam Joseph1-4/+8
2022-11-13lib/systems/parse.nix: mkSkeletonFromList: improve readabilityAdam Joseph1-23/+23
The main purpose of this PR is to make the basis for `mkSkeletonFromList`'s decision between `cpu-kernel-libcabi` vs `cpu-vendor-os` clear, without changing its behavior. The existing code obscures this decision behind a sequence of prioritized matches (i.e. `if-then`) which jump around between different coordinates. Two side benefits of this PR: 1. It makes the root cause of #165836 obvious: we are missing a case for `cpu-vendor-libcabi`. This is why nixpkgs stumbles over `*-none-*`. 2. It illuminates some very weird corner cases in the existing logic, like `*-${vendor}-ghcjs` overriding the `vendor` field, and `mingw32` being transformed into `windows` in some cases. Co-authored-by: John Ericson <git@JohnEricson.me>
2022-11-04lib/systems: Support FreeBSDJohn Ericson1-3/+12
A tricky thing about FreeBSD is that there is no stable ABI across versions. That means that putting in the version as part of the config string is paramount. We have a parsed represenation that separates name versus version to accomplish this. We include FreeBSD versions 12 and 13 to demonstrate how it works.
2022-08-28lib/systems/parse: use ELFv2 by default for PPC64 BEMinijackson1-0/+2
2022-08-28lib/systems: add elfv1 / elfv2 ABIsMinijackson1-0/+8
2022-08-25lib/systems: add MicroBlaze architecturesMinijackson1-0/+3
2022-05-23lib/systems/parse: don't consider mode switching CPUs compatiblesternenseemann1-13/+6
Since we (exclusively) use isCompatible to gauge whether platform a can execute binaries built for platform b, mode switching CPUs are not to be considered compatible for our purposes: Switching the mode of a CPU usually requires a reset. At the very least we can't execute a mix of executables for the two modes which would usually be the case in nixpkgs where we may want to execute buildInputs for the hostPlatform in addition to nativeBuildInputs for the buildPlatform.
2022-05-22systems: support cross-compiling for Renesas RX microcontrollers (#173858)yvt1-0/+1
2022-03-10lib/systems: add mips64el definitionsAdam Joseph1-0/+7
MIPS has a large space of {architecture,abi,endianness}; this commit adds all of them to lib/systems/platforms.nix so we can be done with it. Currently lib/systems/inspect.nix has a single "isMips" predicate, which is a bit ambiguous now that we will have both mips32 and mips64 support, with the latter having two ABIs. Let's add four new predicates (isMips32, isMips64, isMips64n32, and isMips64n64) and treat the now-ambiguous isMips as deprecated in favor of the more-specific predicates. These predicates are used mainly for enabling/disabling target-specific workarounds, and it is extremely rare that a platform-specific workaround is needed, and both mips32 and mips64 need exactly the same workaround. The separate predicates (isMips64n32 and isMips64n64) for ABI distinctions are, unfortunately, useful. Boost's user-scheduled threading (used by nix) does does not currently supports mips64n32, which is a very desirable ABI on routers since they rarely have more than 2**32 bytes of DRAM.
2022-03-07lib/systems: Fix uclibc float-abi being flippedLevi Wright1-2/+2
uclibceabihf and uclibceabi's float hardness was flipped, which causes many headaches
2021-09-09lib/systems: add minimal s390x-linux cross-compile supportSergei Trofimovich1-0/+1
Tested basic functionality as: $ nix-build --arg crossSystem '{ config = "s390x-unknown-linux-gnu"; }' -A re2c $ file ./result/bin/re2c $ ./result/bin/re2c: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), dynamically linked, interpreter ...-gnu-2.33-50/lib/ld64.so.1, for GNU/Linux 2.6.32, not stripped $ qemu-s390x ./result/bin/re2c --version re2c 2.2
2021-08-01lib.systems: add m68k-netbsd supportAlyssa Ross1-3/+4
m68k was recently added for Linux and none, but NetBSD also supports m68k. Nothing will build yet, but I want to make sure we at least encode the existence of NetBSD support for every applicable architecture we support for other operating systems.
2021-07-25Initial implementation of s390 cross-compileBen Siraphob1-0/+2
2021-07-24Initial implementation of m68k cross-compileBen Siraphob1-0/+2
2021-06-06lib.systems.parsed: add "elf" for some NetBSD archsAlyssa Ross1-1/+13
In Autoconf, some old NetBSD targets like "i686-unknown-netbsd" are interpreted as a.out, not elf, and virtually nothing supports it. We need to specify e.g. "i686-unknown-netbsdelf" to get the right behaviour.
2021-06-06lib.systems.parse.kernels: fix typo in commentAlyssa Ross1-1/+1
2021-05-14lib/systems/parse: make isCompatible description clearer and more usefulBen Siraphob1-9/+14
Stating that CPUs and the isCompatible relation forms a category (or preorder) is correct but overtly technical. We can state it more clearly for readers unfamiliar with mathematics while retaining some keywords to be useful to technical readers.
2021-03-15lib/systems: remove powerpc64 elfv1 supportRyan Burns1-9/+0
I was specifying the ELF ABI using -elfv1 and -elfv2 target config suffixes, which are nonstandard and no longer work with gnu-config.
2021-01-30lib.systems: add powerpc64-linuxRyan Burns1-0/+9
PPC64 supports two ABIs: ELF v1 and v2. ELFv1 is historically what GCC and most packages expect, but this is changing because musl outright does not work with ELFv1. So any distro which uses musl must use ELFv2. Many other platforms are moving to ELFv2 too, such as FreeBSD (as of v13) and Gentoo (as of late 2020). Since we use musl extensively, let's default to ELFv2. Nix gives us the power to specify this declaratively for the entire system, so ELFv1 is not dropped entirely. It can be specified explicitly in the target config, e.g. "powerpc64-unknown-linux-elfv1". Otherwise the default is "powerpc64-unknown-linux-elfv2". For musl, "powerpc64-unknown-linux-musl" must use elfv2 internally to function.
2020-11-16Merge master into staging-nextFrederik Rietdijk1-14/+19
2020-11-09Initial support for OpenRISC 1000 (or1k)Samuel Dionne-Riel1-0/+2
2020-11-09Initial implementation of mmix cross-compileBen Siraphob1-14/+19
2020-07-21redox: add as targetAaron Janse1-0/+3
2020-03-24lib/systems: Add Genode platform definitionsEmery Hemingway1-0/+3
Add platform definitions for 64-bit ARM and x86. This is sufficient for for building Genode where a toolchain is provided as an overlay. Toolchain: git+https://git.sr.ht/~ehmry/genodepkgs?rev=14fc773ac9ecd2cbb30cb4612b284eee83d83546
2019-11-19initial implementation of vc4 cross-compileMichael Bishop1-0/+2
2019-11-11Merge remote-tracking branch 'upstream/master' into mingw-mcfthreadsJohn Ericson1-0/+1
2019-11-11lib: Switch to w64 vendor for MinGWJohn Ericson1-0/+3
It is needed for the `-municode` flag, supposedly.
2019-11-03lib.systems: handle mips family properlyoxalica1-0/+1
2019-09-02Merge branch 'master' into stagingVladimír Čunát1-1/+6
2019-09-02Merge remote-tracking branch 'upstream/master' into feature/js-unknown-ghcjsJohn Ericson1-19/+104
2019-09-02Add support for `js-unknown-ghcjs`Moritz Angermann1-1/+6
This adds enough logic to nixpkgs to support the `js-unknown-ghcjs` triple.
2019-08-28treewide: remove redundant recvolth1-1/+1
2019-06-16treewide: remove unused variables (#63177)volth1-1/+1
* treewide: remove unused variables * making ofborg happy
2019-04-23Merge pull request #56555 from matthewbauer/wasmMatthew Bauer1-0/+4
Initial WebAssembly/WASI cross-compilation support
2019-04-23wasm: init cross targetMatthew Bauer1-0/+4
Adds pkgsCross.wasm32 and pkgsCross.wasm64. Use it to build Nixpkgs with a WebAssembly toolchain. stdenv/cross: use static overlay on isWasm isWasm doesn’t make sense dynamically linked.
2019-04-20cc-wrapper: make machine configuration configurableMatthew Bauer1-18/+18
It is useful to make these dynamic and not bake them into gcc. This means we don’t have to rebuild gcc to change these values. Instead, we will pass cflags to gcc based on platform values. This was already done hackily for android gcc (which is multi-target), but not for our own gccs which are single target. To accomplish this, we need to add a few things: - add ‘arch’ to cpu - add NIX_CFLAGS_COMPILE_BEFORE flag (goes before args) - set -march everywhere - set mcpu, mfpu, mmode, and mtune based on targetPlatform.gcc flags cc-wrapper: only set -march when it is in the cpu type Some architectures don’t have a good mapping of -march. For instance POWER architecture doesn’t support the -march flag at all! https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html#RS_002f6000-and-PowerPC-Options
2019-04-19systems/parse.nix: fixup arm compatibilitiesMatthew Bauer1-13/+33
2019-03-25systems: support TI MSP430 microcontrollersAaron Lindsay1-0/+1