summary refs log tree commit diff
path: root/pkgs/os-specific/darwin/cctools
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-03-11 20:08:14 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-26 21:54:55 -0400
commit4faa8d0238777055ec49e002c3f0300f4d014c38 (patch)
treee8ff4780599ed214e69d20c7dfb04ea082954f58 /pkgs/os-specific/darwin/cctools
parent9da646ed29170f76e6c150a338445da00730993a (diff)
downloadnixpkgs-4faa8d0238777055ec49e002c3f0300f4d014c38.tar
nixpkgs-4faa8d0238777055ec49e002c3f0300f4d014c38.tar.gz
nixpkgs-4faa8d0238777055ec49e002c3f0300f4d014c38.tar.bz2
nixpkgs-4faa8d0238777055ec49e002c3f0300f4d014c38.tar.lz
nixpkgs-4faa8d0238777055ec49e002c3f0300f4d014c38.tar.xz
nixpkgs-4faa8d0238777055ec49e002c3f0300f4d014c38.tar.zst
nixpkgs-4faa8d0238777055ec49e002c3f0300f4d014c38.zip
cctools: add patch for apfs
Diffstat (limited to 'pkgs/os-specific/darwin/cctools')
-rw-r--r--pkgs/os-specific/darwin/cctools/apfs.patch22
-rw-r--r--pkgs/os-specific/darwin/cctools/port.nix2
2 files changed, 23 insertions, 1 deletions
diff --git a/pkgs/os-specific/darwin/cctools/apfs.patch b/pkgs/os-specific/darwin/cctools/apfs.patch
new file mode 100644
index 00000000000..8c6b3c0d273
--- /dev/null
+++ b/pkgs/os-specific/darwin/cctools/apfs.patch
@@ -0,0 +1,22 @@
+diff --git a/cctools/ld64/src/ld/OutputFile.cpp b/cctools/ld64/src/ld/OutputFile.cpp
+index 8859882..158c7d2 100644
+--- a/cctools/ld64/src/ld/OutputFile.cpp
++++ b/cctools/ld64/src/ld/OutputFile.cpp
+@@ -2786,7 +2786,7 @@ void OutputFile::writeOutputFile(ld::Internal& state)
+ #ifdef __APPLE__ // ld64-port
+ 			struct statfs fsInfo;
+ 			if ( statfs(_options.outputFilePath(), &fsInfo) != -1 ) {
+-				if ( strcmp(fsInfo.f_fstypename, "hfs") == 0) {
++				if ( (strcmp(fsInfo.f_fstypename, "hfs") == 0) || (strcmp(fsInfo.f_fstypename, "apfs") == 0) ) {
+ 					(void)unlink(_options.outputFilePath());
+ 					outputIsMappableFile = true;
+ 				}
+@@ -2814,7 +2814,7 @@ void OutputFile::writeOutputFile(ld::Internal& state)
+ #ifdef __APPLE__ // ld64-port
+ 			struct statfs fsInfo;
+ 			if ( statfs(dirPath, &fsInfo) != -1 ) {
+-				if ( strcmp(fsInfo.f_fstypename, "hfs") == 0) {
++				if ( (strcmp(fsInfo.f_fstypename, "hfs") == 0) || (strcmp(fsInfo.f_fstypename, "apfs") == 0) ) {
+ 					outputIsMappableFile = true;
+ 				}
+ 			}
diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix
index fcab00163a6..43a9495c3ab 100644
--- a/pkgs/os-specific/darwin/cctools/port.nix
+++ b/pkgs/os-specific/darwin/cctools/port.nix
@@ -35,7 +35,7 @@ let
       ++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi libobjc ]
       ++ stdenv.lib.optional enableTapiSupport libtapi;
 
-    patches = [ ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch ];
+    patches = [ ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch ./apfs.patch ];
 
     __propagatedImpureHostDeps = [
       # As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them