Commit Graph

334 Commits

Author SHA1 Message Date
Sergei Trofimovich
1e5395d29a libopcodes_2_38: fix gcc-15 build
Without the change the build fails on `master` as https://hydra.nixos.org/build/327027927:

```
mips-opc.c: In function 'decode_mips_operand':
mips-formats.h:86:7: error: expected identifier or '(' before 'static_assert'
   86 |       static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \
      |       ^~~~~~~~~~~~~
```

Apply upstream fix to get it built.

ZHF: #516381
2026-05-16 14:35:10 +01:00
Sergei Trofimovich
e2a60581ca binutils-unwrapped: 2.44 -> 2.46
Changes: https://sourceware.org/pipermail/binutils/2026-February/148149.html
2026-02-08 19:16:11 +00:00
David McFarland
298efd82dd binutils: fix cygwin build 2026-01-02 12:58:42 -04:00
Ihar Hrachyshka
567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00
Luna Nova
e7fbed853b treewide: remove usages of obsolete pie hardening flag 2025-10-09 10:13:03 -07:00
Tyler Langlois
88ceb91bdf binutils: fix CVE-2025-5245
Backport derived from upstream commit; see:
https://nvd.nist.gov/vuln/detail/CVE-2025-5245
2025-10-06 14:35:12 -06:00
Tyler Langlois
25e606dd64 binutils: fix CVE-2025-5244 2025-10-06 13:44:11 -06:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Alyssa Ross
f1cf3829b9 binutils-unwrapped-all-targets: fix build on Darwin
gas isn't built for Darwin, so previously this failed when trying to
install it:

	make: Entering directory '/private/tmp/nix-build-binutils-2.44.drv-0/build'
	make: *** /private/tmp/nix-build-binutils-2.44.drv-0/build-arm64-apple-darwin/gas: No such file or directory.  Stop.
	make: Leaving directory '/private/tmp/nix-build-binutils-2.44.drv-0/build'

Fixes: 437ad124ac ("binutils-unwrapped-all-targets: per-target gas")
2025-07-03 09:44:37 +02:00
Alyssa Ross
437ad124ac binutils-unwrapped-all-targets: per-target gas
pwntools wants to be able to disassemble arbitrary programs, so it
wants to be able to find gas for an arbitrary architecture in the same
prefix.
2025-06-05 15:12:05 +02:00
Alyssa Ross
14b94d4455 binutils: build outside source tree
This will allow us to configure and build binutils multiple times, to
make gas available for multiple targets in
binutils-unwrapped-all-targets.
2025-06-05 15:12:05 +02:00
Alyssa Ross
ea648ee3d7 binutils: use a no-op for makeinfo
This way, we don't have to touch every file generated from one we
patch.  It also makes it possible to do an out-of-tree build —
otherwise, the source files would be copied into the build directory
during Make, so there'd be no opportunity to touch some of them.

This same hack is already used by the minimal-bootstrap binutils.
2025-06-05 15:12:05 +02: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
Vladimír Čunát
4da4c219a1 binutils: 2.43.1 -> 2.44 (#388157) 2025-04-03 22:55:05 +02:00
Sigmanificient
670aba9a64 treewide: remove unused arguments 2025-03-13 18:00:11 +01:00
Sergei Trofimovich
6b9c4bbe1b binutils: 2.43.1 -> 2.44
Did not drop `gold` yet as it will require quite a bit `nixpkgs` work.

Changes: https://lists.gnu.org/archive/html/info-gnu/2025-02/msg00001.html
2025-03-08 09:43:04 +00: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
Peter Waller
7903d0b711 llvmPackages.llvm: Drop dependency on target through libbfd
Currently the target triple leaks into the clang build via llvm using
libbfd, whose build varies according to the target triple.

LLVM only uses libbfd to enable LTO via the linker plugin (called
LLVMgold.so, though multiple linkers can use the same plugin).

Drop the dependency on the libbfd build, and consume the only needed
source instead.  (This would be a good use of CA-derivations FWIW).

The result of this commit is that these match:

* nix eval --raw nixpkgs#clang.cc
* nix eval --raw nixpkgs#pkgsStatic.pkgsLLVM.stdenv.cc.cc
* nix eval --raw nixpkgs#pkgsCross.aarch64-multiplatform.pkgsLLVM.stdenv.cc.cc

This means fewer clang builds will be needed to support cross
configurations, and users wanting to target an exotic cross
configuration should be able to do so without a rebuild of clang.

Also drops libbfd.hasPluginAPI which no longer has any users.

Signed-off-by: Peter Waller <p@pwaller.net>
2024-11-14 21:43:26 +00:00
github-actions[bot]
a90280100f Merge master into staging-next 2024-11-09 15:14:08 +00:00
aleksana
b74fdd2386 treewide: remove redundant patches and locks
These files are no longer referenced.
2024-11-08 12:54:15 +08:00
Alyssa Ross
72413bfe89 binutils: make patches unconditional
The Darwin patch was always supposed to be unconditional, and neither
of these patches should have any effect when applied to other targets.
Conditional application should be avoided where possible as it makes
it very easy to miss when a patch needs to be updated.
2024-10-21 20:07:12 +02:00
Emily
ea86438a3f binutils-unwrapped: remove broken vc4 sources (#350247) 2024-10-21 16:39:53 +01:00
Alyssa Ross
99d0e4996d binutils: remove autoreconfHook on iOS
This was added in ebc2243778 ("binutils: Add iOS as a supported
platform"), at the same time as a patch.  That patch was removed in
045c2d219d ("binutils-unwrapped: remove broken iOS patch"), and I'm
not sure what other reason there would be for autoreconfHook to be
required specifically for iOS, so I think we can remove it.  It's not
possible to test since iOS cross has been broken for months, and
keeping this around is making other refactors (like adding cross
binutils packages) harder.
2024-10-21 16:27:09 +02:00
Alyssa Ross
4955cb9a09 binutils-unwrapped: remove broken vc4 sources
This hasn't made it past patchPhase since dde943e535 ("Revert
"Revert "Merge pull request #86954 from
lovesegfault/binutils-2.34"""), more than four ago.  It's therefore
safe to say that nobody depends on this continuing to work in recent
Nixpkgs, and all these targetPlatform conditionals are making new
development (like adding cross binutils packages), so let's just
remove it.

It can be brought back if somebody wants to make it work in future,
but given that upstream binutils will continue to diverge from the
stagnant vc4 fork, a better way of doing this would be to upstream vc4
support to binutils, or at the very least use a different expression
for vc4 binutils.
2024-10-21 16:18:52 +02:00
Alyssa Ross
045c2d219d binutils-unwrapped: remove broken iOS patch
This hasn't applied since e1ef521cff ("binutils: 2.39 -> 2.40"),
almost two years ago.  It's therefore safe to say that nobody depends
on this continuing to work in recent Nixpkgs, and all these
targetPlatform conditionals are making new development (like adding
cross binutils packages), so let's just remove it.

It can be brought back if somebody wants to make it work in future,
but since it seems to just be trying to make iOS behave identically to
macOS, a better solution would probably be to just pass the darwin
triple when building for iOS.
2024-10-21 15:25:50 +02:00
github-actions[bot]
653bcc0ea9 Merge master into staging-next 2024-10-05 18:04:03 +00:00
github-actions[bot]
edd71fd02c Merge master into haskell-updates 2024-10-05 00:15:55 +00:00
github-actions[bot]
e9c8665026 Merge master into staging-next 2024-10-05 00:14:01 +00:00
Peder Bergebakken Sundt
cd673393d2 treewide: remove unreferenced patch files
Found with `fd \\.patch$ pkgs/ -x bash -c 'rg -F "{/}" pkgs/ -q || echo {}'``

We're running more and more into patches fetched via `applyPatches`, for the next PR i'll script something to account for that.
2024-10-04 19:38:56 +02:00
sternenseemann
b341506a8d Merge branch master into haskell-updates
Conflicts from #341407 resolved.
2024-09-27 11:41:25 +02:00
Artturin
f0e657f3b1 Merge branch 'master' into staging-next 2024-09-25 06:05:01 +03:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
sternenseemann
f3f40a16c7 binutils: CoreServices depends on host, not build platform
This was introduced in 879556bea5 and 33c0dd692b.

See: 33c0dd692b (r146876310).
2024-09-20 16:24:35 +02:00
Sergei Trofimovich
3e508761b4 binutils-unwrapped: 2.42 -> 2.43.1
Changes:
- https://lists.gnu.org/archive/html/info-gnu/2024-08/msg00001.html
- https://mail.gnu.org/archive/html/info-gnu/2024-08/msg00003.html
2024-08-18 07:27:22 +01:00
Sigmanificient
63d05d989e pkgs/development: remove unused arguments 2024-08-03 17:18:20 +02:00
Randy Eckenrode
7f1bc0d5c1 binutils: drop Darwin hack
Darwin no longer uses GNU binutils and prevents it from being used in the bootstrap. This hack is no longer necessary.
2024-07-13 17:54:35 -04:00
Randy Eckenrode
879556bea5 binutils: make conditional on Darwin to avoid Linux rebuilds 2024-07-04 16:53:00 -04:00
Randy Eckenrode
33c0dd692b binutils: fix build on Darwin
- Update Darwin version check patch; and
- Use CoreServices when building on Darwin.
2024-07-04 13:08:39 -04:00
silvanshade
94578454b1 binutils 2.41 -> 2.42 2024-06-20 14:00:10 -04:00
Alexis Hildebrandt
755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00
John Ericson
7024402dee Merge pull request #313892 from rhelmot/freebsd-minimal3/binutils
binutils: do not build with -static-libgcc on FreeBSD
2024-05-27 10:45:55 -04:00
Audrey Dutcher
14de0380da binutils: do not build with -static-libgcc on FreeBSD 2024-05-26 14:48:42 -07:00
Audrey Dutcher
a93e6df764 binutils: Add --undefined-version on lld 17+ 2024-05-26 00:22:19 -07:00
Martin Weinelt
65b31e498a Merge remote-tracking branch 'origin/staging-next' into staging
Conflicts:
- pkgs/development/python-modules/influxdb/default.nix
- pkgs/development/tools/misc/binutils/default.nix
2024-02-29 07:19:15 +01:00
Silvan Mosberger
cd5dc76d83 substitute: Deprecate replacements, introduce replacementsList
Also:
- Add tests
- Treewide update
- Improve docs
2024-02-29 00:35:27 +01:00
Sergei Trofimovich
d0f26a4af1 binutils: 2.40 -> 2.41
Dropped 3 upstreamed / backported patches:

- CVE-2023-1972
- mingw-abort-fix
- mips64-default-n64

Added one backport to fix `llvm` testsuite failures:

- gold-powerpc-for-llvm

Changes: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00009.html
2024-02-07 20:38:00 +00:00
Ryan Burns
c324705cc3 treewide: simplify exec format conditionals 2024-01-07 17:43:33 -08:00
Artturin
257dd31658 binutils-unwrapped: add option to have gold as ld 2023-06-22 22:53:46 +03:00
Henri Rosten
6c71202df2 binutils: fix CVE-2023-1972
Signed-off-by: Henri Rosten <henri.rosten@unikie.com>
2023-05-26 09:26:26 +03:00
jackyliu16
930399d8cf binutils: mark gold as unavailable on loongarch64 2023-04-27 20:04:30 +03:00