Commit Graph

316 Commits

Author SHA1 Message Date
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
Randy Eckenrode
5765d33f35 binutils: fix MinGW link failures with import libs 2023-03-05 22:23:06 -05:00
Artturin
f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00
Sergei Trofimovich
d381e51fb5 binutils: try to move headers around only when --host/--target differ (#215989)
Without the change `pkgsMusl.pkgsStatic.buildPackages.binutils.bintools`
build fails as:

    $ ln: failed to create symbolic link './include': File exists

This happens because both host and target are `x86_64-unknown-linux-musl`.
But `hostPlatform` differs from `targetPlatform` by `isStatic` value.

By `./configure`'s standard it's not yet a cross-compilation. The change
tries to move things around only when tuples change.
2023-02-12 14:40:29 +01:00
Sergei Trofimovich
b73942bc8e binutils: advertise binutils plugin API on darwin, it should just work 2023-01-31 18:30:30 +00:00
Sergei Trofimovich
726597c1a7 binutils: re-enable plugins support for wasi target
binutils plugins API does not depend on target. It depends only on host.
Tested the change to still be able to compile `firefox` which uses wasi
target and pulls in llvm with binutils plugin support.
2023-01-31 18:30:30 +00:00
Sergei Trofimovich
e86b3bbf2c binutils: symlink libraries and headers for "target" to lib/ and include/
`binutils` is inconsistent at installing it's headers to

    $dev/include

Instead it installs headers into two locations:

    $out/$host/$target/include
    $dev/include

There is no distinction between these two. Both headers are for HOST
libraries. Expetially for multitarget binutils builds.

This change fixes build of the following packages that build `binutils`
as a cross-compiler:

    pkgsCross.x86_64-freebsd.buildPackages.llvm_12
    pkgsCross.aarch64-multiplatform.buildPackages.llvm_12
2023-01-31 18:30:29 +00:00
Sergei Trofimovich
b9a9dfc3d4 binutils: consolidate plugin-api.h support in a single
I got the plugin API support at least once incorrect. Instead of
copying the deifnition let's consolidate it within binutils itself.

While at it forward-ported changes to llvm_{13,14,15}.
The change is a no-op from rebuild perspective.
2023-01-30 22:23:36 +00:00
Sergei Trofimovich
0ba9da441d Merge pull request #211126 from trofi/binutils-update
binutils: 2.39 -> 2.40
2023-01-29 09:50:57 +00:00
Sergei Trofimovich
e1ef521cff binutils: 2.39 -> 2.40
A few potentially disruptive changes:

- binutils does not embed ${binutils-unwrapped}/lib as a default library
  search path anymore. This will cause link failures for -lbfd -lopcodes
  users that did not declare their dependency on those libraries. They
  will need to add `libbfd` and `libopcodes` attributes to build inputs.

- `libbfd` and `libopcodes` attributes now just reference
  `binutils-unwrapped.{dev,lib}` pair of attributes without patching
  `binutils` build system.

We don't patch build system anymore and use multiple outputs out of
existing `binutils` build. That makes the result more maintainable: no
need to handle ever growing list of dependencied of `libbfd`. This time
new addition was `libsframe`.

To accomodate `out` / `lib` output split I had to remove `lib` -> `bin`
backreference by removing legacy lookup path for plugins.

I also did not enable `zstd` just yet as `nixpkgs` version of `zstd`
package pulls in `cmake` into bootstrap sequence.

Changes: https://lists.gnu.org/archive/html/info-gnu/2023-01/msg00003.html
2023-01-27 23:16:45 +00:00
Sergei Trofimovich
1d5a8a5e43 binutils: avoid texinfo dependency during bootstrap
Normally binutils provides pregenerated manuals along with release
tarball. Manuals regeneration is needed every time we change
`configure.ac`. But usually there are no material changes in it.

This change instead inhibits manuals regeenration by keeping
man and info files up to date.

The diff of bootstrap tree before and after the change:

    $ nix-store --query --graph $(nix-instantiate -A stdenv) |
        fgrep ' -> ' | awk '{print $3}' | sort -u |
        sed 's/"[0-9a-z]\{32\}-/"/g' | sort > before

    $ nix-store --query --graph $(nix-instantiate -A stdenv) |
        fgrep ' -> ' | awk '{print $3}' | sort -u |
        sed 's/"[0-9a-z]\{32\}-/"/g' | sort > after

    $ diff -U0 before after
    --- before
    +++ after
    @@ -100 +99,0 @@
    -"texinfo-6.8.drv"

Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>
2023-01-13 22:17:27 +00:00
Nick Cao
f12a7d932d binutils: gold is not available for riscv target 2022-12-30 23:38:13 +01:00
figsoda
ec8cb34358 treewide: fix typos 2022-12-17 19:39:44 -05:00
Emily Trau
6e980bc4f3 binutils: port AVR-specific options to "size" 2022-10-26 18:29:51 +11:00
Yureka
0deec20d46 binutils: drop R_ARM_COPY.patch
This reverts commit b3640e024f.

When applied, the patch causes some dynamic relocations to be missing,
even in cases where they are clearly needed.

This causes bugs such as https://github.com/NixOS/nixpkgs/issues/107386
where `fprintf(stderr, ...)` segfaults because the stderr relocation was
not added.
2022-10-03 18:58:29 +02:00
Sergei Trofimovich
58c0decef2 libbfd: add CC_FOR_BUILD into depends
Without the change cross-compiling libbfd fails as:

      GEN      doc/bfdver.texi
      CCLD     doc/chew.stamp
    ...-bash-5.1-p16/bin/bash: line 1: gcc: command not found

Tested on `pkgsCross.riscv64.libbfd`.
2022-09-12 09:42:27 +01:00
Sergei Trofimovich
fef040afae binutils: restore nm autodetection on darwin
The change restores the patch `nixpkgs` kept for `binutils-2.38`.
On top of that we revert the second `binutils-2.39`-specific commit
that attempted to fix it.

We can drop both reverts once https://sourceware.org/PR29547 is fixed.
2022-09-05 19:18:53 +01:00
Sergei Trofimovich
6a378e9c44 binutils: 2.38 -> 2.39
Changes: https://sourceware.org/pipermail/binutils/2022-August/122246.html
2022-09-02 07:41:31 +01:00
Sergei Trofimovich
7fe41f922e libbfd_2_38, libopcodes_2_38: create held back release
2.39 has an API breakage that will take users some time to migrate.
Create _2_38 versions to allow them to hand on an old version for a
while.
2022-08-23 19:56:03 +01:00