Commit graph

52 commits

Author SHA1 Message Date
Ben Siraphob 0f1204bd2b Initial implementation of s390 cross-compile 2021-07-25 10:12:18 +07:00
Ben Siraphob 407953e9df Initial implementation of m68k cross-compile 2021-07-24 14:37:35 +07:00
Frederik Rietdijk 986c2d36da Merge master into staging-next 2020-11-16 09:01:53 +01:00
Samuel Dionne-Riel 6d8327ea96 Initial support for OpenRISC 1000 (or1k) 2020-11-09 22:32:11 -05:00
Ben Siraphob 445dde6304 Initial implementation of mmix cross-compile 2020-11-09 19:49:55 +07:00
Aaron Janse 60fd049b65 redox: add as target 2020-07-21 13:11:36 -07:00
Emery Hemingway 9f91fa02a6 lib/systems: Add Genode platform definitions
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
2020-03-24 20:41:21 +05:30
Chuck 5d4821141b stdenv: Remove isArm (use isAarch32 instead)
isArm has been deprecated for three releases.  All references have been
removed.  Tree-wide substitution was performed in #37401 21 months ago.
2020-02-05 10:56:14 -08:00
Michael Bishop 4aa1ffae04
initial implementation of vc4 cross-compile 2019-11-19 22:19:15 -04:00
John Ericson c2b34b2b57 Merge remote-tracking branch 'upstream/master' into js-unknown-ghcjs 2019-09-02 01:57:01 -04:00
John Ericson a77a2cfe4a lib: Further clean up systems list 2019-09-02 01:55:38 -04:00
John Ericson f57fe63d5f Merge lib sort into feature/js-unknown-ghcjs 2019-09-02 01:44:30 -04:00
John Ericson 3d8cf08706 lib: Sort platform predicates 2019-09-02 01:38:22 -04:00
John Ericson c33d80c071 Merge remote-tracking branch 'upstream/master' into feature/js-unknown-ghcjs 2019-09-02 01:31:31 -04:00
Moritz Angermann 446f8c851d Add support for js-unknown-ghcjs
This adds enough logic to nixpkgs to support the `js-unknown-ghcjs` triple.
2019-09-02 01:27:05 -04:00
Matthew Bauer 0fef9f89e4 systems: fix lib-tests
These were broken by the added system doubles. This just adds those to
the lib-tests.
2019-06-04 14:51:33 -04:00
Matthew Bauer d591a109be wasm: don’t assume musl 2019-04-23 21:48:57 -04:00
Matthew Bauer 9abff4af4f wasm: init cross target
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-23 21:48:57 -04:00
Aaron Lindsay 1eca945e94 systems: support TI MSP430 microcontrollers 2019-03-25 20:33:58 -07:00
Vincent Weisner 1eca8366e8 alpha-embedded: isAlpha code Added (#56090)
Adds isAlpha to stdenv.<platform> flags.
2019-02-20 14:27:47 -05:00
Daniel Goertzen 1c10efc912 add generic x86_32 support (#52634)
* add generic x86_32 support

- Add support for i386-i586.
- Add `isx86_32` predicate that can replace most uses of `isi686`.
- `isi686` is reinterpreted to mean "exactly i686 arch, and not say i585 or i386".
- This branch was used to build working i586 kernel running on i586 hardware.

* revert `isi[345]86`, remove dead code

- Remove changes to dead code in `doubles.nix` and `for-meta.nix`.
- Remove `isi[345]86` predicates since other cpu families don't have specific model predicates.

* remove i386-linux since linux not supported on that cpu
2019-01-06 12:57:36 -06:00
Matthew Bauer d59a9ac7cf avr: use new compilation infrastructure
Gets rid of:
  avrbinutils
  avrgcc

to replace with:
  pkgsCross.avr.buildPackages.binutils
  pkgsCross.avr.buildPackages.gcc
2018-10-29 14:34:09 -05:00
Jörg Thalheim 9efffe0135 hurd: cleanup unmaintained target
This has been not touched in 6 years. Let's remove it to cause less
problems when adding new cross-compiling infrastructure.
This also simplify gcc significantly.
2018-08-28 22:18:02 +01:00
CrystalGamma 72d161f548 [RFC] ppc64le enablement (#45340)
* ppc64le enablement

* gcc, glibc: properly handle __float128

* lib/systems, stdenv: syntax cleanup

* gcc7: remove ugly hack

* gcc: add/update __float128 flags

* stdenv: add another pair of quotes for consistency

* gcc: move __float128 flag for ppc64le-glibc into common/platform-flags.nix
2018-08-21 15:31:34 -04:00
John Q Crosscompiler 7cc62144b2
systems: Allow detection of powerpc and sparc 2018-07-26 09:33:36 -04:00
John Ericson f4de669777 lib/systems/inspect: Fix after assertions
Function are never equal in Nix, so we need to filter out this attribute
in ABIs.
2018-05-11 19:02:50 -04:00
John Ericson b3ef322770 Merge commit '70963b382f3f820ba6d3bc3b3aaf50a2957ec1ff' into uclibc 2018-05-10 00:18:51 -04:00
John Ericson e42a7a5c0b lib/systems: Add uClibc just like MUSL 2018-05-09 23:39:23 -04:00
John Ericson 57723e947a Merge remote-tracking branch 'upstream/master' into aarch32 2018-04-30 23:06:59 -04:00
John Ericson b9acfb4ecf treewide: isArm -> isAarch32
Following legacy packing conventions, `isArm` was defined just for
32-bit ARM instruction set. This is confusing to non packagers though,
because Aarch64 is an ARM instruction set.

The official ARM overview for ARMv8[1] is surprisingly not confusing,
given the overall state of affairs for ARM naming conventions, and
offers us a solution. It divides the nomenclature into three levels:

```
ISA:             ARMv8   {-A, -R, -M}
                 /    \
Mode:     Aarch32     Aarch64
             |         /   \
Encoding:   A64      A32   T32
```

At the top is the overall v8 instruction set archicture. Second are the
two modes, defined by bitwidth but differing in other semantics too, and
buttom are the encodings, (hopefully?) isomorphic if they encode the
same mode.

The 32 bit encodings are mostly backwards compatible with previous
non-Thumb and Thumb encodings, and if so we can pun the mode names to
instead mean "sets of compatable or isomorphic encodings", and then
voilà we have nice names for 32-bit and 64-bit arm instruction sets
which do not use the word ARM so as to not confused either laymen or
experienced ARM packages.

[1]: https://developer.arm.com/products/architecture/a-profile

(cherry picked from commit ba52ae5048)
2018-04-25 15:50:41 -04:00
John Ericson ba52ae5048 treewide: isArm -> isAarch32
Following legacy packing conventions, `isArm` was defined just for
32-bit ARM instruction set. This is confusing to non packagers though,
because Aarch64 is an ARM instruction set.

The official ARM overview for ARMv8[1] is surprisingly not confusing,
given the overall state of affairs for ARM naming conventions, and
offers us a solution. It divides the nomenclature into three levels:

```
ISA:             ARMv8   {-A, -R, -M}
                 /    \
Mode:     Aarch32     Aarch64
             |         /   \
Encoding:   A64      A32   T32
```

At the top is the overall v8 instruction set archicture. Second are the
two modes, defined by bitwidth but differing in other semantics too, and
buttom are the encodings, (hopefully?) isomorphic if they encode the
same mode.

The 32 bit encodings are mostly backwards compatible with previous
non-Thumb and Thumb encodings, and if so we can pun the mode names to
instead mean "sets of compatable or isomorphic encodings", and then
voilà we have nice names for 32-bit and 64-bit arm instruction sets
which do not use the word ARM so as to not confused either laymen or
experienced ARM packages.

[1]: https://developer.arm.com/products/architecture/a-profile
2018-04-25 15:28:55 -04:00
Shea Levy 26e8d58cb5
libseccomp: Disable only on RISC-V if Linux.
The isSeccomputable flag treated Linux without seccomp as just a
normal variant, when it really should be treated as a special case
incurring complexity debt to support.
2018-03-27 08:16:24 -04:00
Shea Levy cdf9a78a3e
kexectools: Disable only on RISC-V if Linux.
The isKexecable flag treated Linux without kexec as just a normal
variant, when it really should be treated as a special case incurring
complexity debt to support.
2018-03-27 08:15:07 -04:00
John Ericson 175d4ab1db lib: Make platform predicates greppable
Should have commited on here and on merged master to begin with, but I
didn't, so instead I cherry-pick.

(cherry picked from commit 88c04a8b6b)
2018-03-20 12:35:20 -04:00
John Ericson 88c04a8b6b lib: Make platform predicates greppable 2018-03-19 22:20:48 -04:00
John Ericson bbfa2f9701 lib: Split Darwin into macOS and iOS
I noticed LLVM accepts `ios` as its own OS in platform triples; a
recent change as far as I know. I see it also accepts `macos*` for macOS
(formerly OS X). If it's now customary to distinguish iOS like so
(rather than guessing from the aarch, lets add both so our OSes are
still disjoint, and make Darwin a family instead.

But changing the config everywhere would probably be a mass rebuild, and
I'm not sure how well other software supports OSes besides "darwin", so
I'm keeping that the default name for macOS for now.
2018-03-19 12:02:49 -04:00
John Ericson 2482e2858e prebuilt android tools: Init using SDK
Expose as an option for the cross stdenv.
2018-02-27 14:15:39 -05:00
Shea Levy 3c57e770cf
Only build libseccomp on supported systems 2018-02-24 23:05:08 -05:00
Shea Levy 0ac6d4aeb6
gnu-efi: Fix aarch64 cross-build 2018-02-24 22:15:48 -05:00
Shea Levy 87270fb306
gnu-efi: Only build on efi-enabled systems 2018-02-24 21:49:31 -05:00
Shea Levy 63fa1fcb04
kexectools: Only build on kexecable architectures. 2018-02-24 10:37:54 -05:00
Will Dietz f090bbb248 Drop "isGlibc", but keep isMusl.
gnu "abi" doesn't mean glibc (mingw, apparently).
2018-02-11 14:55:17 -06:00
Will Dietz 2dfee94fe7 lib/systems: musl, libc predicates
Note this doesn't actually provide musl support yet,
just improves our "system" code to understand
musl-based triples and non-glibc linux configurations.
2018-02-11 14:20:14 -06:00
John Ericson d1478c91c3 lib: Allow parsing platform configs with arch of {riscv,wasm}{32,64}
Also add `isRiscv` and `isWasm` predicates.
2018-01-26 12:44:05 -05:00
Graham Christensen 152c63c9ff
Convert libs to a fixed-point
This does break the API of being able to import any lib file and get
its libs, however I'm not sure people did this.

I made this while exploring being able to swap out docFn with a stub
in #2305, to avoid functor performance problems. I don't know if that
is going to move forward (or if it is a problem or not,) but after
doing all this work figured I'd put it up anyway :)

Two notable advantages to this approach:

1. when a lib inherits another lib's functions, it doesn't
   automatically get put in to the scope of lib
2. when a lib implements a new obscure functions, it doesn't
   automatically get put in to the scope of lib

Using the test script (later in this commit) I got the following diff
on the API:

  + diff master fixed-lib
  11764a11765,11766
  > .types.defaultFunctor
  > .types.defaultTypeMerge
  11774a11777,11778
  > .types.isOptionType
  > .types.isType
  11781a11786
  > .types.mkOptionType
  11788a11794
  > .types.setType
  11795a11802
  > .types.types

This means that this commit _adds_ to the API, however I can't find a
way to fix these last remaining discrepancies. At least none are
_removed_.

Test script (run with nix-repl in the PATH):

  #!/bin/sh

  set -eux

  repl() {
      suff=${1:-}
      echo "(import ./lib)$suff" \
          | nix-repl 2>&1
  }

  attrs_to_check() {
      repl "${1:-}" \
          | tr ';'  $'\n' \
          | grep "\.\.\." \
          | cut -d' ' -f2 \
          | sed -e "s/^/${1:-}./" \
          | sort
  }

  summ() {
      repl "${1:-}" \
          | tr ' ' $'\n' \
          | sort \
          | uniq
  }

  deep_summ() {
      suff="${1:-}"
      depth="${2:-4}"
      depth=$((depth - 1))
      summ "$suff"

      for attr in $(attrs_to_check "$suff" | grep -v "types.types"); do
          if [ $depth -eq 0 ]; then
              summ "$attr" | sed -e "s/^/$attr./"
          else
              deep_summ "$attr" "$depth" | sed -e "s/^/$attr./"
          fi
      done
  }

  (
      cd nixpkgs

      #git add .
      #git commit -m "Auto-commit, sorry" || true
      git checkout fixed-lib
      deep_summ > ../fixed-lib
      git checkout master
      deep_summ > ../master
  )

  if diff master fixed-lib; then
      echo "SHALLOW MATCH!"
  fi

  (
      cd nixpkgs
      git checkout fixed-lib
      repl .types
  )
2017-09-16 21:36:43 -04:00
Tuomas Tynkkynen 5674da5aed Fix "treewide: Consistently call ARM 'arm'"
0c0fad6141 was broken. I didn't realize there's some hidden
metaprogramming code where one can't even grep for 'isFoo' to find its
definition :(
2017-08-24 14:43:57 +03:00
John Ericson 02464668c0 lib: Add isPowerPC predicate, and fix family name 2017-07-10 11:13:56 -04:00
David McFarland bb3c8a164c lib: Include darwin in isUnix 2017-07-03 09:31:25 -03:00
David McFarland 4ac1901d54 stdenv: remove unix kernel family
System predicate patterns can now be specified as a list of OR'd
attribute sets.
2017-06-26 09:33:41 -03:00
John Ericson fedcda6cda zpaqd: Modernize derivation
- Simplified platform-specific options
 - Almost ready for cross-compilation
2017-05-22 18:52:50 -04:00