Commit Graph

267 Commits

Author SHA1 Message Date
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
Sergei Trofimovich
72c6cc879e libbfd, libopcodes: moves closer to binutils nix expressions
Having all 3 of binutils, libbfd, libopcodes in one directory eases
copying of the whole directory when we need to hold back old version of
the whole of binutils or of it's pieces.
2022-08-23 07:50:51 +01:00
Minijackson
5d05bbed74
binutils: fix the kernel build for PowerPC 2022-07-25 16:20:30 +02:00
Asad Mehmood
be560224be
binutils: Reduce closure size when building for cross platform 2022-06-02 23:37:00 +01:00
Artturin
f002ffed9a treewide: enable strictDeps in bootstrap packages 2022-05-22 16:40:26 +03:00
Janne Heß
c911240e9c
Revert "Add mingwW64-llvm cross-system." 2022-05-18 13:50:23 +02:00
Shea Levy
0f68ed163c
Merge branch 'mingwW64-clang' into staging 2022-05-18 06:30:21 -04:00
Stefan Frijters
4b0f59afcc
binutils: add upstream patch to fix issue with parallel use of dlltool
https://sourceware.org/bugzilla/show_bug.cgi?id=28885

Patch taken from the upstream binutils-2_38-branch branch.
2022-05-12 12:45:11 +02:00
Shea Levy
dee9af9323
bintools: Add isXXX flags to check linker type 2022-05-09 10:03:48 -04:00
Sergei Trofimovich
27f20550b4 binutils-unwrapped-all-targets: fix libctf breakage
Before the change 'postFixup' was breaking binaries as it deleted `libctf.so`'s
dependency without fixing the links (https://hydra.nixos.org/build/173957444):

  objdump:
    symbol lookup error: ...-binutils-2.38/lib/libctf.so.0: undefined symbol: htab_eq_string

Instead of tying binutils and libbfd together let's stop replacing the
libraries and use local copies. They are not mechanically interchangeable.

Ideally binutils' upstream build system should allow linking external
`libbfd`/`libopcodes`/`libctf` but we are not there yet.
2022-04-23 08:13:09 +01:00
Andrew Childs
9568a7afef binutils: fix cross compilation from darwin
The libtool patch is required to correctly invoke the linker while
building, so it should depend on the build toolchain.
2022-04-20 00:03:01 +09:00
Vladimír Čunát
d5d94127fd
Merge branch 'staging-next' into staging
Minor conflicts; I hope I didn't mess up:
	pkgs/development/tools/misc/binutils/default.nix
	pkgs/games/openjk/default.nix
2022-04-14 09:53:21 +02:00
Adam Joseph
8305aa29c2 binutils: apply debian's patch if isMips64n64
Upstream binutils is missing sensible defaults for a few flags
(notably linker personality) when cross-compiling to
mips64el-*-*abi64.

Most of the time this isn't an issue because packages that invoke the
linker directly detect the flags from gcc's behavior (for example,
libtool does this) and gcc has good code for detecting the right
defaults.  However some do not; notably nix, itself lacks this.

Presumably Debian is working on upstreaming this, and has more clout
than we do.  I propose we carry their patch in the meantime.  The
patch is conditioned on stdenv.targetPlatform.isMips64n64 in order to
avoid mass-rebuilds.

Closes #164835.
2022-04-05 23:59:45 -07:00
Bernardo Meurer
c981094480
binutils: only autoconf on Darwin 2022-03-28 19:11:33 -07:00
Andrew Childs
022e81d7f1
binutils: revert libtool changes that break darwin 2022-03-28 18:51:55 -07:00
Bernardo Meurer
aa9448db2a
binutils: move src hack out of srcs attrset 2022-03-28 18:50:22 -07:00
Sergei Trofimovich
3de6fbcfa2
libbfd: update build-components-separately.patch for 2.38
Otherwise the patch application fails as:

    applying patch /nix/store/y0l0144l12q7jpq4jv735shgxv8ygxwh-build-components-separately.patch
    1 out of 3 hunks FAILED -- saving rejects to file opcodes/Makefile.am.rej
    1 out of 2 hunks FAILED -- saving rejects to file opcodes/configure.ac.rej
1 out of 2 hunks FAILED -- saving rejects to file opcodes/configure.ac.rej
2022-03-28 18:50:21 -07:00
Bernardo Meurer
ca02ea1e26
binutils: 2.37 -> 2.38 2022-03-28 18:50:20 -07:00
Bernardo Meurer
29e61371a7
binutils: add lovesegfault as a maintainer 2022-03-28 18:50:19 -07:00
Bernardo Meurer
737fe07136
binutils: take some suggestion from nixpkgs-fmt 2022-03-28 18:50:18 -07:00
Bernardo Meurer
8f7c9816aa
binutils: sort configureFlags 2022-03-28 18:50:17 -07:00
Bernardo Meurer
a3accfbea9
binutils: inline reuseLibs 2022-03-28 18:50:16 -07:00
Bernardo Meurer
e06d51d4c0
binutils: add tags to comments where relevant 2022-03-28 18:50:15 -07:00
Bernardo Meurer
c4913fb289
binutils: inherit {build,host,target}Platform to avoid repeating ourselves 2022-03-28 18:50:14 -07:00
Bernardo Meurer
3436886724
binutils: format and order patches section 2022-03-28 18:50:13 -07:00
Bernardo Meurer
008ce6610a
binutils: join srcs in an attrset 2022-03-28 18:50:12 -07:00
Bernardo Meurer
8e5d2ead61
binutils: rename gold to enableGold 2022-03-28 18:50:11 -07:00
Bernardo Meurer
c748ef4d1b
binutils: format input attrs 2022-03-28 18:50:10 -07:00
Bernardo Meurer
ce91080db2
binutils: add patch for ld file descriptor explosion 2022-03-28 18:50:06 -07:00
Bernardo Meurer
f8885d9d07
libbfd: fix binutils components patch
Co-authored-by: John Ericson <git@JohnEricson.me>
2022-03-28 18:50:05 -07:00
Bernardo Meurer
36aa3f6a09
binutils: 2.35.1 -> 2.37 2022-03-28 18:50:03 -07:00
marius david
293c55472a binutils: fix windres not finding the apprioate cross compiler 2022-02-01 10:41:36 +01:00
Robert Scott
6a6756ce7e
binutils: add patch for CVE-2021-45078 (#151658) 2021-12-25 17:02:00 -05:00
Fabián Heredia Montiel
745023e01a binutils: patch CVE-2021-3487 2021-10-17 16:25:25 -05:00
Fabián Heredia Montiel
f378420360 binutils: 2.35.1 → 2.35.2
CVEs:

- https://nvd.nist.gov/vuln/detail/CVE-2020-35448 (3.3 Low)
- https://nvd.nist.gov/vuln/detail/CVE-2021-20284 (5.5 Medium)
- https://nvd.nist.gov/vuln/detail/CVE-2021-20294 (7.8 High)
2021-10-17 16:25:25 -05:00
John Ericson
7195e6008a
Merge pull request #132538 from sternenseemann/has-gold
binutils-unwrapped: expose if built with ld.gold
2021-08-20 21:12:20 -04:00
sternenseemann
4c75874560 binutils-unwrapped: expose if built with ld.gold
ld.gold is “A new, faster, ELF only linker”. Thus we only should pass
the configure flag --with-gold if our target platform will actually
support gold (in which case binutil's configure script silently
disables it).

With this change, not only will configureFlags represent the actual
configuration more closely, but we can also expose if the binutils
derivation contains ld.gold via a passthru attr. Specifically this
means that:

    nix-repl> pkgsCross.mingwW64.stdenv.cc.bintools.bintools.hasGold
    false

The intended way to use this is to check
`stdenv.cc.bintools.bintools or false` which returns accurate results
regardless of the actual linker derivation.

TODO: maybe also add hasGold to binutils wrapper as it also symlinks
ld.gold in?
2021-08-18 01:21:44 +02:00
Jan Tojnar
29be3a3f05 binutils: try to fix plv8 build
Backport patch from 2.36 so that gold can succeed in linking programs without complaining
unknown program property type 0xc0008002 in .note.gnu.property section

Should fix: https://github.com/NixOS/nixpkgs/issues/134190
2021-08-15 15:08:46 +02:00
Niklas Hambüchen
79d94779a8 binutils: Apply patch to fix 300x strip performance regression. Fixes #129467 2021-07-11 12:47:34 +00:00
misuzu
5aad70e8be binutils: apply R_ARM_COPY.patch only when cross-compiling to armv7l
Applying R_ARM_COPY.patch when not cross-compiling breaks native armv7l builds.
2021-06-23 11:37:40 +03:00
sternenseemann
ca9be0511b binutils-unwrapped: force targetPrefix if cross compiling
The binutils build system checks by itself if it is building a cross
toolchain or not and prepends or omits a targetPrefix accordingly. This
means that we can always pass target via configureTargets.

However the binutils build system and our bintools wrapper disagree over
whether we are building a cross toolchain or not sometimes since cross
compilation can be relatively subtle in nixpkgs. For example every use
of crossOverlays will make nixpkgs build a cross toolchain even though
localSystem == crossSystem. The cross infrastructure is also used to
build native binaries with a different stdenv (musl instead of glibc,
clang instead of gcc). In all of these cases stdenv.hostPlatform.config
== stdenv.targetPlatform.config, causing binutils to not prepend a
target prefix. At the same time stdenv.hostPlatform !=
stdenv.targetPlatform causing the bintools wrapper to expect a target
prefix, thus building an incomplete set of bintools. This is why
currently pkgsCross.gnu64 and pkgsCross.musl64 aren't working.

The solution is quite simple however: If we detect that we are building
a cross toolchain in the binutils-unwrapped expression, we force the
targetPrefix with --programprefix and fulfill the expectations of the
bintools wrapper at the same time.

Tested (on x86_64-linux):

* pkgsCross.musl64.hello
* pkgsCross.aarch64-multiplatform.hello
* pkgs.hello

Still not working is pkgsCross.gnu64, since
x86_64-unknown-linux-gnu-stage-final-gcc gets confused about targets
now, so bootstrapping the stdenv fails. Since this wasn't working
previously anyways, it's proably fine to fix this separately.
2021-04-16 17:12:45 +02:00
Andrew Childs
6605fadc68 bintools-wrapper: default platform versions for darwin
Instead of always supplying flags, apply the flags as defaults. Use
clang's native flags instead of lifting the linker flags from binutils
with `-Wl,`.

If a project is using clang to drive linking, make clang do the right
thing with MACOSX_DEPLOYMENT_TARGET. This can be overridden by command
line arguments. This will cause modern clang to pass
`-platform_version 10.12 0.0.0`, since it doesn't know about the SDK
settings. Older versions of clang will pass down `-macos_version_min`
flags with no sdk version.

At the linker layer, apply a default value for anything left
ambiguous. If nothing is specified, pass a full
`-platform_version`. If only `-macos_version_min` is specified, then
lock down the sdk_version explicitly with `-sdk_version`. If a min
version and sdk version is passed, do nothing.
2021-04-11 09:47:09 +09:00
Pamplemousse
8748154972 binutils, libbfd: Patch CVE-2020-35448
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-03-22 07:22:33 -07:00
Dmitry Kalinkin
55e8a35caf
Merge pull request #109422 from veprbl/pr/binutils_use_gold_darwin_cross
binutils: enable gold when cross compiling on darwin
2021-01-21 18:47:25 -05:00
Dmitry Kalinkin
9120da4c4a
binutils: enable gold when cross compiling on darwin
This basically reverts:
 - 3c5188cc ('binutils: disable gold when building on darwin')
 - 457b48cc ('binutils: apply patch when cross compiling from darwin')

Tested by building:
 - nix build -f . pkgsCross.i686-embedded.buildPackages.binutils
 - nix build -f . pkgsCross.aarch64-embedded.buildPackages.binutils
2021-01-14 19:06:22 -05:00
Bernardo Meurer
306aefd9fc binutils: 2.34 -> 2.35.1 2021-01-10 16:09:25 +01:00
John Ericson
f52263ced0 treewide: Start to break up static overlay
We can use use `stdenv.hostPlatform.isStatic` instead, and move the
logic per package. The least opionated benefit of this is that it makes
it much easier to replace packages with modified ones, as there is no
longer any issue of overlay order.

CC @FRidh @matthewbauer
2021-01-03 19:18:16 +00:00
luc65r
968805c37b Revert "Revert "Revert "Revert "libbfd: fix build""""
This reverts commit 5c2b59d63a.
2020-12-28 08:43:32 +01:00
luc65r
dde943e535 Revert "Revert "Merge pull request #86954 from lovesegfault/binutils-2.34""
This reverts commit 24c96b9259.
2020-12-28 08:43:32 +01:00
luc65r
3205b32bf6 Revert commits on binutils for OpenRISC 1000
This reverts commits
    ebd89f6de1
    c6f6db77ac
    257fb62387
    dbe556af9c
2020-12-28 08:43:31 +01:00