Merge pull request #73721 from virusdave/dnicponski/scratch/update_darwin_cctools

darwin.cctools: 895 -> 927.0.2
This commit is contained in:
Matthew Bauer 2019-11-25 21:01:20 -06:00 committed by GitHub
commit 9d56a06ff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 64 deletions

View File

@ -1,22 +0,0 @@
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

@ -1,31 +0,0 @@
diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp
index 9250016..91d54ec 100644
--- a/cctools/ld64/src/ld/Options.cpp
+++ b/cctools/ld64/src/ld/Options.cpp
@@ -4175,23 +4175,9 @@ void Options::checkIllegalOptionCombinations()
throw "-r and -dead_strip cannot be used together";
// can't use -rpath unless targeting 10.5 or later
- if ( fRPaths.size() > 0 ) {
- if ( !minOS(ld::mac10_5, ld::iOS_2_0) )
- throw "-rpath can only be used when targeting Mac OS X 10.5 or later";
- switch ( fOutputKind ) {
- case Options::kDynamicExecutable:
- case Options::kDynamicLibrary:
- case Options::kDynamicBundle:
- break;
- case Options::kStaticExecutable:
- case Options::kObjectFile:
- case Options::kDyld:
- case Options::kPreload:
- case Options::kKextBundle:
- throw "-rpath can only be used when creating a dynamic final linked image";
- }
- }
-
+ if ( fRPaths.size() > 0 && !minOS(ld::mac10_5, ld::iOS_2_0) )
+ throw "-rpath can only be used when targeting Mac OS X 10.5 or later";
+
if ( fPositionIndependentExecutable ) {
switch ( fOutputKind ) {
case Options::kDynamicExecutable:

View File

@ -18,24 +18,29 @@ assert (!stdenv.hostPlatform.isDarwin) -> maloader != null;
let
baseParams = rec {
pname = "${targetPrefix}cctools-port";
version = "895";
name = "${targetPrefix}cctools-port";
version = "927.0.2";
src = fetchFromGitHub {
owner = "tpoechtrager";
repo = "cctools-port";
rev = "07619027f8311fa61b4a549c75994b88739a82d8";
sha256 = "12g94hhz5v5bmy2w0zb6fb4bjlmn992gygc60h9nai15kshj2spi";
rev = "8239a5211bcf07d6b9d359782e1a889ec1d7cce5";
sha256 = "0h8b1my0wf1jyjq63wbiqkl2clgxsf87f6i4fjhqs431fzlq8sac";
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [ autoconf automake libtool autoreconfHook ];
nativeBuildInputs = [ autoconf automake ]
# TODO: remove on next hash change, libtool is unnecessary with autoreconfHook
++ stdenv.lib.optional (stdenv.targetPlatform == stdenv.hostPlatform) libtool
++ [ autoreconfHook ];
buildInputs = [ libuuid ]
++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi libobjc ]
++ stdenv.lib.optional enableTapiSupport libtapi;
patches = [ ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch ./apfs.patch ];
patches = [ ./ld-ignore-rpath-link.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

View File

@ -1,18 +1,19 @@
{ lib, stdenv, fetchFromGitHub, cmake, python }:
{ lib, stdenv, fetchFromGitHub, cmake, python, clang_6 }:
stdenv.mkDerivation {
name = "libtapi";
name = "libtapi-1000.10.8";
src = fetchFromGitHub {
owner = "tpoechtrager";
repo = "apple-libtapi";
rev = "e56673694db395e25b31808b4fbb9a7005e6875f";
sha256 = "1lnl1af9sszp9wxfk0wljrpdmwcx83j0w5c0y4qw4pqrdkdgwks7";
rev = "cd9885b97fdff92cc41e886bba4a404c42fdf71b";
sha256 = "1a19h39a48agvnmal99n9j1fjadiqwib7hfzmn342wmgh9z3vk0g";
};
nativeBuildInputs = [ cmake python ];
buildInputs = [ clang_6.cc ];
preConfigure = ''
cd src/apple-llvm/src
cd src/llvm
'';
cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=OFF" ];