mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
darwin.binutilsDualAs: use gas output of darwin.cctools
This commit is contained in:
parent
2e0fc4a2a8
commit
8834c2f569
@ -95,17 +95,29 @@ impure-cmds // appleSourcePackages // chooseLibs // {
|
||||
bintools = self.binutils-unwrapped;
|
||||
};
|
||||
|
||||
binutilsDualAs-unwrapped = callPackage ../os-specific/darwin/binutils {
|
||||
inherit (pkgs) binutils-unwrapped;
|
||||
inherit (pkgs.llvmPackages) llvm clang-unwrapped;
|
||||
dualAs = true;
|
||||
# x86-64 Darwin gnat-bootstrap emits assembly
|
||||
# with MOVQ as the mnemonic for quadword interunit moves
|
||||
# such as `movq %rbp, %xmm0`.
|
||||
# The clang integrated assembler recognises this as valid,
|
||||
# but unfortunately the cctools.gas GNU assembler does not;
|
||||
# it instead uses MOVD as the mnemonic.
|
||||
# The assembly that a GCC build emits is determined at build time
|
||||
# and cannot be changed afterwards.
|
||||
#
|
||||
# To build GNAT on x86-64 Darwin, therefore,
|
||||
# we need both the clang _and_ the cctools.gas assemblers to be available:
|
||||
# the former to build at least the stage1 compiler,
|
||||
# and the latter at least to be detectable
|
||||
# as the target for the final compiler.
|
||||
binutilsDualAs-unwrapped = pkgs.buildEnv {
|
||||
name = "${lib.getName self.binutils-unwrapped}-dualas-${lib.getVersion self.binutils-unwrapped}";
|
||||
paths = [
|
||||
self.binutils-unwrapped
|
||||
(lib.getOutput "gas" self.cctools)
|
||||
];
|
||||
};
|
||||
|
||||
binutilsDualAs = pkgs.wrapBintoolsWith {
|
||||
libc =
|
||||
if stdenv.targetPlatform != stdenv.hostPlatform
|
||||
then pkgs.libcCross
|
||||
else pkgs.stdenv.cc.libc;
|
||||
binutilsDualAs = self.binutils.override {
|
||||
bintools = self.binutilsDualAs-unwrapped;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user