Nix Packages collection & NixOS
  • Nix 95%
  • Shell 2%
  • Python 1.8%
  • Rust 0.3%
  • JavaScript 0.2%
  • Other 0.4%
Find a file
Sergei Zimmerman c87a95cbd3
cc-wrapper: enable tlsdesc on i686, x86_64 linux
TLSDESC is a more performant way of doing TLS, since it has a custom
calling convention that does not require the caller (of what's usually
__tls_get_addr) to spill clobbered registers and assumes that the callee
preserves all registers.

This adds corresponding plumbing in the machineFlags in the cc-wrapper
that includes version gates for compilers. TLSDESC needs to be supported
by the bintools and libc, so I've only enabled it for architectures that
our packaged glibc, musl, GNU binutils support (x86, x86_64).
We package a lot of LLVM versions and support for -mtls-dialect in the
Clang driver has only landed in LLVM 19, so a version check is added
there too.

Ideally we'd set the default at GCC build-time, but LLVM lacks such an
option, so we'd have to keep it in the compiler wrapper for now.

Gentoo is already building with it by default [1], as is Fedora [2].

In glibc < 2.40 [3] there existed a bug with not all registers being
preserved, but it has since been resolved. x86 support has existed
since basically forever with LLVM adding support in LLVM >= 19.1.
LoongArch support has been added recently too, but it's only available
since musl 1.2.6 while we are stuck at 1.2.5 for now, so I haven't dug
deeper. Aarch64 uses TLSDESC by default already.

The support status on non-Linux is a bit unclear, so these defaults are
scoped only to linux targets.

Sadly RISC-V support is still cooking apparently [4].

See: https://maskray.me/blog/2021-02-14-all-about-thread-local-storage
See: https://groups.google.com/g/x86-64-abi/c/0tjmaQx6nZ0

[1]: 46191b478e
[2]: https://src.fedoraproject.org/rpms/gcc/c/8f8d2ea9c326784bce044ff86547107611dda338?branch=rawhide
[3]: https://sourceware.org/bugzilla/show_bug.cgi?id=31372
[4]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/494
2026-05-28 23:38:43 +03:00
.devcontainer .devcontainer: update devcontainer image version to 5-linux 2026-03-24 06:49:43 +00:00
.github treewide: update nix-darwin link 2026-05-27 20:26:42 +02:00
ci zellijPlugins: init (#511825) 2026-05-27 06:08:40 +00:00
doc requireFile: set unfree license by default (#515536) 2026-05-28 00:06:54 +00:00
lib python3Packages.emmiai-noether: init at 2026.4.0 (#525203) 2026-05-28 16:28:27 +00:00
maintainers maintainers: drop sjmackenzie (#520897) 2026-05-28 14:47:20 +00:00
modules Reapply "ci: module maintainer review requests; nixos/modules: init meta.teams" 2026-03-13 16:53:28 +01:00
nixos Merge staging-next into staging 2026-05-28 18:54:19 +00:00
pkgs cc-wrapper: enable tlsdesc on i686, x86_64 linux 2026-05-28 23:38:43 +03:00
.editorconfig .editorconfig: don't force final newline for JSON 2026-01-16 01:45:43 +01:00
.git-blame-ignore-revs .git-blame-ignore-revs: add nixfmt 1.2.0 commit 2026-01-22 19:00:19 -03:00
.gitattributes .gitattributes: update lock file attributes 2026-05-01 13:03:52 +02:00
.gitignore
.mailmap mailmap: map NAHO developer identity to Noah Biewesch 2026-05-12 23:23:53 +02:00
.version
CONTRIBUTING.md CONTRIBUTING.md: establish initial automation/AI/LLM policy 2026-05-11 23:12:40 +01:00
COPYING
default.nix
flake.nix nixos/filesystems: Remove default = "auto" from fsType 2026-04-05 19:06:28 -04:00
README.md treewide: fix typos 2026-01-13 14:45:11 -05:00
shell.nix

NixOS logo

Contributors badge Open Collective supporters

Nixpkgs is a collection of over 120,000 software packages that can be installed with the Nix package manager. It also implements NixOS, a purely-functional Linux distribution.

Manuals

  • NixOS Manual - how to install, configure, and maintain a purely-functional Linux distribution
  • Nixpkgs Manual - contributing to Nixpkgs and using programming-language-specific Nix expressions
  • Nix Package Manager Manual - how to write Nix expressions (programs), and how to use Nix command line tools

Community

Other Project Repositories

The sources of all official Nix-related projects are in the NixOS organization on GitHub. Here are some of the main ones:

Continuous Integration and Distribution

Nixpkgs and NixOS are built and tested by our continuous integration system, Hydra.

Artifacts successfully built with Hydra are published to cache at https://cache.nixos.org/. When successful build and test criteria are met, the Nixpkgs expressions are distributed via Nix channels.

Contributing

Nixpkgs is among the most active projects on GitHub. While thousands of open issues and pull requests might seem like a lot at first, it helps to consider it in the context of the scope of the project. Nixpkgs describes how to build tens of thousands of pieces of software and implements a Linux distribution. The GitHub Insights page gives a sense of the project activity.

Community contributions are always welcome through GitHub Issues and Pull Requests.

For more information about contributing to the project, please visit the contributing page.

Donations

The infrastructure for NixOS and related projects is maintained by a nonprofit organization, the NixOS Foundation. To ensure the continuity and expansion of the NixOS infrastructure, we are looking for donations to our organization.

You can donate to the NixOS Foundation through SEPA bank transfers or by using Open Collective:

License

Nixpkgs is licensed under the MIT License.

Note

MIT license does not apply to the packages built by Nixpkgs, merely to the files in this repository (the Nix expressions, build scripts, NixOS modules, etc.). It also might not apply to patches included in Nixpkgs, which may be derivative works of the packages to which they apply. The aforementioned artifacts are all covered by the licenses of the respective packages.