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;
|
bintools = self.binutils-unwrapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
binutilsDualAs-unwrapped = callPackage ../os-specific/darwin/binutils {
|
# x86-64 Darwin gnat-bootstrap emits assembly
|
||||||
inherit (pkgs) binutils-unwrapped;
|
# with MOVQ as the mnemonic for quadword interunit moves
|
||||||
inherit (pkgs.llvmPackages) llvm clang-unwrapped;
|
# such as `movq %rbp, %xmm0`.
|
||||||
dualAs = true;
|
# 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 {
|
binutilsDualAs = self.binutils.override {
|
||||||
libc =
|
|
||||||
if stdenv.targetPlatform != stdenv.hostPlatform
|
|
||||||
then pkgs.libcCross
|
|
||||||
else pkgs.stdenv.cc.libc;
|
|
||||||
bintools = self.binutilsDualAs-unwrapped;
|
bintools = self.binutilsDualAs-unwrapped;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user