From fccb48062fb09cb52837d2e7e4ee008c74011798 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 12 Dec 2023 22:23:04 +0000 Subject: [PATCH] darwin/make-bootstrap-tools.nix: set -headerpad_max_install_names for coreutils Without the change bootstrapTools build fails as: https://cache.nixos.org/log/g5wyq9xqshan6m3kl21bjn1z88hx48rh-stdenv-bootstrap-tools.drv error: install_name_tool: changing install names or rpaths can't be redone for: /nix/store/0hxg356h7lnl2hck23wrdpbib3cckx41-stdenv-bootstrap-tools/bin/tac (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked, and you may need to use -headerpad or -headerpad_max_install_names) --- pkgs/stdenv/darwin/make-bootstrap-tools.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index 1324c78c5fd6..384567739d0e 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -32,11 +32,16 @@ let cross = if crossSystem != null in with import pkgspath ({ inherit localSystem overlays; } // cross // custom-bootstrap); rec { - coreutils_ = coreutils.override (args: { + coreutils_ = (coreutils.override (args: { # We want coreutils without ACL support. aclSupport = false; # Cannot use a single binary build, or it gets dynamically linked against gmp. singleBinary = false; + })).overrideAttrs (oa: { + # Increase header size to be able to inject extra RPATHs. Otherwise + # x86_64-darwin build fails as: + # https://cache.nixos.org/log/g5wyq9xqshan6m3kl21bjn1z88hx48rh-stdenv-bootstrap-tools.drv + NIX_LDFLAGS = (oa.NIX_LDFLAGS or "") + " -headerpad_max_install_names"; }); cctools_ = darwin.cctools;