218 Commits

Author SHA1 Message Date
zinzilulo 481208bdff cc-wrapper, gcc, gnat, gnat-bootstrap: fix GCC 13 and GNAT 13/14/15 builds on darwin 2026-05-27 18:35:39 +01:00
Eman Resu 5f7ff1085a gcc: pass result of lib.systems.equals around rather than recomputing 2026-05-11 19:27:43 -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
Alexander Bantyev 2839911e81 various: add security-review team as a maintainer
Adds the @NixOS/security-review team as a maintainer to multiple
packages deemed to be important security-wise.

For the motivation of the package list, see:
https://github.com/NixOS/nixpkgs/issues/494349#issuecomment-4005099033
2026-03-05 15:19:44 +01:00
John Ericson 5a2694bcf3 cygwin-dll-link: improvements from testing on native cygwin (#476301) 2026-02-19 15:59:06 +00:00
Alexander Bantyev 22ca96f3a9 various: add meta.identifier.cpeParts to a batch of packages
Co-Authored-By: Silvan Mosberger <silvan.mosberger@tweag.io>
2026-02-16 17:11:52 +01:00
David McFarland f2ac4eef52 gcc: move cygwin DLLs to $target/bin 2026-02-08 19:47:26 -04:00
nixpkgs-ci[bot] c3d339e54c Merge master into staging-next 2026-01-14 00:19:10 +00:00
David McFarland cde2dbab81 gcc: fix cygwin build 2026-01-13 13:16:01 -04:00
lzcunt cd3604f63a gcc: reconfigure build system
Split from #371092.

See <https://github.com/NixOS/nixpkgs/pull/371092/files#r2401287986> and
<https://wiki.debian.org/Autoreconf> for some rationale.

Co-Authored-By: Arsen Arsenović <arsen@aarsen.me>
2026-01-06 00:56:31 +03:00
K900 e93c560b79 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-05 12:17:08 +03:00
Wolfgang Walther c283f32d29 treewide: remove unused with
Auto-fixed by nixf-diagnose.
2025-10-05 10:50:41 +02:00
K900 4999ae577c Merge remote-tracking branch 'origin/master' into staging-next 2025-09-30 21:47:55 +03:00
David McFarland c5d92e0dbf gcc: disable libssp on cygwin 2025-09-27 21:21:48 -03:00
David McFarland bff4b038d8 gcc: disable libgcc output on cygwin 2025-09-27 13:33:44 -03:00
David McFarland 1bc4449ff6 gcc: add w32api target flags 2025-09-27 13:33:44 -03:00
nixpkgs-ci[bot] 6ec57b45c7 Merge staging-next into staging 2025-09-15 16:09:34 +00:00
Yuriy Taraday dd12290517 Reapply "stdenv: Add CPE fields to meta"
This reverts commit de74f9caf0.
2025-09-15 17:25:11 +02:00
Emily 411faf46e2 gcc: build with --enable-default-pie configure option (#439314) 2025-09-13 18:21:26 +01:00
Luna Nova ccc56d1a79 gcc: build with --enable-default-pie configure option
Rather than implementing this at the wrapper level (which has been
attempted but not merged in # 252310 and # 205031), configuring GCC
directly with --enable-default-pie is simple and matches mainstream
distribution practices. Packages that cannot build with PIE can
explicitly pass -no-pie when needed, and mostly already do
due to the prevalence of GCCs built with this flag.

Requires followup to decide what to do with "pie" flag.
2025-09-13 10:15:36 -07:00
Marie Ramlow 69cde4d543 gcc: fix powerpc-linux cross compilers 2025-09-10 08:15:07 +02:00
K900 de74f9caf0 Revert "stdenv: Add CPE fields to meta" 2025-08-30 09:29:43 +03:00
Yuriy Taraday b0ce3dc09f stdenv: Add CPE fields to meta
Add `identifiers` attr to `meta` attribute with following attrs:
* `cpe` with the full CPE string when available
* `possibleCPEs` with the list of potential CPEs when not all
  information is provided
* `cpeParts` with the destructured CPE string, allowing to override it
  whenever needed
* `v1` attribute set with `cpe` and `cpeParts` from above and a
  guarantee of a backwards-compatible interface

Related issue: https://github.com/NixOS/nixpkgs/issues/354012
2025-08-29 15:40:03 +02:00
K900 e9a7500b70 Merge remote-tracking branch 'origin/master' into staging-next 2025-08-23 09:24:59 +03:00
Emily f3186c5958 {gcc12,gfortran12,gccgo12,gnat12,gnat-bootstrap12}: drop
EOL as of July; no longer used in the tree.
2025-08-22 23:01:59 +01:00
Emily b5a4a0a6cc {gdc,gdmd}: drop
GDC 11 was the last version that could bootstrap without a D compiler,
and GDC don’t offer their own binaries any more. GCC 11 is now
end‐of‐life and being removed (as is GCC 12, even).

It’s possible that we could use another distribution’s binary
packages to bootstrap this, or go via our DMD package (it’s
apparently not possible to bootstrap GDC with LDC, but I’m not sure
about DMD), but as nobody has worked on it in the three years since
GCC 12 came out, it seems like interest is limited, and it’s more
of a yak shave than I’m up for right now.

A full from‐source bootstrap chain would of course be nice, but is
more the realm of the minimal bootstrap work than something we’d
want to keep GCC 11 around in the main package set indefinitely for.
2025-08-22 23:01:59 +01:00
Emily 4e7ee62b94 {gcc10,gfortran10}: drop
EOL since 2023; no longer used in the tree.
2025-08-22 23:01:59 +01:00
Emily 2a196a7278 {gcc9,gfortran9}: drop
EOL since 2022; no longer used in the tree.
2025-08-22 23:01:59 +01:00
Emily 18bf03bc48 gcc: pass -Wno-complain-wrong-lang when using -fmacro-prefix-map
This will break GCC < 13 when compiled with LLVM, but those versions
are EOL and should be removed anyway, so I’m happy to do the nudge
rather than spend more effort on this hopefully‐temporary hack.
2025-08-08 17:48:58 +01:00
Emily 4401eb4b3b sanitiseHeaderPathsHook: drop
This is now handled by the compiler wrapper.

I have verified that `webkitgtk_6_0` still has no GCC dependency on
`aarch64-linux`, and that `watchman` doesn’t pull in any `dev`
outputs on `aarch64-darwin`.

Closes: #424844
Closes: #426934
Closes: #427475
Closes: #428546
2025-07-31 16:39:48 +01:00
Tristan Ross a155990361 gcc-unwrapped: set main program 2025-07-28 00:08:36 -07:00
Wolfgang Walther 5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
sanana 066da58d3a gccWithoutTargetLibc: disable features that require a libc
Missing these weren't causing any issues because they only require
headers, and gcc was likely using newlib headers. However, these
features must be disabled for `libc = null;` to work properly.
2025-07-20 10:24:38 +02:00
Emily 1c2dfb8de9 gcc: use sanitiseHeaderPathsHook
This reduces the WebKitGTK runtime closure size from 1.45 GiB to
1.22 GiB on `aarch64-linux`, as measured by `nix-tree`.
2025-07-04 12:02:26 +01:00
nixpkgs-ci[bot] f5096bbfa6 Merge master into staging-next 2025-06-02 18:05:37 +00:00
Peder Bergebakken Sundt c77ac9dfc3 treewide: fix typos 2025-06-02 16:07:07 +02:00
Peter Collingbourne ac2c00e10f gcc: stop passing --with-ld when cross compiling
Passing --with-ld causes problems when injecting a custom linker
wrapper (similar to useMoldLinker) because it causes collect2 to
check the --with-ld path (which is a hardcoded path to the standard
linker wrapper) before $PATH, whereas with custom linker wrappers we
want gcc to search $PATH.

Because binutils-wrapper is not guaranteed to be present in $PATH,
prepend it to $PATH in cc-wrapper.

I verified that -print-prog-name=ld still prints an appropriate
value. For example, when cross compiling for x86_64 on an aarch64
machine, the following is printed by the util-linux configure script
(which uses -print-prog-name=ld [1]):

checking for ld used by x86_64-unknown-linux-gnu-gcc... x86_64-unknown-linux-gnu-ld

We still pass --with-as because the gcc spec file relies on this
to find the assembler. This is probably fine for now as it is less
common to want to override the assembler than the linker.

[1] https://sources.debian.org/src/util-linux/2.41-4/m4/lib-ld.m4/?hl=59#L59
2025-04-27 13:52:02 -07:00
K900 f96ac2dcd6 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-26 09:07:48 +03:00
Fernando Rodrigues 05580f4b44 treewide: switch instances of lib.teams.*.members to the new meta.teams attribute
Follow-up to #394797.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
2025-04-25 22:20:17 -03:00
Ihar Hrachyshka dd0f03a56c treewide: remove usage of deprecated apple_sdk framework stubs
They are not doing anything right now. This is in preparation for their
complete removal from the tree.

Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.

Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-04-19 20:28:20 -04:00
Sergei Trofimovich 7ee958a270 gcc14: 14-20241116 -> 14.2.1.20250322
`gcc-14.3.0` will likely release around the end of April
(https://gcc.gnu.org/develop.html) which is a bit late for
nixos-25.05 release.

We can update to `gcc-14.3.0` after a branch-off, but let's
make the delca smaller by picking the current snapshot.

While at it:
- fix `flex` dependency propagation and use it for snapshots
- fix `version` to always contain the base version as
  cc-wrapper constructs paths to libraries based in `version`
  attribute

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
2025-04-02 20:34:47 +02:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
K900 7d36ee97e6 Merge remote-tracking branch 'origin/master' into staging-next 2025-03-14 09:56:27 +03:00
Stefan Frijters d8634f992a gcc: appease the formatter 2025-03-13 11:37:08 +01:00
Stefan Frijters be26b135bc gcc: use lib.systems.equals instead of direct equality checking 2025-03-13 11:37:05 +01:00
Stefan Frijters 54849e2fb8 gcc: fix inconsistency in isCross condition
In libgcc.nix, `targetPlatformSlash` is set by checking if hostPlatform == targetPlatform.
In default.nix, `targetConfig` (which is also going to be part of the path) is also set by checking if hostPlatform == targetPlatform.

However, in common.nix, the recently added `isCross` is set by checking if hostPlatform.config == targetPlatform.config.
This means that for platforms like '-nolibc' the paths in common.nix are not set up correctly for libgcc.nix to find and move libgcc_s.so .

Changing isCross to also check hostPlatform == targetPlatform fixes this issue.
2025-03-13 10:52:16 +01:00
K900 2b21c29f9a gcc: remove .la files 2025-03-11 21:07:32 +03:00
K900 a820a1b67b Revert "gcc: disable symlink checks on cross + nolibc for now"
This reverts commit 3fd43d5d74.

The proper fix is now in.
2025-02-08 13:26:15 +03:00
K900 5e2e98f3b7 gcc: document, clean up, undangle install symlink hacks 2025-02-08 13:26:15 +03:00
K900 17c01aad84 gcc: explicitly disallow cross + multilib, extract targetLibDir to variable 2025-02-08 12:07:15 +03:00