Commit graph

1150 commits

Author SHA1 Message Date
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
Peder Bergebakken Sundt
c77ac9dfc3 treewide: fix typos 2025-06-02 16:07:07 +02:00
Sergei Trofimovich
67cc3aa69a gcc15: update patches for 15 version 2025-05-26 07:22:09 +01:00
Vladimír Čunát
de19a6881e
gcc15, gccgo15, gfortran15, gnat15: init at 15.1.0 (#401948) 2025-05-25 09:51:35 +02:00
K900
f96ac2dcd6 Merge remote-tracking branch 'origin/master' into staging-next 2025-04-26 09:07:48 +03:00
Sergei Trofimovich
281c0c16c9 gcc15, gccgo15, gfortran15, gnat15: init at 15.1.0
Changes: https://gcc.gnu.org/gcc-15/changes.html
Porting guide: https://gcc.gnu.org/gcc-15/porting_to.html
2025-04-26 06:22:31 +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
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
Pavol Rusnak
167ef04170
gcc14: fix internal compiler error on aarch64
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118501
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118892
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119133
2025-04-13 19:00:05 +02: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
K900
7d36ee97e6 Merge remote-tracking branch 'origin/master' into staging-next 2025-03-14 09:56:27 +03:00
Sigmanificient
670aba9a64 treewide: remove unused arguments 2025-03-13 18:00:11 +01: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
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
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
K900
536c98cb32
Revert "gcc: rework, clean up, and document the cursed symlink hack" 2025-02-08 11:54:21 +03:00
K900
97a3367a33 Revert "gcc: disable symlink checks on cross + nolibc for now"
This reverts commit 3fd43d5d74.

The proper fix is now in.
2025-02-02 22:12:49 +03:00
K900
c1907fbbf0 gcc: rework, clean up, and document the cursed symlink hack
Fixes dangling symlinks.

Also flips the direction of symlinks on cross
from $lib/$target/lib -> $lib/lib to $lib/lib -> $lib/$target/lib
2025-02-02 22:12:49 +03:00
K900
3fd43d5d74 gcc: disable symlink checks on cross + nolibc for now
This is a hack, but a proper fix requires an stdenv rebuild,
so it will have to go to staging.
2025-02-02 09:47:58 +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
Silvan Mosberger
84d4f874c2 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 78e9caf153
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00
K900
48e92e6898 Merge remote-tracking branch 'origin/staging-next' into staging 2024-11-26 16:27:29 +03:00
Emily
cf71af6176 gcc: restore dropped isl line
I think this was a rebase mishap and causes a ton of rebuilds.

Not sure if we actually need the Darwin condition any more (or to be
using the older `isl` version?), but `master` isn’t the place to
find out :)

Fixes: 90474914ee
2024-11-26 10:07:23 +00:00
github-actions[bot]
9a94a24ad9
Merge staging-next into staging 2024-11-25 14:38:16 +00:00
Emily
39589350f7
treewide: improve prepending and appending derivation arguments in bash code (#357052) 2024-11-25 13:55:41 +00:00
Sergei Trofimovich
90474914ee gcc: do not allow version skew when cross-building gcc
When `gcc` is cross-built (`build` != `target` && `host` == `target`)
`gcc` assumes that it has a compatible cross-compiler in the environment
that can build target libraries. Version of a cross-compiler has to
match the compiler being cross-built as libraries frequently use fresh
compiler features, like `-std=c++26` or target-specific types like
`_Bfloat16`.

Version mismatch causes build failures like:

    https://github.com/NixOS/nixpkgs/issues/351905

Similar problems (but on a smaller scale) happen when a `gcc`
cross-compiler is built (`build` == `host` && `host` != `target`) built
by a mismatching version of a native compiler (`build` == `host` &&
`host` == `target`). That was worked around by forcing `gcc9Stdenv` for
older compiler versions.

Let's fix both problems by requiring the same compiler version for
cross-case.

Closes: https://github.com/NixOS/nixpkgs/issues/351905
2024-11-25 09:11:38 +00:00
Wolfgang Walther
d86588d230
treewide: improve prepending and appending derivation arguments in bash code
Those would be problematic with __structuredAttrs turned on, because
they'd turn those nice bash arrays back into strings - and potentially
lose some of the values on the way.
2024-11-25 09:09:23 +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
ac283f30a5 gcc: remove GCC < 7 detritus 2024-11-22 18:03:01 +00:00
Reno Dakota
2de1b4b14e gcc{10,11,12,13,14}: reorder .cfi_startproc with label
fixes llvm-18+ builds which require that an asm label precedes the
.cfi_startproc pseudo instruction.
2024-11-20 02:33:33 +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
Emily
937529bb51 gcc: remove code for macOS < 11 2024-11-18 00:14:00 +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
Randy Eckenrode
a77d0eb819
gcc: fix extraLDFlags logic after undoing staging-next workaroud
The original logic was prepending to the array, but this one prepends
the array to itself, which breaks the x86_64-linux stdenv bootstrap. The
correct thing to do is build up the arguments in a temporary array and
prepend it like the original code was doing.
2024-10-10 17:04:36 -04:00
Randy Eckenrode
ac31fb7505
gcc: remove staging-next workaround 2024-10-10 01:07:29 -04:00
K900
e3bf09623f Merge remote-tracking branch 'origin/master' into staging-next 2024-10-01 15:09:28 +03:00
Sergei Trofimovich
58e115dc53 gcc11: drop libgcc-aarch64-darwin-detection upstreamed patch
Randy notes that it was already upstream in latest patches and is not
needed anymore:

- 8eef9a10b4/libgcc/config.host (L229-L231)
- https://github.com/iains/gcc-11-branch/blob/gcc-11-5-darwin/libgcc/config/t-darwin-rpath
2024-09-26 22:19:02 +01:00
Sergei Trofimovich
8e9cb69da9 gcc11: update darwin support patch to 11.5.0
https://github.com/NixOS/nixpkgs/pull/328380 updated `gcc11` from
`11.4.0` to `11.5.0` but the darwin patch was not ready then. Let's
update it in hopes that it fixed `darwin` build.
2024-09-26 22:18:22 +01:00
Artturin
f0e657f3b1 Merge branch 'master' into staging-next 2024-09-25 06:05:01 +03:00