Commit graph

302 commits

Author SHA1 Message Date
oxalica 955d032b47
lib.systems: handle mips family properly 2019-11-03 22:10:06 +08:00
John Ericson 3098d65210 lib: Add armv7a-linux to doubles.nix
This is needed for android.
2019-10-01 12:51:57 -04:00
Vladimír Čunát f21211ebfe
Merge branch 'master' into staging 2019-09-02 23:25:24 +02: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
volth 08f68313a4 treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
volth 35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
Jay Kruer e931a525f9 Add RISC-V embedded crossSystems 2019-07-25 21:45:11 -07:00
Matthew Bauer d059185bad Revert "Revert "systems/doubles.nix: add Apple doubles""
This reverts commit ce2f74df2c.

Doubles are treated as -darwin here, to provide some consistency.
There is some ambiguity between “x86_64-darwin” and “i686-darwin”
which could refer to binaries linked between iOS simulator or real
macOS binaries. useiOSPrebuilt can be used to determine which to use,
however.
2019-07-10 15:14:59 -04:00
Frederik Rietdijk ce2f74df2c Revert "systems/doubles.nix: add Apple doubles"
The lib tests need to be fixed as well.

This unbreaks the tarball job.

This reverts commit 00ba557856.
2019-07-10 12:37:06 +02:00
Matthew Bauer 00ba557856 systems/doubles.nix: add Apple doubles
These are used in cross-compilation to iOS devices and simulators.

Fallout from #60349.
2019-07-08 12:33:16 -04:00
volth f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00: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 de70b76779 systems: fixup from last commit
it’s powerpc-none not ppc-none
2019-06-04 13:42:14 -04:00
Matthew Bauer f7c7207a3f systems: add missing doubles
in https://github.com/NixOS/nixpkgs/pull/60349, the attr handling was
removed. This means we rely on these double values for determing what
we are compatible with. This adds some of the missing doubles to this
list.

https://hydra.nixos.org/eval/1523389#tabs-removed
2019-06-04 13:34:40 -04:00
Matthew Bauer 760c9995b0
Merge pull request #60349 from matthewbauer/fix-60345
check-meta: use system tuple in platforms
2019-06-04 11:29:48 -04:00
Matthew Bauer 635b762569 systems: allow passing in string for cross/localSystem
This makes things a little bit more convenient. Just pass in like:

$ nix-build ’<nixpkgs>’ -A hello --argstr localSystem x86_64-linux --argstr crossSystem aarch64-linux
2019-06-04 11:17:25 -04:00
Matthew Bauer 40271ae138 systems: remove forMeta
This is unused now.
2019-06-04 11:09:43 -04:00
Lionello Lunesu fb147b07ad Adds pkgsCross.gnu32 and pkgsCross.gnu64 platforms 2019-05-05 15:24:10 +08:00
Matthew Bauer e500bb8409 systems: add riscv double
This was never listed in doubles.nix! Not sure why?
2019-04-30 12:59:38 -04:00
Matthew Bauer 7488a367af
Merge pull request #56555 from matthewbauer/wasm
Initial WebAssembly/WASI cross-compilation support
2019-04-23 22:44:33 -04:00
Matthew Bauer dbb94b984f wasmtime: init and use for emulation
This isn’t really an "emulator" but it’s the closest concept we have
right now.
2019-04-23 21:48:57 -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
Matthew Bauer d180cb9850 cc-wrapper: make machine configuration configurable
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-20 20:05:51 -04:00
Matthew Bauer ae50241871 release-cross: remove alpha-elf target
This doesn’t appear to ever have worked. binutils doesn’t seem to
support the alpha-elf target at all. It doesn’t make sense to keep
this around.

https://hydra.nixos.org/build/92403855/nixlog/1/tail
2019-04-20 17:22:52 -04:00
Matthew Bauer d8934feba1 kernel-headers: infer ARCH from config triple
This makes us less reliant on the systems/examples.nix. You should be
able to cross compile with just your triple:

$ nix build --arg crossSystem '{ config = "armv6l-unknown-linux-gnueabi"; }' stdenv
2019-04-19 14:53:48 -04:00
Matthew Bauer 5eea658778 systems: correct qemu architectures
ppc64le and ppc64 are different targets in the configure script. We
can’t use the same one.

TODO: canonicalize similar ones based on qemu’s configure script.
2019-04-19 12:03:56 -04:00
Matthew Bauer 23560ea057 systems: fix emulator identity
Squashed to fix shell quoting, thanks @Ericson2314
2019-04-19 12:03:44 -04:00
Matthew Bauer 59bb1dcbfb systems/parse.nix: fixup arm compatibilities 2019-04-19 12:00:32 -04:00
Ken Micklas ec7643047c androidndk-pkgs: Remove -mfloat flag 2019-04-16 16:21:51 -04:00
Matthew Bauer ac491d2df7 systems: remove android armv5te platform
this isn’t useful any more because the ndk we use no longer supports it.
2019-04-10 01:55:09 -04:00
Matthew Bauer 589c2c2870 androidndk: fixup mess
New android ndk (18) now uses clang. We were going through the wrapper
that are provided. This lead to surprising errors when building.
Ideally we could use the llvm linker as well, but this leads to errors
as many packages don’t support the llvm linker.
2019-04-10 01:30:34 -04:00
Vladimír Čunát 2771375d6e
Merge branch 'master' into staging-next
Hydra nixpkgs: ?compare=1512490
2019-04-02 20:56:53 +02:00
Aaron Lindsay 1c7bb464d9 msp430: include vendor headers with stdenv 2019-03-25 20:39:51 -07:00
Aaron Lindsay 1eca945e94 systems: support TI MSP430 microcontrollers 2019-03-25 20:33:58 -07:00
Frederik Rietdijk 205e0fc5bd Merge staging-next into staging 2019-03-01 09:22:21 +01:00
Matthew Bauer 5c46f77249
Merge pull request #56197 from matthewbauer/cross-fixes3
Android and related cross fixes
2019-02-26 20:30:53 -05:00
Matthew Bauer 8e25da0beb cross/tests: add llvm-based tests 2019-02-26 19:46:24 -05:00
Matthew Bauer 3c8b75f536
Merge pull request #56393 from matthewbauer/is-compatible
systems: add isCompatible handling
2019-02-26 16:39:08 -05:00
Matthew Bauer aab8c7ba43 netbsd: add cross target 2019-02-26 15:55:47 -05:00
Matthew Bauer 20a4bbe23b systems: add “emultator” for wasm
v8 can run any wasm bytecode
2019-02-25 20:07:43 -05:00
Matthew Bauer bfb45e96b9 mesa: armv7a-linux supports mesa 2019-02-24 17:00:48 -05:00
Matthew Bauer f455a07f13 systems: add isCompatible handling 2019-02-21 22:17:51 -05:00
Vincent Weisner 1eca8366e8 alpha-embedded: isAlpha code Added (#56090)
Adds isAlpha to stdenv.<platform> flags.
2019-02-20 14:27:47 -05:00
Vladimír Čunát 5effa4e0f9
Merge branch 'master' into staging-next
Comments on conflicts:
- llvm: d6f401e1 vs. 469ecc70 - docs for 6 and 7 say the default is
  to build all targets, so we should be fine
- some pypi hashes: they were equivalent, just base16 vs. base32
2019-02-01 09:22:29 +01:00
Matthew Bauer bf041c3f1d
systems/default.nix: wasm in platform.uname.system
This adds the "Wasm" system to platform.uname.system. This is used in CMake infrastructure.
2019-01-27 17:29:23 -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
Vladimír Čunát d84a33d85b
Merge branch 'master' into staging-next
A few more rebuilds (~1k on x86_64-linux).
2019-01-05 15:02:04 +01:00
John Ericson 3bf0e4efc7 lib: Fix Mingw on 32-bit ARM 2019-01-04 12:05:35 -05:00
Jan Tojnar c45e9d0fac
Merge branch 'master' into staging 2018-12-25 17:03:57 +01:00
Sander van der Burg 51428627eb Initial attempt to restore Android NDK cross building 2018-12-18 22:58:12 +01:00
Jörg Thalheim 554851e689
platform.emulator: fix non-x86 systems 2018-12-12 08:00:07 +00:00
Matthew Bauer 3b32c920d5 systems/parse.nix: support eabihf
eabihf is an abi that can be used with ARM architectures that support
the “hard float”. It should probably only be used with ARM32 when you
are absolutely sure your binaries will run on ARM systems with a FPU.

Also, add an example "armhf-embedded" to match the preexisting
arm-embedded system. qmk_firmware needs hard float in a few places, so
add them here to get that to work.

Fixes #51184
2018-12-02 19:49:36 -06:00
Matthew Bauer f435272ce3
Merge pull request #50212 from matthewbauer/host-emulator
Add "emulator" function to systems
2018-11-29 19:34:20 -06:00
Matthew Bauer 9c8fd41224 treewide: add emulator to platform
You can use stdenv.hostPlatform.emulator to get an executable that
runs cross-built binaries. This could be any emulator. For instance,
we use QEMU to emulate Linux targets and Wine to emulate Windows
targets. To work with qemu, we need to support custom targets.

I’ve reworked the cross tests in pkgs/test/cross to use this
functionality.

Also, I’ve used talloc to cross-execute with the emulator. There
appears to be a cross-execute for all waf builds. In the future, it
would be nice to set this for all waf builds.

Adds stdenv.hostPlatform.qemuArch attrbute to get the qemuArch for
each platform.
2018-11-29 19:15:30 -06:00
Matthew Bauer ce6d558c4d systems/examples.nix: move riscv function to let binding
Makes it easier to use mapAttrs with lib.systems.examples. Now every
entry in it are legitimate systems.
2018-11-29 19:15:28 -06:00
Matthew Bauer 4b00cfe77f systems/parse: add older x86 architectures
i386, i486, i586 are added. These may have issues as many places
assume i686 is the only valid 32 bit x86 architecture.
2018-11-21 09:38:10 -06:00
Vincent Weisner e7d2ea13e1
lib/systems: Added missing semicolons 2018-11-09 09:08:28 -05:00
Vincent Weisner 84810a1ba0
lib/system: Added Embedded Platforms for the CPUs
I added some embedded platforms for the CPUs I added to the parse.nix file.
These could be used as new platforms for the added CPUs.
2018-11-09 09:06:31 -05:00
Vincent Weisner 0607adde1a
Update parse.nix 2018-11-02 09:38:47 -04:00
Jörg Thalheim aa75ebdcd3
CPU Fix
Co-Authored-By: vincrusher <vincentweisner@icloud.com>
2018-11-01 11:14:18 -04:00
Vincent Weisner f9aaf7134b
Update parse.nix 2018-11-01 10:00:55 -04:00
John Ericson 4c48da246f
Merge pull request #49567 from obsidiansystems/arm-auto-detect
lib.systems.platforms: Add more ARM autodetection
2018-10-31 21:21:14 -04:00
John Ericson aa964c82d3 lib.systems.platforms: Add more ARM autodetection 2018-10-31 19:04:06 -04:00
Matthew Bauer 2634d37617 systems/examples: add i686 & x86-64 embedded
Fixes #28160
2018-10-30 13:46:01 -05:00
Matthew Bauer 52dbd3380e systems/parse.nix: support weird system configs
There are some weird ones out there that don’t follow any pattern:

- arm-none-eabi
- powerpc-none-eabi
- aarch64-none-elf
2018-10-29 14:34:10 -05:00
Matthew Bauer 412093994b gcc: support avr
- respect libc’s incdir and libdir
- make non-unix systems single threaded
- set LIMITS_H_TEST to false for avr
- misc updates to support new libc’s
- use multilib with avr

For threads we want to use:
- posix on unix systems
- win32 on windows
- single on everything else

For avr:
- add library directories for avrlibc
- to disable relro and bind
- avr5 should have precedence over avr3 - otherwise gcc uses the wrong one
2018-10-29 14:34:09 -05:00
Matthew Bauer 72e3b2a662 systems: add avrlibc for avr systems 2018-10-29 14:34:09 -05: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
Matthew Bauer 4a12a9321c tests/systems.nix: fix tests
these weren’t being run correctly
2018-10-18 14:12:49 -05:00
Matthew Bauer c8040003f0 Correctly set windows doubles
mingw is the toolchain name but it is actually run on a window kernel
2018-10-17 17:03:00 -05:00
Matthew Bauer 45cc6e2a42 lib/systems: use lookup for uname.system
This is a little bit cleaner and avoids the if ... else if ... chain.
2018-10-17 14:43:49 -05:00
Matthew Bauer 8652631b13 systems/doubles.nix: add mingw doubles
this makes it easier to show what supports windows vs. unix.
2018-10-16 21:56:58 -05:00
Matthew Bauer 0e0894c37d lib/systems: add uname attrs 2018-10-16 21:48:43 -05:00
Ben Wolsieffer 50e947f529 lib/systems: use correct config for armv7l-hf-multiplatform 2018-10-06 01:01:07 -04:00
John Ericson 6769437186 androidndk: Add Darwin support
Also switch Linux to using the official sha1 hashes for consistency.
They are gotten from https://developer.android.com/ndk/downloads/.
2018-09-17 22:34:37 -04: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
Matthew Bauer a22797d356 systems: fix netbsd triple parsing
binutils expects x86_64-unknown-netbsd<version> (only 3 parts!). Any other combo seems to fail.

Also handle darwin versions similarly.

/cc @Ericson2314
2018-07-28 19:54:09 -04:00
John Q Crosscompiler 7cc62144b2
systems: Allow detection of powerpc and sparc 2018-07-26 09:33:36 -04:00
Matthew Bauer 0bfffbc5e1 xcode: add xcodePlatform to system
This give us a little bit more control over what target we are using.
Eventually we can target other things like WatchOS or MacOS.
2018-06-25 22:18:23 -04:00
Matthew Bauer 9b0b31d981 xcode: add xcodeVer to system
This version number controls which xcode version to use when building
cross to iOS.
2018-06-25 21:57:24 -04:00
Matthew Bauer c8fd285c8d android: add ndkVer to resolve ndk ambiguity
It wasn’t exactly clear which NDK you were using previously. This adds
an attribute to system that handles what version of the NDK we should
use when building things.

/cc @Ericson2314
2018-06-22 11:06:17 -04:00
Matthew Bauer cf09ffe9aa android: Use NDK 17 for aarch32 2018-06-22 09:33:25 -04:00
Ben Wolsieffer 7cb01d58b2 platforms/raspberrypi: enable kernelAutoModules 2018-06-12 20:44:23 +03:00
Tuomas Tynkkynen e864247f08 Merge branch 'plat-fix-for-merge-2' into master 2018-06-01 20:08:08 +03:00
Tuomas Tynkkynen 27bb4da344 platforms.nix: More rpi2 cleanup 2018-05-31 18:06:09 +03:00
Tuomas Tynkkynen 3abdd4f1e3 platforms.nix: Clean up obsolete cruft from raspberrypi2 2018-05-31 18:06:09 +03:00
Tuomas Tynkkynen db2988f7bd platforms.nix: Clean up obsolete cruft from raspberrypi
Works fine without, and the 'DRM n' is actually preventing the mainline
VC4 driver from building.
2018-05-31 18:06:09 +03:00
Tuomas Tynkkynen 96edbe4a0e linux_rpi: Specify defconfig in kernel expression
In particular, now the mainline kernel can be built on the RPi 1 as well
(so kernelBaseConfig should always be a mainline defconfig from now on).
And RPi 2 users can now use linux_rpi without doing the
`nixpkgs.config.platform = lib.systems.platforms.raspberrypi2;` dance.
2018-05-31 18:06:09 +03:00
John Ericson 72fa40f72d lib: Fix nix-env -qaP -f . --xml --meta
A merge undid my fix in d437f2c365.
2018-05-29 13:06:17 -04:00
Jan Malakhovski ad35019501 Merge branch 'master' into staging
Fixed conflicts:
- lib/systems/for-meta.nix: in favor of staging
- pkgs/os-specific/darwin/xcode/default.nix: in favor of master
2018-05-26 00:20:17 +00:00
John Ericson d437f2c365 lib: Fix nix-env -qaP -f . --xml --meta
The function value cannot be serialized so nix-env was mad. Turns out we can
just remove it like we do in `lib/systems/inspect.nix`.
2018-05-24 10:43:14 -04:00
Tuomas Tynkkynen 003473613a Merge remote-tracking branch 'upstream/master' into staging
Conflicts:
	pkgs/top-level/all-packages.nix
2018-05-18 03:54:38 +03:00
Bastian Köcher 832a8ca087 androidndk: Fix usage as crossSystem 2018-05-17 17:22:27 +02:00
John Ericson 2c5d915200 Merge commit '92b7a814f26ee1d37e989431c18518c67285a332' into staging 2018-05-13 01:02:09 -04:00
John Ericson 92b7a814f2 Merge branch 'fix-gcc-with-float' 2018-05-12 15:21:30 -04:00
John Ericson f2004e6287 lib: Fix float handling for Aarch32
Forgot to adjust default so abi with explicit float attr would be used.
2018-05-12 15:18:31 -04:00
John Ericson 6f40d18d44 prebuilt android cc: Edit wrapper to pass the right -m flags for armv7a
(cherry picked from commit 827ef09140)
2018-05-12 15:16:16 -04:00
John Ericson 6a96dc0417 lib/system: Remove float from androideabi
There are two different official variations which differ in their float
support, so such a blanket statement is invalid.
`lib.systems.platforms.*android` already handles each case correctly.

Correcting an error in 827ef09140.
2018-05-11 20:16:28 -04:00
John Ericson 827ef09140 prebuilt android cc: Edit wrapper to pass the right -m flags for armv7a 2018-05-11 19:17:35 -04:00
John Ericson 28bacc2093 lib/systems: Add assertion to "android" ABI
This is analogous to the GNU assertion.
2018-05-11 19:03:07 -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 98a1b89945
Merge pull request #40385 from obsidiansystems/lib-android-platforms
lib: Add 32-bit Android platforms
2018-05-11 19:01:22 -04:00
John Ericson e3f6c6d18d lib: Add 32-bit Android platforms 2018-05-11 18:41:55 -04:00
John Ericson 81387c2e78 Merge remote-tracking branch 'upstream/master' into staging 2018-05-11 17:12:04 -04:00
John Ericson 0a77a72895
Merge pull request #40378 from obsidiansystems/lib-platform-sort
lib/systems: Sort platforms, and space CPUs
2018-05-11 17:10:49 -04:00
John Ericson 341794a4b9 lib/systems: Sort platforms, and space CPUs 2018-05-11 15:02:18 -04:00
John Ericson ee4b56edd3 Merge remote-tracking branch 'upstream/master' into staging 2018-05-11 14:36:08 -04:00
John Ericson f18ddabee7 Merge remote-tracking branch 'upstream/master' into lib-float 2018-05-10 18:13:00 -04:00
John Ericson 1fe81a4bcd lib: Clean up float/fpu options
ARM ABIs now have a float field. This is used as a fallback to lessen
our use of `platform.gcc.float`. I didn't know what the MIPs convention
is so I kept using `platform.gcc.float` in that case.
2018-05-10 18:02:00 -04:00
John Ericson 67db915a43 Merge remote-tracking branch 'upstream/master' into staging 2018-05-10 16:35:04 -04:00
John Ericson 58b2e875c2 lib/systems: Prohibit "gnu" ABI (*-gnu) with 32-bit ARM
It is ambiguous, and therefore banned within GCC.
2018-05-10 15:05:23 -04:00
John Ericson 006422d08d Merge commit 'feb648ce59ffbed94c58133eb7aa2761992a35e1' into staging 2018-05-10 01:55:26 -04:00
John Ericson feb648ce59 Merge commit '70963b382f3f820ba6d3bc3b3aaf50a2957ec1ff' into lib-platform-simplify 2018-05-10 01:40:38 -04:00
John Ericson a02be2bd85 treewide: Get rid of *Platform.arch
Use `parsed.cpu.name` or `platform.gcc.arch` instead.
2018-05-10 01:37:31 -04:00
John Ericson f063a860d6 xbursttools: Cleanup slightly 2018-05-09 23:40:13 -04:00
John Ericson e42a7a5c0b lib/systems: Add uClibc just like MUSL 2018-05-09 23:39:23 -04:00
John Ericson 3fa0ba9177 lib/systems: Parse more arm cpu types 2018-05-09 18:57:39 -04:00
Ben Gamari 8b32cfdbc0 lib.systems.gnu: Accept gnueabi as a gnu platform 2018-05-03 17:06:01 -04:00
John Ericson db4f96b3cb lib/systems: Fix eval for iphone32* examples
Whoops messed up 9a845de873 slightly.
2018-05-01 13:04:57 -04:00
John Ericson 9a845de873 lib/systems: Update iOS examples
The commented-out configs are @shlevy's old known-good ones. I changed
them as needed to play nice with lib.systems.parse but did not test so
leaving them as comments for now.
2018-05-01 01:16:27 -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
John Ericson cf0dd1dbd2
Merge pull request #39172 from obsidiansystems/ios-cross
ios-sdk-pkgs: Init from iOS SDK from XCode
2018-04-19 17:00:05 -04:00
Ken Micklas ef3db7d14c ios-sdk-pkgs: Init from iOS SDK from XCode 2018-04-19 16:09:30 -04:00
John Ericson 53686e8995
Merge pull request #38485 from obsidiansystems/nixos-nixpkgs-options
nixpkgs module: Clean up platform options
2018-04-19 14:59:58 -04:00
John Wiegley 4cfdcedb71 Fix a typo: types.openSignifiantByte -> types.openSignificantByte 2018-04-13 18:41:53 -07:00
John Ericson c6f7d43678 nixpkgs module: Clean up platform options
- `localSystem` is added, it strictly supercedes system

 - `crossSystem`'s description mentions `localSystem` (and vice versa).

 - No more weird special casing I don't even understand

TEMP
2018-04-06 12:41:44 -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
Shea Levy 20f51922c0
riscv-pk: Set platforms properly 2018-03-24 08:44:26 -04:00
John Ericson d9a1800239 lib: Add lib.platforms.windows 2018-03-20 12:47:45 -04:00
John Ericson 3c8ae01a45 lib: Make platforms.all actually match all platforms
Otherwise obscure cross-compilations are hampered. `all` breaks all but
the initial derivation (which we can't even write yet) in an open world
setting however, so we really shouldn't have it.
2018-03-20 12:46:19 -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 c26252af3e lib, stdenv: Check meta.platforms against host platform and be open world
First, we need check against the host platform, not the build platform.
That's simple enough.

Second, we move away from exahustive finite case analysis (i.e.
exhaustively listing all platforms the package builds on). That only
work in a closed-world setting, where we know all platforms we might
build one. But with cross compilation, we may be building for arbitrary
platforms, So we need fancier filters. This is the closed world to open
world change.

The solution is instead of having a list of systems (strings in the form
"foo-bar"), we have a list of of systems or "patterns", i.e. attributes
that partially match the output of the parsers in `lib.systems.parse`.
The "check meta" logic treats the systems strings as an exact whitelist
just as before, but treats the patterns as a fuzzy whitelist,
intersecting the actual `hostPlatform` with the pattern and then
checking for equality. (This is done using `matchAttrs`).

The default convenience lists for `meta.platforms` are now changed to be
lists of patterns (usually a single pattern) in
`lib/systems/for-meta.nix` for maximum flexibility under this new
system.

Fixes #30902
2018-03-15 00:44:34 -04:00
John Ericson f79f80dbf2 treewide: get rid of platforms.allBut
Negative reasoning like `allBut` is a bad idea with an open world of
platforms. Concretely, if we add a new, quite different sort of
platform, existing packages with `allBut` will claim they work on it
even though they probably won't.
2018-03-14 18:44:42 -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
John Ericson dfc5d7835d
Merge pull request #35247 from telent/mips32
lib, treewide: Add missing MIPS arches, and fix existing usage
2018-02-27 14:01:15 -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