Commit Graph

647 Commits

Author SHA1 Message Date
Eman Resu
590d99ed5f lib/systems: remove old isCompatible 2026-04-26 22:14:48 -04:00
Ben Siraphob
0f420e96c4 gcc, libgcc: fix cross-compilation for SH4
- Pass --with-multilib-list=m4,m4-nofpu for SH4 so the kernel can use
  -m4-nofpu. Move libraries out of !m4/ multilib subdirectory in
  postInstall before moveToOutput.
- Generate sysroot-suffix.h for SH4 in the standalone libgcc builder.
- Add linux-kernel.target = "vmlinux" and installTarget for SH4.

All changes scoped to isSh4 to avoid rebuilds on other platforms.
2026-04-20 13:02:20 -07:00
Ben Siraphob
0fcb031c25 lib/systems: add SH4 (SuperH) cross-compilation target
Add sh4 CPU type (32-bit, little-endian, family "sh"), isSh4 predicate,
"sh4-linux" system double, cross-compilation example (sh4-unknown-linux-gnu),
linuxArch mapping to "sh", and test entry.
2026-04-20 13:02:20 -07:00
Alyssa Ross
7251a763b7 lib/systems: fix incorrect CPU compatibility claims in isCompatible (#509796) 2026-04-19 09:44:23 +00:00
Ben Siraphob
6152e8cbfa lib/systems: add ARC (Synopsys DesignWare ARC) cross-compilation support
Add arc CPU type (32-bit, little-endian, family "arc"), isArc
predicate, arc-linux double, arc cross example with
arc-unknown-linux-gnu triple, and release-cross job.

ARC has glibc support and uses the "arc" Linux kernel arch, which
matches the CPU name so no explicit linuxArch mapping is needed.
2026-04-14 13:51:11 -07:00
Ben Siraphob
34109687c7 lib/systems: fix incorrect CPU compatibility claims in isCompatible
Fix several incorrect backward-compatibility claims in the isCompatible
relation that do not reflect actual hardware/spec capabilities.

- armv6m: Reverse direction. ARMv6-M (Cortex-M0) is Thumb-only and
  cannot run full ARMv6 ARM-state code; armv6m code runs on armv6l.
  https://developer.arm.com/documentation/ddi0432/latest/programmers-model/instruction-set-summary

- armv7m: ARMv7-M (Cortex-M3/M4) is Thumb-2 only, cannot run ARM-state
  armv7l code. armv7a/armv7r (which have ARM-state) can run armv7m code.
  https://developer.arm.com/documentation/ddi0403/d/Application-Level-Architecture/The-ARMv7-M-Instruction-Set/About-the-instruction-set

- armv8m: Remove armv8m->armv8a. ARMv8-M is Thumb-only M-profile with
  incompatible system registers and exception model.

- aarch64<->armv8a: Remove bidirectional equivalence. AArch32 cannot
  execute A64 instructions. Keep one-directional aarch64->armv8a only.
  https://developer.arm.com/documentation/dui0801/b/BABBDFIH

- armv8r: Remove armv8r->armv8a (and by extension armv8r->aarch64).
  ARMv8-R is a different profile with MPU (not MMU), a different
  exception model, and profile-specific instructions.

- riscv32->riscv64: Remove. RV64 has no standard RV32 compat mode;
  identical encodings behave differently at XLEN=32 vs XLEN=64.
  https://docs.riscv.org/reference/isa/unpriv/rv64.html

- wasm32->wasm64: Remove. Separate spec targets with different address
  types (i32 vs i64); a wasm64 runtime does not accept wasm32 modules.
  https://github.com/WebAssembly/spec/blob/wasm-3.0/proposals/memory64/Overview.md
2026-04-13 19:26:18 -07:00
zimbatm
03b9d66f3d lib.systems.equals: use lib imports instead of builtins
Use lib.filter and lib.attrNames instead of builtins.* directly,
consistent with the rest of the file's style.

Follow-up to #506588, incorporating review feedback from #507232.
2026-04-06 18:53:16 +02:00
zimbatm
878a387240 lib.systems.equals: optimize removeFunctions
Replace filterAttrs + lib.isFunction with removeAttrs + builtins.filter
+ builtins.isFunction. System attrs are never __functor-style attrsets,
so lib.isFunction's wrapper is unnecessary overhead. The double negation
(!pred ∘ !isFunction) also cancels out.

NIX_SHOW_STATS delta on hello.drvPath:

  nrFunctionCalls:  229,883 -> 154,411   (-32.8%)
  envs.number:      250,215 -> 174,743   (-30.2%)
  envs.bytes:         4.6M -> 3.4M       (-26.4%)
  nrAvoided:        291,314 -> 216,054   (-25.8%)
  gc.totalBytes:     49.7M -> 48.5M      (-2.4%)

Repro:

  NIX_SHOW_STATS=1 nix-instantiate --eval \
    -E '(import ./. {}).hello.drvPath' 2>stats.json >/dev/null
  jq . stats.json
2026-04-04 14:19:54 +02:00
Emily
c9fd2f4d87 lib/systems: remove redundant conditional 2026-03-29 09:07:03 +10:00
Amaan Qureshi
e0801cae76 lib/systems: fix qemuArch for aarch64_be
`qemuArch` returned "aarch64" for both LE and BE, causing binfmt to
register `qemu-aarch64` for `aarch64_be` binaries. QEMU ships separate
`qemu-aarch64` and `qemu-aarch64_be` binaries, so the wrong interpreter
was used, failing with "Invalid ELF image for this architecture".

Since QEMU distinguishes endianness in the binary name, this adds the
"_be" suffix via `isBigEndian`, which is similar to the approach MIPS 
uses a few lines below.
2026-03-16 23:49:50 -04:00
Alyssa Ross
bd0c7ad05a lib.systems: rust: Make rustcTargetSpec the primary entrypoint (#446668) 2026-03-07 08:22:44 +00:00
Tobias Mayer
4c05f197e6 lib.systems: s/makeMuslParsedPlatform/mkMuslSystem/ 2026-03-06 23:38:09 +01:00
Tristan Ross
3faec18180 lib.systems: expose makeMuslParsedPlatform (#490520) 2026-03-06 16:37:06 +00:00
İlkecan Bozdoğan
6acae46c84 lib: don't inherit unused functions 2026-03-04 00:10:00 +03:00
İlkecan Bozdoğan
e394a579b0 lib: update type signatures
- concrete types start with uppercase: Int, String, Bool, Derivation,
  etc.
- type variables start with lowercase: a, b, etc.
- list:
  - use `[x]` for homogeneous lists instead of `List x` or `[ x ]`
  - use `List` for heterogeneous lists (not that common in `lib`)
- attr:
  - use `AttrSet` for a generic attribute set type
  - use `{ key1 :: Type1; key2 :: Type2; ... }` for adding signatures
    for known attribute names and types
  - use `{ key1 = value1; key2 = value2; ... }` for adding attributes
    with known literals
  - end with an ellipsis (`...`) if the set can contain unknown
    attributes
  - use `{ [String] :: x }` if all the attributes has the same type `x`
- prefer `Any` over `a` if the latter is not reused
2026-03-04 00:10:00 +03:00
John Ericson
704e1a5c16 lib.systems: add uefi support (#477645) 2026-03-02 05:32:37 +00:00
dramforever
60ac986e49 lib.systems: rust: Make rustcTargetSpec the primary entrypoint
Make rustcTargetSpec the primary entrypoint for setting a custom target,
and wire up all the other stuff so they are hopefully as working and as
broken as before.

In particular, to specify a custom target, the user now just specifies
rust.rustcTargetSpec. rust.platform and rust.cargoShortTarget are
populated from rust.rustcTargetSpec now. In addition, rust.rustcTarget
defaults to rust.cargoShortTarget. (rust.rustcTarget and
rust.cargoShortTarget really should always be the same, but I think we
can deal with that later).

This allows the user to more easily control the basename of
rust.rustcTargetSpec by passing e.g.
"${./rust}/mips64el_mips3-unknown-linux-gnuabi64.json", which allows
cc-rs and in turn std to work.
2026-02-27 13:34:31 +08:00
dramforever
550a1b8eb5 lib.systems: Refactor rust.platform generation
In preparation for a future commit, refactor rust.platform somewhat.

No functional changes intended. Most of the diff here is whitespace
changes.
2026-02-25 11:18:23 +08:00
Tobias Mayer
4cd3967a68 lib.systems: expose makeMuslParsedPlatform
Moving this helper from pkgs/stdenv/stage.nix so it can be used
for alternative variations of pkgsMusl and pkgsStatic.
2026-02-14 23:09:33 +01:00
Alexandre Esteves
4255fb08c9 lib.systems: fix path to wine executable 2026-02-10 20:16:44 +00:00
Alyssa Ross
95c8d1ec1e lib/systems/platforms: Add ppc64; linux: Add 64-bit POWER settings, strip vmlinux kernels (#447752) 2026-02-02 12:10:28 +00:00
Theo Paris
9f605ca95e lib.systems: add uefi support
Signed-off-by: Theo Paris <theo@theoparis.com>
Change-Id: I51ce15449fc83f0ff39277d7cde7b34a6a6a6964

lib.systems: remove i686-uefi
2026-01-25 21:59:21 -08:00
Alexandre Esteves
03a5813e98 lib/systems: Add nodejs as emulator for pkgsCross.ghcjs 2026-01-25 23:16:19 +00:00
OPNA2608
2a6945e553 lib/systems/platforms: Drop powernv extraConfig
Settings are covered by ppc64 changes in common-config.
2026-01-22 15:41:33 +01:00
OPNA2608
3e6bae2fa4 lib/systems/platforms: Add ppc64 2026-01-22 15:40:36 +01:00
nixpkgs-ci[bot]
db8a4e9f0b Merge master into staging-next 2026-01-15 18:09:05 +00:00
John Ericson
3ea6894af1 Add clang64 toolchain to pkgsCross (#450796) 2026-01-15 14:49:16 +00:00
nixpkgs-ci[bot]
95416609f8 Merge master into staging-next 2026-01-13 18:07:18 +00:00
aleksana
38be8c6c9b lib.systems: correct and simplify canExecute condition regarding march 2026-01-13 18:44:51 +08:00
umbrageodotus
7d034687f2 lib.systems.examples: Add LLVM x86-64 UCRT platform and clean up
Co-authored-by: Eveeifyeve <88671402+Eveeifyeve@users.noreply.github.com>
2026-01-12 21:56:05 -05:00
nixpkgs-ci[bot]
02cebb4644 Merge staging-next into staging 2026-01-06 18:07:38 +00:00
Sandro Jäckel
2459f7a596 platforms: drop REISERFS_FS 2026-01-03 04:37:48 +01:00
Alessandro Di Federico
90b59828be uclibc-ng: detect CONFIG_ARM_EABI from platform
This commit introduces a `isEabi` predicate for platforms and employs it
to detect whether to configure uclibc with CONFIG_ARM_EABI or not.
2025-12-30 19:05:44 +01:00
David McFarland
3dcf921c7b lib.systems: add isPE 2025-12-05 13:40:49 -04:00
K900
934d11cb78 Merge remote-tracking branch 'origin/staging-next' into staging 2025-11-02 00:50:30 +03:00
Wolfgang Walther
4949737a38 systems/examples: remove x86_64-unknown-redox
relibc itself has been removed in 2024 already.
2025-10-28 21:54:04 +01:00
nixpkgs-ci[bot]
584512ec5c Merge staging-next into staging 2025-10-25 12:06:42 +00:00
Alyssa Ross
d563aa57de lib.systems.parse: Default glibc ppc64 to ELFv1 ABI (#451088) 2025-10-25 09:57:43 +00:00
OPNA2608
37492033eb lib.systems.parse: Default glibc ppc64 to ELFv1 ABI 2025-10-11 21:00:33 +02:00
OPNA2608
8448c28919 lib.systems.examples.ppc64-elfv1: Drop manual fix of rust.rustcTarget
ABI is now simplified automatically.
2025-10-11 20:57:29 +02:00
OPNA2608
8b06bf875c lib.systems: Simplify ABI on POWER for rust.rustcTarget
Rust does not know how to parse "gnuabielfv{1,2}", so simplify those down to just "gnu".
This obsoletes the manual rustcTarget fix in the ppc64-elfv1 example.
2025-10-11 20:48:52 +02:00
Randy Eckenrode
2ab175889a lib.systems.darwinMinVersion: 11.3 -> 14.0 2025-10-09 18:23:26 -04:00
Randy Eckenrode
cf45eef8ec lib.systems.darwinSdkVersion: 11.3 -> 14.4 2025-10-09 18:23:26 -04:00
Philip Taron
44998896c6 lib: remove optional builtins prefixes from prelude functions (#447402) 2025-09-30 16:28:04 +00:00
NAHO
6177c4ad72 lib: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd --type file . lib --exec-batch sed --in-place --regexp-extended "
      s/\<builtins\.($(
        printf '%s\n' "${builtins[@]}" |
          paste --delimiter '|' --serial -
      ))\>/\1/g
    "

    nix fmt
2025-09-30 09:02:59 +02:00
David McFarland
39fd8e4adf cygwin: init as a target toolchain
The old cygwin support used -pc-windows-cygnus as the config.  This is
supported by LLVM, but not by GNU. This will change it to -pc-cygwin,
which is more generally supported.

Because the kernel is now 'cygwin' rather than 'windows', isWindows will
return false. There are lots of different reasons isWindows is used in
nixpkgs, but in my experience they often have to do with posix
compatibility and don't apply to cygwin.

Co-authored-by: Brian McKenna <brian@brianmckenna.org>
2025-09-27 13:29:44 -03:00
Marie Ramlow
b6d48619ed lib.systems: add ppc32 target 2025-09-10 08:15:07 +02:00
Fabián Heredia Montiel
0e9af74ced Merge remote-tracking branch 'origin/master' into staging-next 2025-08-18 22:43:58 -06:00
Emily
6e959288bb lib.systems.examples: bump Android SDK and NDK
Per <https://github.com/android/ndk/wiki>, NDK 26 is EOL.
2025-08-18 16:52:14 +01:00
nixpkgs-ci[bot]
c0dd2454fa Merge staging-next into staging 2025-08-01 00:21:45 +00:00