darwin.cctools: 949.0.1 -> 973.0.1

+116 -20
+21
pkgs/os-specific/darwin/cctools/darwin-no-memstream.patch
··· 1 + MacOS SDKs before 10.13 don't support open_memstream. This is already replaced 2 + by a runtime check in cctools-port, but because we build with SDK 10.12 by 3 + default, linking still fails for us. Disable it entirely here. 4 + 5 + --- a/cctools/include/stuff/diagnostics.h 6 + +++ b/cctools/include/stuff/diagnostics.h 7 + @@ -60,13 +60,6 @@ void diagnostics_log_msg(enum diagnostic_level level, const char* message); 8 + */ 9 + void diagnostics_write(void); 10 + 11 + -#if defined(__APPLE__ ) && defined(__has_builtin) 12 + -# if __has_builtin(__builtin_available) 13 + -# define HAVE_OPENMEMSTREAM_RUNTIME __builtin_available(macOS 10.13, *) 14 + -# endif 15 + -#endif 16 + -#ifndef HAVE_OPENMEMSTREAM_RUNTIME 17 + -# define HAVE_OPENMEMSTREAM_RUNTIME 1 18 + -#endif 19 + +#define HAVE_OPENMEMSTREAM_RUNTIME 0 20 + 21 + #endif /* diagnostics_h */
+95 -20
pkgs/os-specific/darwin/cctools/port.nix
··· 19 19 20 20 stdenv.mkDerivation { 21 21 pname = "${targetPrefix}cctools-port"; 22 - version = "949.0.1"; 22 + version = "973.0.1"; 23 23 24 24 src = fetchFromGitHub { 25 25 owner = "tpoechtrager"; 26 26 repo = "cctools-port"; 27 - rev = "43f32a4c61b5ba7fde011e816136c550b1b3146f"; 28 - sha256 = "10yc5smiczzm62q6ijqccc58bwmfhc897f3bwa5i9j98csqsjj0k"; 27 + # This is the commit before: https://github.com/tpoechtrager/cctools-port/pull/114 28 + # That specific change causes trouble for us (see the PR discussion), but 29 + # is also currently the last commit on master at the time of writing, so we 30 + # can just go back one step. 31 + rev = "457dc6ddf5244ebf94f28e924e3a971f1566bd66"; 32 + sha256 = "0ns12q7vg9yand4dmdsps1917cavfbw67yl5q7bm6kb4ia5kkx13"; 29 33 }; 30 34 31 35 outputs = [ "out" "dev" "man" ]; ··· 35 39 ++ lib.optionals stdenv.isDarwin [ libobjc ] 36 40 ++ lib.optional enableTapiSupport libtapi; 37 41 38 - patches = [ ./ld-ignore-rpath-link.patch ./ld-rpath-nonfinal.patch ]; 42 + patches = [ 43 + ./ld-ignore-rpath-link.patch 44 + ./ld-rpath-nonfinal.patch 45 + ] 46 + ++ lib.optional stdenv.isDarwin ./darwin-no-memstream.patch; 39 47 40 48 __propagatedImpureHostDeps = [ 41 49 # As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them ··· 64 72 --replace "-isystem /usr/local/include -isystem /usr/pkg/include" "" \ 65 73 --replace "-L/usr/local/lib" "" \ 66 74 67 - substituteInPlace cctools/include/Makefile \ 68 - --replace "/bin/" "" 75 + # Appears to use new libdispatch API not available in macOS SDK 10.12. 76 + substituteInPlace cctools/ld64/src/ld/libcodedirectory.c \ 77 + --replace "#define LIBCD_PARALLEL 1" "" 69 78 70 79 patchShebangs tools 71 80 sed -i -e 's/which/type -P/' tools/*.sh 72 81 73 - # Workaround for https://www.sourceware.org/bugzilla/show_bug.cgi?id=11157 74 - cat > cctools/include/unistd.h <<EOF 75 - #ifdef __block 76 - # undef __block 77 - # include_next "unistd.h" 78 - # define __block __attribute__((__blocks__(byref))) 79 - #else 80 - # include_next "unistd.h" 81 - #endif 82 - EOF 83 - 84 82 cd cctools 85 83 ''; 86 84 87 85 preInstall = '' 88 - pushd include 89 - make DSTROOT=$out/include RC_OS=common install 86 + installManPage ar/ar.{1,5} 87 + 88 + # The makefile rules for installing headers are missing in 973.0.1. 89 + # The below is derived from 949.0.1. 90 + mkdir -p $dev/include/mach-o/i386 91 + mkdir -p $dev/include/mach-o/ppc 92 + mkdir -p $dev/include/mach-o/x86_64 93 + mkdir -p $dev/include/mach-o/arm 94 + mkdir -p $dev/include/mach-o/arm64 95 + mkdir -p $dev/include/mach-o/m68k 96 + mkdir -p $dev/include/mach-o/sparc 97 + mkdir -p $dev/include/mach-o/hppa 98 + mkdir -p $dev/include/mach-o/i860 99 + mkdir -p $dev/include/mach-o/m88k 100 + mkdir -p $dev/include/dyld 101 + mkdir -p $dev/include/cbt 102 + 103 + pushd include/mach-o 104 + install -c -m 444 arch.h ldsyms.h reloc.h \ 105 + stab.h loader.h fat.h swap.h getsect.h nlist.h \ 106 + ranlib.h $dev/include/mach-o 107 + popd 108 + 109 + pushd include/mach-o/i386 110 + install -c -m 444 swap.h \ 111 + $dev/include/mach-o/i386 112 + popd 113 + 114 + pushd include/mach-o/ppc 115 + install -c -m 444 reloc.h swap.h \ 116 + $dev/include/mach-o/ppc 117 + popd 118 + 119 + pushd include/mach-o/x86_64 120 + install -c -m 444 reloc.h \ 121 + $dev/include/mach-o/x86_64 122 + popd 123 + 124 + pushd include/mach-o/arm 125 + install -c -m 444 reloc.h \ 126 + $dev/include/mach-o/arm 127 + popd 128 + 129 + pushd include/mach-o/arm64 130 + install -c -m 444 reloc.h \ 131 + $dev/include/mach-o/arm64 132 + popd 133 + 134 + pushd include/mach-o/m68k 135 + install -c -m 444 swap.h \ 136 + $dev/include/mach-o/m68k 137 + popd 138 + 139 + pushd include/mach-o/sparc 140 + install -c -m 444 reloc.h swap.h \ 141 + $dev/include/mach-o/sparc 90 142 popd 91 143 92 - installManPage ar/ar.{1,5} 144 + pushd include/mach-o/hppa 145 + install -c -m 444 reloc.h swap.h \ 146 + $dev/include/mach-o/hppa 147 + popd 148 + 149 + pushd include/mach-o/i860 150 + install -c -m 444 reloc.h swap.h \ 151 + $dev/include/mach-o/i860 152 + popd 153 + 154 + pushd include/mach-o/m88k 155 + install -c -m 444 reloc.h swap.h \ 156 + $dev/include/mach-o/m88k 157 + popd 158 + 159 + pushd include/stuff 160 + install -c -m 444 bool.h \ 161 + $dev/include/dyld 162 + popd 163 + 164 + pushd include/cbt 165 + install -c -m 444 libsyminfo.h \ 166 + $dev/include/cbt 167 + popd 93 168 ''; 94 169 95 170 passthru = {