Commit Graph

1219 Commits

Author SHA1 Message Date
K900
fa271535bb sanitiseHeaderPathsHook: init (#418819) 2025-07-04 16:06:19 +03: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
Alexander Bantyev
8f85dcb0af GCC: document & refactor patches (#413617) 2025-06-27 16:40:56 +04: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
Alexander Bantyev
f484086997 gcc: download patch instead of storing it in-tree
A backport of a fix for GCC bug 80431 was stored in-tree, while it is
available to download from the GCC upstream.

The advantage of fetching the patch is more obvious provenance.
2025-06-03 18:43:41 +04:00
Silvan Mosberger
ac165bd9b7 gcc: Remove unnecessary patch update script
The patch is in recent gcc versions
2025-06-03 18:43:41 +04:00
Silvan Mosberger
6b1a63dd48 gcc: Fetch a patch instead of having it locally
This unfortunately unavoidably causes a rebuild
2025-06-03 18:43:41 +04:00
Silvan Mosberger
1636888349 gcc: Switch a patch to the upstream source
Same exact patch, just from upstream instead
2025-06-03 18:43:40 +04:00
Silvan Mosberger
a9d7c5ee5f gcc: Add missing patch comments
Co-authored-by: Alexander Bantyev <alexander.bantyev@moduscreate.com>
2025-06-03 18:43:40 +04: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
Leona Maroni
0517934020 gcc14: fix build on aarch64-darwin
The previous patch didn't apply anymore for 14.3.0.
Currently there is no branch for 14.3.0 in https://github.com/iains/gcc-14-branch
nor in homebrew. This lead me to use the -pre branch with a custom target.
2025-06-01 18:39:49 +02:00
K900
37a72a5aa2 Merge remote-tracking branch 'origin/staging-next' into staging 2025-05-29 12:02:16 +03:00
K900
a3612e2210 Merge remote-tracking branch 'origin/staging-next' into staging 2025-05-28 11:42:18 +03:00
Sergei Trofimovich
37ce8aa459 gcc15: apply forgotten no-sys-dirs and mangle-NIX_STORE patches 2025-05-27 22:23:31 +01:00
Philip Taron
b76868988b cc-wrapper: add support for strictflexarrays1 & strictflexarrays3 hardening flags (#400408) 2025-05-26 10:46:00 -07:00
Sergei Trofimovich
67cc3aa69a gcc15: update patches for 15 version 2025-05-26 07:22:09 +01:00
Sergei Trofimovich
dc2e7bea50 gcc14: 14.2.1.20250322 -> 14.3.0
Changes: https://lists.gnu.org/archive/html/info-gnu/2025-05/msg00004.html
2025-05-25 10:01:09 +02:00
Vladimír Čunát
3d7372384d Merge branch 'master' into staging 2025-05-25 09:51:57 +02:00
Vladimír Čunát
de19a6881e gcc15, gccgo15, gfortran15, gnat15: init at 15.1.0 (#401948) 2025-05-25 09:51:35 +02: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
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
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