cctools: add patch for apfs

This commit is contained in:
Matthew Bauer 2019-03-11 20:08:14 -04:00
parent 9da646ed29
commit 4faa8d0238
2 changed files with 23 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -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