From 82b88d2db629a06443a6d7befb8518dbb785d183 Mon Sep 17 00:00:00 2001 From: Boey Maun Suang Date: Mon, 26 Dec 2022 23:16:17 +1100 Subject: bintoolsDualAs: Add package For reasons explained in the commit contents, in order to build the native gnat package for x86_64-darwin, the native gnatboot package for x86_64-darwin must have access to both the Clang integrated assembler and the cctools GNU assembler for that platform. This commit creates a package with both of those assemblers that x86_64-darwin gnatboot can then be wrapped with. --- pkgs/build-support/bintools-wrapper/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkgs/build-support/bintools-wrapper') diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 121b50fe0f523..bc7c8fbd46ac1 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -28,6 +28,7 @@ , buildPackages ? {} , targetPackages ? {} , useMacosReexportHack ? false +, wrapGas ? false # Darwin code signing support utilities , postLinkSignHook ? null, signingUtils ? null @@ -165,6 +166,18 @@ stdenv.mkDerivation { wrap ld-solaris ${./ld-solaris-wrapper.sh} '') + # If we are asked to wrap `gas` and this bintools has it, + # then symlink it (`as` will be symlinked next). + # This is mainly for the wrapped gnatboot on x86-64 Darwin, + # as it must have both the GNU assembler from cctools (installed as `gas`) + # and the Clang integrated assembler (installed as `as`). + # See pkgs/os-specific/darwin/binutils/default.nix for details. + + lib.optionalString wrapGas '' + if [ -e $ldPath/${targetPrefix}gas ]; then + ln -s $ldPath/${targetPrefix}gas $out/bin/${targetPrefix}gas + fi + '' + # Create symlinks for rest of the binaries. + '' for binary in objdump objcopy size strings as ar nm gprof dwp c++filt addr2line \ -- cgit 1.4.1