Commit Graph

129 Commits

Author SHA1 Message Date
Artturin
35e5943d69 lib.systems: throw if sdkVer or ndkVer are used for android.
Those attrs have been renamed and throwing is the best way to show it,
if we only warned then the user would only get an error like this `error: Unsupported sdk: 33`
from `pkgs/top-level/darwin-packages.nix`.

If someone wants to support multiple NixOS versions then they can simply
set both attrs. (`!args ? androidSdkVersion` is for that)
2024-07-25 23:49:18 +03:00
Artturin
1144d46f95 treewide: Rename android sdkVer and ndkVer
`sdkVer` conflicts with the old `sdkVer`(now `darwinSdkVersion` but that still uses `sdkVer` if set) used by darwin

This shouldn't be an issue but due to `pkgs/development/interpreters/python/cpython/default.nix`
running `lib.filterAttrs (n: v: ! lib.isDerivation v && n != "passthruFun")` on it's inputs (2 of them are darwin only)
the `throw "Unsupported sdk...` in `pkgs/top-level/darwin-packages.nix` will be triggered.

After this change `pkgsCross.armv7a-android-prebuilt.python3.pythonOnBuildForHost` won't fail with
`error: Unsupported sdk: 33`

Issue was bisected to 3cb23cec23
2024-07-25 22:08:49 +03:00
Florian Klink
641b2f29b6
Merge pull request #319153 from Kranzes/buildRustCrate-wasm
buildRustCrate: add support for compiling to wasm32-unknown-unknown
2024-06-30 14:05:33 +03:00
Ilan Joselevich
957116419d
lib.systems.examples: add wasm32-unknown-none
This system was added to use the nixpkgs cross compilation logic when
compiling to wasm32-unknown-unknown in rust.
2024-06-24 19:27:13 +03:00
Marie Ramlow
56d1e7a41b lib.systems.examples: update default android sdk to 33, ndk to 26 2024-06-17 09:53:31 +02:00
Florian Klink
50261c0602 config.rust: update references from rustc
`rustc.config` is called `rust.rustcTarget` now, and
`{rustc -> rust}.platform`.

This is the new way (tm), and is preferred since
https://github.com/NixOS/nixpkgs/pull/271707 -
though the documentation still is outdated, and some expressions in
nixpkgs were using the old interface.

This updates both.
2024-06-13 21:08:48 +03:00
Ali Abrar
888dee445d openbsd: init at 7.5 2024-05-26 10:55:56 -04:00
John Ericson
266cdd7d37 treewide: freebsd13 -> freebsd
Co-authored-by: Alyssa Ross <hi@alyssa.is>
2024-04-30 18:20:23 -04:00
Jared Baur
6421226aa5 lib/systems: add microblaze-embedded
Adds a new target for `pkgsCross` that can be used for building
freestanding code for microblaze targets (e.g. Xilinx PMU firmware).
2024-04-24 19:45:58 -07:00
Adam Joseph
72c279f477 lib.systems, test.cross.sanity: add test case for #264989
We have several cross-compilation bugs that show up if
hostPlatform!=buildPlatform yet
hostPlatform.config==buildPlatform.config.

These bugs have appeared and disappeared as we've fiddled with the
definition of equality for platform objects.  This commit adds a
clear-cut case where they are *not* equal and never will be, so we
can test it.
2023-11-04 05:57:34 +00:00
Artturi
6f300706ef
Merge pull request #247077 from jmbaur/aarch64-embedded-rustc 2023-09-23 06:30:47 +03:00
Moritz Angermann
1e0561d78a nixpkgs/systems: Add ucrt64 as MinGW libc
The Minimalist Gnu for Windows distribution comes with support for
the traditional msvcrt libc, as well as ucrt64 libc. The latter
being the newer universal compiler runtime. We follow the msys2
environment naming convention[1]:

| name       | toolchain | arch    | libc   | libc++    |
|------------|-----------|---------|--------|-----------|
| mingw32    | gcc       | i686    | msvcrt | libstdc++ |
| mingw64    | gcc       | x86_64  | msvcrt | libstdc++ |
| ucrt64     | gcc       | x86_64  | ucrt   | libstdc++ |
| clang32    | llvm      | i686    | ucrt   | libc++    |
| clang64    | llvm      | x86_64  | ucrt   | libc++    |
| clangarm64 | llvm      | aarch64 | ucrt   | libc++    |

For now nixpkgs only supports the first three with this commit.

--
[1]: https://www.msys2.org/docs/environments/
2023-09-08 10:56:08 +00:00
Jared Baur
aca7042069
lib/systems: Add rustc config for aarch64-embedded
The target aarch64-none-elf is not a valid rustc target, use
aarch64-unknown-none instead.
2023-08-03 23:35:38 -07:00
Markus Theil
f6f0ccd6c9 lib.systems.bluefield2: init
Add support for Nvidia's Bluefield 2 plattform as a compilation
target. There exists a version with and without crypto support,
while the crypto supported version is the most common one.

Support for the non-crypto version can be easily added in the future,
if needed.

For a datasheet of the hardware, see:

https://www.nvidia.com/content/dam/en-zz/Solutions/Data-Center/documents/datasheet-nvidia-bluefield-2-dpu.pdf

Signed-off-by: Markus Theil <theil.markus@gmail.com>
2023-07-14 11:19:11 +02:00
Ryan Burns
c8ae88d97b lib.platforms.mips{,64}-embedded: init 2023-06-30 18:19:00 -07:00
Alyssa Ross
94d9a6ce17 lib.systems: remove mipsisa(32|64)r6 triples
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-06-01 10:42:27 +00:00
Weijia Wang
1348f199a5 lib/systems: move loongarch64-linux out of mips block 2023-05-04 09:52:01 +03:00
jackyliu16
edcad332d9 lib.platforms.loongarch64: init 2023-04-27 20:04:30 +03:00
sternenseemann
471b9cab41 haskell.compiler.ghcHEAD: 9.7.20221224 -> 9.7.20230217
- 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":
  6636b67023

  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:
  e987e345c8
2023-03-08 17:12:18 +01:00
John Ericson
66aa02f190 lib/systems: Support FreeBSD
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-11-04 16:49:28 -04:00
John Ericson
f172d86a4e lib/systems: Simplify NetBSD examples
The libc will be inferred.
2022-11-04 16:49:28 -04:00
Minijackson
cdb0f02a36 lib/systems/examples: use provided ABIs in PPC64 triple 2022-08-28 21:46:44 +02:00
Rick van Schijndel
9532db9eb7
Merge pull request #160554 from Cloudef/android-prebuilt
Fix android prebuilt toolchains
2022-07-18 10:01:00 +02:00
Alyssa Ross
e8d7d52fae lib.systems.examples: canonicalize MIPS triples
In Nixpkgs, we assume that the "config" field is a canonicalized GNU
triple.  I noticed that non-canonical values were being used here,
because the pkgsCross.mips64el-linux-gnu triples did not contain the
vendor field, but the pkgsCross.mips64el-linux-gnu.pkgsStatic did.

Here, I've run all the MIPS triples in lib.systems.examples through
config.sub to canonicalize them.  I think this will avoid nasty
surprises in future.

Tested by building Nix and the bootstrap files for
pkgsCross.mips64el-linux-gnu.
2022-07-03 23:01:21 +00:00
Jari Vetoniemi
2a914f022c update android targets to recommended ones 2022-06-29 18:27:16 +09:00
Alyssa Ross
74562a214e
lib.systems.amd64-netbsd: remove
This has been deprecated for a long time, and it's doubtful it had any
users to start with.  And having an undisablable warning when
enumarating platforms is not good.
2022-06-08 17:14:05 +00:00
Alyssa Ross
089ff89f49
lib.systems: drop scaleway-c1
These servers apparently no longer exist, since September 2, 2021[1].
If somebody needs this for non-Scaleway machines, they should suggest
its reintroduction with a different name.

[1]: https://news.ycombinator.com/item?id=27192757
2022-05-27 12:02:39 +00:00
yvt
bf139d83ec
systems: support cross-compiling for Renesas RX microcontrollers (#173858) 2022-05-22 20:52:36 -04:00
Adam Joseph
ff69b8c2bf Ericson2314's suggestion here: https://github.com/NixOS/nixpkgs/pull/161158#discussion_r822295406 2022-03-10 20:30:19 -08:00
Adam Joseph
ed4fa55fc3 comment: explain why gnuabi64 has a rustc.config but gnuabin32 does not. 2022-03-10 20:30:18 -08:00
Adam Joseph
12371a51e6 lib/systems: add mips64el definitions
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-10 20:30:16 -08:00
Jörg Thalheim
a8c277c8a8 pkgsCross.x86_64-netbsd-llvm: mark as broken 2021-12-09 23:08:40 +01:00
Jonathan Ringer
dbe6e96d0a
lib/systems: add x86_64-darwin hostPlatform 2021-11-10 11:37:34 -08:00
Sergei Trofimovich
34e468dc42 lib/systems: add minimal s390x-linux cross-compile support
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-09-09 10:58:47 +00:00
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
Moritz Angermann
3a3df3146e Add crossPkgs.aarch64-darwin 2021-05-17 00:27:02 +09:00
s1341
1e1d29c2af treewide: Support aarch64-android using minimal prebuilt components
This PR adds a new aarch64 android toolchain, which leverages the
existing crossSystem infrastructure and LLVM builders to generate a
working toolchain with minimal prebuilt components.

The only thing that is prebuilt is the bionic libc. This is because it
is practically impossible to compile bionic outside of an AOSP tree. I
tried and failed, braver souls may prevail. For now I just grab the
relevant binaries from https://android.googlesource.com/.

I also grab the msm kernel sources from there to generate headers. I've
included a minor patch to the existing kernel-headers derivation in
order to expose an internal function.

Everything else, from binutils up, is using stock code. Many thanks to
@Ericson2314 for his help on this, and for building such a powerful
system in the first place!

One motivation for this is to be able to build a toolchain which will
work on an aarch64 linux machine. To my knowledge, there is no existing
toolchain for an aarch64-linux builder and an aarch64-android target.
2021-05-11 15:39:08 +00:00
github-actions[bot]
9c190d28df
Merge master into staging-next 2021-04-15 12:06:13 +00:00
Alyssa Ross
9767460d00 lib.systems.examples.amd64-netbsd: add warning
Otherwise, nobody will know it's deprecated!
2021-04-15 10:45:04 +00:00
github-actions[bot]
8b35f0c117
Merge master into staging-next 2021-04-15 06:05:40 +00:00
John Ericson
a2650e1257 lib: Adjust NetBSD example systems
Deprecate the odd one so no breaking change.
2021-04-15 04:38:17 +00:00
Luke Granger-Brown
08b22e605b Merge remote-tracking branch 'upstream/staging-next' into down-integrate-staging 2021-04-12 18:49:01 +00:00
Sandro
9f198c1423
Merge pull request #116495 from r-burns/ppc64
lib/systems: remove powerpc64 elfv1 support
2021-04-12 16:44:14 +02:00
Andrew Childs
d0418480f1 lib.systems: add darwinPlatform where necessary 2021-04-11 09:47:10 +09:00
Milan Pässler
5f7aa7a973 systems: add appropriate rustc.config for android
Rust doesn't like the `-unknown` vendor component in the target triple.
2021-04-09 12:09:06 +02:00
Ryan Burns
8ea1660b9e lib/systems: remove powerpc64 elfv1 support
I was specifying the ELF ABI using -elfv1 and -elfv2 target config
suffixes, which are nonstandard and no longer work with gnu-config.
2021-03-15 19:27:41 -07:00
John Ericson
5fc5e83808
Merge pull request #111345 from r-burns/ppc64-big-endian
Enable PPC64 (big-endian)
2021-01-30 16:26:06 -05:00
Ryan Burns
72b3badb61 lib.systems: add powerpc64-linux
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.
2021-01-30 12:34:24 -08:00
Alexander Foremny
75e2f7ce63 gcc: fix armhf target
Fixes #96921
2021-01-29 10:48:23 +01:00