@ -1,5 +1,4 @@
{ stdenv , binutils-unwrapped , cctools
} :
{ stdenv , binutils-unwrapped , cctools , llvm }:
# Make sure both underlying packages claim to have prepended their binaries
# with the same targetPrefix.
@ -8,12 +7,12 @@ assert binutils-unwrapped.targetPrefix == cctools.targetPrefix;
let
inherit ( binutils-unwrapped ) targetPrefix ;
cmds = [
" a r " " r a n l i b " " a s " " d s y m u t i l " " in s t a l l _ n a m e _ t o o l "
" a r " " r a n l i b " " a s " " i n s t a l l _ n a m e _ t o o l "
" l d " " s t r i p " " o t o o l " " l i p o " " n m " " s t r i n g s " " s i z e "
] ;
in
# TODO loop over targetPrefixed binaries too
# TODO: loop over targetPrefixed binaries too
stdenv . mkDerivation {
name = " ${ targetPrefix } c c t o o l s - b i n u t i l s - d a r w i n " ;
outputs = [ " o u t " " i n f o " " m a n " ] ;
@ -25,9 +24,8 @@ stdenv.mkDerivation {
# We specifically need:
# - ld: binutils doesn't provide it on darwin
# - as: as above
# - ar: the binutils one prodi ces .a files that the cctools ld doesn't like
# - ar: the binutils one produ ces .a files that the cctools ld doesn't like
# - ranlib: for compatibility with ar
# - dsymutil: soon going away once it goes into LLVM (this one is fake anyway)
# - otool: we use it for some of our name mangling
# - install_name_tool: we use it to rewrite stuff in our bootstrap tools
# - strip: the binutils one seems to break mach-o files
@ -37,6 +35,8 @@ stdenv.mkDerivation {
ln - sf " ${ cctools } / b i n / $ i " " $ o u t / b i n / $ i "
done
ln - s $ { llvm } /bin/llvm-dsymutil $ out/bin/dsymutil
ln - s $ { binutils-unwrapped . out } /share $ out/share
ln - s $ { cctools } /libexec $ out/libexec