Commit Graph

124 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
nixpkgs-ci[bot]
1bd182852d Merge master into staging-next 2026-05-12 07:00:02 +00:00
Eman Resu
5c17c2d6ce gcc: remove unused variables 2026-05-11 19:27:46 -04:00
Eman Resu
5f7ff1085a gcc: pass result of lib.systems.equals around rather than recomputing 2026-05-11 19:27:43 -04:00
Luna Nova
3f38382306 gcc-unwrapped: enable __structuredAttrs
Allows spaces in configure flags. These are necessary for flags like:
- enable-cxx-flags
- with-specs
2026-04-30 15:06:34 -07: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
45df334930 Merge remote-tracking branch 'origin/staging-next' into staging 2025-10-30 12:20:34 +03:00
Luna Nova
0c7e14e688 gcc: disable enableDefaultPie when !hasSharedLibraries
In discussion on #439314 conditionalizing this seemed unnecessary
as pkgsStatic's gcc kept working. However, some less typical
!hasSharedLibraries stdenvs for embedded platforms broke.

It seems simplest to make this conditional on hasSharedLibraries for
now. We may need to revisit this if we want to enable static-pie by
default with gcc spec file changes.
2025-10-16 18:09:55 -07:00
Luna Nova
e7fbed853b treewide: remove usages of obsolete pie hardening flag 2025-10-09 10:13:03 -07:00
K900
e93c560b79 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-05 12:17:08 +03:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02: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
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
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
10ce2b4791 {gcc11,gfortran11,gdc11,gnat11,gnat-bootstrap11}: drop
EOL since 2024; 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
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
5046e89a35 gcc: enable withoutTargetLibc if target libc is null 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
K900
7e4f0fbf9d Merge remote-tracking branch 'origin/master' into staging-next 2025-06-06 21:50:43 +03:00
John Ericson
5c1955ff14 libcCross: Remove!
We have a long-standing goal of nothing with "cross" in its name. This
gets us much closer!
2025-06-05 18:11:07 -04:00
Robert Scott
3f1a00c79d cc-wrapper: add support for strictflexarrays1 & strictflexarrays3 hardening flags
adding strictflexarrays1 to pkgsExtraHardening
2025-05-24 11:10:20 +01: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
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](8616af08d9/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
Sigmanificient
670aba9a64 treewide: remove unused arguments 2025-03-13 18:00:11 +01:00
Stefan Frijters
be26b135bc gcc: use lib.systems.equals instead of direct equality checking 2025-03-13 11:37:05 +01:00
nixpkgs-ci[bot]
05e3582bb7 Merge staging-next into staging 2025-02-24 12:06:31 +00:00
Peder Bergebakken Sundt
5aba99242e treewide: fix typos in comments
Made with

```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
    typos --no-check-filenames --write-changes "$1"
    git diff --exit-code "$1" && exit
    #( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
    count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
    count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
    [[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```

and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`

I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
2025-02-24 10:44:41 +01:00
K900
50319982e0 Revert "libgccjit, gccgo*: remove a reflexive symlink"
This reverts commit c3c1643d8a.

Fixed properly now.
2025-02-08 13:43:37 +03:00
Vladimír Čunát
c3c1643d8a libgccjit, gccgo*: remove a reflexive symlink
https://hydra.nixos.org/build/286689241/nixlog/7/tail
https://hydra.nixos.org/build/287154953/nixlog/1/tail

Feel free to improve this ;-)
2025-01-31 10:11:35 +01:00
Emily
382ef6cd88 Merge staging-next into staging 2024-11-25 02:00:00 +00:00
Emily
86b5f88a2f {gcc8{,Stdenv},gfortran8}: drop
Release branch from 6½ years ago, no update in 3½ years, unsupported
upstream, and unused in tree.

This finally resolves the tangled conditionals in `all.nix`, albeit in
a way I assume amjoseph wouldn’t have been too fond of. `default.nix`
still has some gnarly stuff in there. So it goes…
2024-11-22 18:03:01 +00:00
Emily
d3d474e85c {gcc7{,Stdenv},gfortran7}: drop
Release branch from 7½ years ago, no update in 5 years, unsupported
upstream, and unused in tree.
2024-11-22 18:03:01 +00:00
Emily
0d933223a8 gcc14: 14.2.0 -> 14-20241116
The stable release has too many AArch64 issues, but they seem to
have been fixed upstream; Arch is shipping a Git snapshot. The next
stable release should be out by the time 25.05 is finishing up,
so this should be okay as a temporary solution.

This is the GCC 14-20241116 snapshot. We use that identifier as our
package version, diverging from our usual unstable version convention,
because it identifies itself as “gcc (GCC) 14.2.1 20241116” and
comes in `gcc-14-20241116.tar.xz`; 20241116 is therefore a useful
version identifier to use verbatim, and 14.2.0-unstable-2024-11-16
would potentially be confusing for a version that calls itself
14.2.1. The next stable release from the GCC 14 branch will be 14.3.0,
so there should be no ambiguity here.

Getting this version is a little complicated; we need the precompiled
`flex(1)` output that these Git snapshots don’t include. Thankfully,
the source file hasn’t changed since 14.2.0, so we can simply
download 14.2.0 too and extract the precompiled file. A little
merging finesse is required for the `aarch64-darwin` patch, which we
also upgrade.
2024-11-19 15:13:36 +00:00
piegames
ae207af82b treewide: More string indentation fixes
Follow-up on #350296 with the packages that cause big rebuilds and need
to go through staging.
2024-10-23 21:52:18 +02:00
Randy Eckenrode
e50074418d gcc: set up sysroot for the Darwin SDK
The GCC bootstrap builds each stage with an unwrapped GCC, which needs
to correctly handle looking for libraries and headers in sysroot.
Setting the native header folder to `/usr/include` will actually cause
GCC to search `<sysroot>/usr/include`, which is the SDKROOT in nixpkgs.
2024-10-10 17:04:36 -04:00
Emily
de4388c609 {cc-wrapper,gcc}: drop unused logic and patches 2024-09-15 02:45:00 +01:00
Sergei Trofimovich
88950412bc gcc49, gcc49Stdenv, gfortran49: remove old implementation
gcc-4.9.4 was released in Aug 3, 2016, 8 years ago. It's a branch that
went out of support years ago. Numerous bugs never get backported to
this version.

Let's remove it.
2024-09-12 10:32:19 +01:00
Sergei Trofimovich
1db443abb7 gcc48: remove old implementation
gcc-4.8.5 was released in June 23, 2015, 9 years ago. It's a branch that
went out of support years ago. Numerous bugs never get backported to
this version.

Let's remove it.
2024-09-10 22:05:47 +01:00
github-actions[bot]
e80257fbed Merge master into staging-next 2024-08-07 00:02:22 +00:00
Daniel Nagy
4f85840d25 gcc: provide build support for gccrs
Patches from the gccrs project are being upstreamed into gcc. With
these changes we are now able to build a gcc with rust support like
this:

```nix
wrapCC (gcc14.cc.override {
  langRust = true;
});
```

More info:

https://rust-gcc.github.io/

https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608387.html
2024-08-06 20:26:34 +02:00