From 3cdf57a93995ce79c4d2c79f6f17dee2613b2226 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 12 Oct 2023 12:25:36 +1100 Subject: [PATCH 1/2] new cctools / ld64 version --- recipe/meta.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fd4d23d..739a1f8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ -{% set cctools_version = '973.0.1' %} -{% set ld64_version = '609' %} +{% set cctools_version = '986' %} +{% set ld64_version = '711' %} {% if llvm_version is not defined %} {% set llvm_version = "17.0" %} {% endif %} @@ -14,8 +14,8 @@ package: source: # latest commit from branch {{ cctools_version }}-ld64-{{ ld64_version }} - - url: https://github.com/tpoechtrager/cctools-port/archive/04663295d0425abfac90a42440a7ec02d7155fea.tar.gz - sha256: 70a7189418c2086d20c299c5d59250cf5940782c778892ccc899c66516ed240e + - url: https://github.com/tpoechtrager/cctools-port/archive/437ced391dbf14dce86f977ca050a750d5682f39.tar.gz + sha256: cf4020ddb92467de020c322eb13f0cac9ed992daa862a09bc2607e42467b3042 patches: - patches/0001-Don-t-link-with-libc-abi.patch - patches/0002-ld64-add-conda-specific-env-vars-to-modify-lib-searc.patch @@ -27,7 +27,7 @@ source: - patches/0005-don-t-try-to-include-__assert-for-NDEBUG-builds.patch build: - number: 16 + number: 0 skip: True # [win] ignore_run_exports: - zlib From ba54ee0c14fe10ae0e50abcd60d88b8416105ef7 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 12 Oct 2023 12:37:14 +1100 Subject: [PATCH 2/2] rebase patches --- recipe/meta.yaml | 2 - .../0001-Don-t-link-with-libc-abi.patch | 11 ++---- ...pecific-env-vars-to-modify-lib-searc.patch | 23 +++++------- ...-using-__builtin_available-for-macos.patch | 19 ++++------ ...sMappableFile-when-building-to-osx-a.patch | 37 +++++++++---------- ...o-include-__assert-for-NDEBUG-builds.patch | 32 ---------------- 6 files changed, 39 insertions(+), 85 deletions(-) delete mode 100644 recipe/patches/0005-don-t-try-to-include-__assert-for-NDEBUG-builds.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 739a1f8..1013b2e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -23,8 +23,6 @@ source: - patches/0003-Restore-using-__builtin_available-for-macos.patch # Taken from https://github.com/tpoechtrager/cctools-port/pull/118 - patches/0004-Turn-off-outputIsMappableFile-when-building-to-osx-a.patch - # Taken from https://github.com/tpoechtrager/cctools-port/pull/133 - - patches/0005-don-t-try-to-include-__assert-for-NDEBUG-builds.patch build: number: 0 diff --git a/recipe/patches/0001-Don-t-link-with-libc-abi.patch b/recipe/patches/0001-Don-t-link-with-libc-abi.patch index 4459efb..14cbc4d 100644 --- a/recipe/patches/0001-Don-t-link-with-libc-abi.patch +++ b/recipe/patches/0001-Don-t-link-with-libc-abi.patch @@ -1,17 +1,17 @@ -From 24e7cf07daaed3a5fb4be60486d31660ee8dcf7c Mon Sep 17 00:00:00 2001 +From 7247cc4028d1ac4b371eaf471eb0d687e1529290 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Tue, 26 Nov 2019 03:13:34 -0600 -Subject: [PATCH 1/5] Don't link with libc++abi +Subject: [PATCH 1/4] Don't link with libc++abi --- cctools/configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cctools/configure.ac b/cctools/configure.ac -index 2cf4b8a..8b429d1 100644 +index ad18301..bea7958 100644 --- a/cctools/configure.ac +++ b/cctools/configure.ac -@@ -264,12 +264,10 @@ AC_CHECK_FUNC([write64],[AC_DEFINE(HAVE_WRITE64, 1)]) +@@ -255,12 +255,10 @@ AC_CHECK_FUNC([write64],[AC_DEFINE(HAVE_WRITE64, 1)]) ### Check for __cxa_demangle in various C++ ABI libs ### @@ -25,6 +25,3 @@ index 2cf4b8a..8b429d1 100644 ]) AC_SUBST(CXXABI_LIB) --- -2.38.1.windows.1 - diff --git a/recipe/patches/0002-ld64-add-conda-specific-env-vars-to-modify-lib-searc.patch b/recipe/patches/0002-ld64-add-conda-specific-env-vars-to-modify-lib-searc.patch index 55e5ff2..df9a4f6 100644 --- a/recipe/patches/0002-ld64-add-conda-specific-env-vars-to-modify-lib-searc.patch +++ b/recipe/patches/0002-ld64-add-conda-specific-env-vars-to-modify-lib-searc.patch @@ -1,7 +1,7 @@ -From 319ada49d0fa9a1af360fc59c6bd9f91a5a0cd0d Mon Sep 17 00:00:00 2001 +From 3a7ebebe7e6a82cce5c58ad7816e175d67791a56 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Mon, 16 Sep 2019 05:17:30 +0000 -Subject: [PATCH 2/5] ld64: add conda specific env vars to modify lib search +Subject: [PATCH 2/4] ld64: add conda specific env vars to modify lib search paths --- @@ -9,10 +9,10 @@ Subject: [PATCH 2/5] ld64: add conda specific env vars to modify lib search 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp -index 3bb8324..c0c0e05 100644 +index 00500fa..c377e42 100644 --- a/cctools/ld64/src/ld/Options.cpp +++ b/cctools/ld64/src/ld/Options.cpp -@@ -4237,12 +4237,28 @@ bool Options::shouldUseBuildVersion(ld::Platform plat, uint32_t minOSvers) const +@@ -4372,12 +4372,28 @@ bool Options::shouldUseBuildVersion(ld::Platform plat, uint32_t minOSvers) const void Options::buildSearchPaths(int argc, const char* argv[]) { @@ -42,7 +42,7 @@ index 3bb8324..c0c0e05 100644 // scan through argv looking for -L, -F, -Z, and -syslibroot options for(int i=0; i < argc; ++i) { if ( (argv[i][0] == '-') && (argv[i][1] == 'L') ) { -@@ -4274,7 +4290,7 @@ void Options::buildSearchPaths(int argc, const char* argv[]) +@@ -4409,7 +4425,7 @@ void Options::buildSearchPaths(int argc, const char* argv[]) frameworkPaths.push_back(frameworkSearchDir); } else if ( strcmp(argv[i], "-Z") == 0 ) @@ -51,8 +51,8 @@ index 3bb8324..c0c0e05 100644 else if ( strcmp(argv[i], "-v") == 0 ) { fVerbose = true; extern const char ldVersionString[]; -@@ -4383,6 +4399,10 @@ void Options::buildSearchPaths(int argc, const char* argv[]) - ++i; +@@ -4522,6 +4538,10 @@ void Options::buildSearchPaths(int argc, const char* argv[]) + platform = info->platform; } } + @@ -62,7 +62,7 @@ index 3bb8324..c0c0e05 100644 int standardLibraryPathsStartIndex = libraryPaths.size(); int standardFrameworkPathsStartIndex = frameworkPaths.size(); if ( addStandardLibraryDirectories ) { -@@ -4392,8 +4412,12 @@ void Options::buildSearchPaths(int argc, const char* argv[]) +@@ -4531,8 +4551,12 @@ void Options::buildSearchPaths(int argc, const char* argv[]) frameworkPaths.push_back("/System/DriverKit/System/Library/Frameworks/"); } else { @@ -76,7 +76,7 @@ index 3bb8324..c0c0e05 100644 frameworkPaths.push_back("/Library/Frameworks/"); frameworkPaths.push_back("/System/Library/Frameworks/"); -@@ -4409,7 +4433,8 @@ void Options::buildSearchPaths(int argc, const char* argv[]) +@@ -4548,7 +4572,8 @@ void Options::buildSearchPaths(int argc, const char* argv[]) } // now merge sdk and library paths to make real search paths @@ -86,7 +86,7 @@ index 3bb8324..c0c0e05 100644 int libIndex = 0; for (std::vector::iterator it = libraryPaths.begin(); it != libraryPaths.end(); ++it, ++libIndex) { const char* libDir = *it; -@@ -4454,7 +4479,7 @@ void Options::buildSearchPaths(int argc, const char* argv[]) +@@ -4593,7 +4618,7 @@ void Options::buildSearchPaths(int argc, const char* argv[]) else fLibrarySearchPaths.push_back(libDir); } @@ -95,6 +95,3 @@ index 3bb8324..c0c0e05 100644 warning("directory not found for option '-L%s'", libDir); } } --- -2.38.1.windows.1 - diff --git a/recipe/patches/0003-Restore-using-__builtin_available-for-macos.patch b/recipe/patches/0003-Restore-using-__builtin_available-for-macos.patch index b4c2934..3e444b8 100644 --- a/recipe/patches/0003-Restore-using-__builtin_available-for-macos.patch +++ b/recipe/patches/0003-Restore-using-__builtin_available-for-macos.patch @@ -1,7 +1,7 @@ -From cc31db916dac03d41729aa7107292bb857143293 Mon Sep 17 00:00:00 2001 +From 53a7b232324cac8f9e2a81bdc0af25f359912340 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 3 Feb 2022 21:28:42 -0600 -Subject: [PATCH 3/5] Restore using __builtin_available for macos +Subject: [PATCH 3/4] Restore using __builtin_available for macos --- cctools/libstuff/writeout.c | 12 ++++++------ @@ -9,10 +9,10 @@ Subject: [PATCH 3/5] Restore using __builtin_available for macos 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cctools/libstuff/writeout.c b/cctools/libstuff/writeout.c -index 1377657..2013ee6 100644 +index 763539d..00c1486 100644 --- a/cctools/libstuff/writeout.c +++ b/cctools/libstuff/writeout.c -@@ -145,27 +145,27 @@ uint32_t *throttle) +@@ -149,27 +149,27 @@ uint32_t *throttle) #ifndef __OPENSTEP__ /* cctools-port: replaced __builtin_available */ @@ -47,10 +47,10 @@ index 1377657..2013ee6 100644 /* * The environment variable ZERO_AR_DATE is used here and other diff --git a/cctools/misc/libtool.c b/cctools/misc/libtool.c -index 22c824d..17dc6dd 100644 +index 3ab43a1..e098206 100644 --- a/cctools/misc/libtool.c +++ b/cctools/misc/libtool.c -@@ -1382,9 +1382,9 @@ char **envp) +@@ -1389,9 +1389,9 @@ char **envp) if (cmd_flags.D == FALSE && zero_ar_date == FALSE) { #ifndef __OPENSTEP__ /* cctools-port: replaced __builtin_available */ @@ -62,7 +62,7 @@ index 22c824d..17dc6dd 100644 #ifdef HAVE_CLOCK_GETTIME if (clock_gettime(CLOCK_REALTIME, &toc_timespec)) { system_fatal("clock_gettime failed"); -@@ -1392,9 +1392,9 @@ char **envp) +@@ -1399,9 +1399,9 @@ char **envp) } toc_time = toc_timespec.tv_sec; #endif /* HAVE_CLOCK_GETTIME */ @@ -74,7 +74,7 @@ index 22c824d..17dc6dd 100644 #ifndef HAVE_CLOCK_GETTIME if (gettimeofday(&toc_timeval, NULL)) { system_fatal("gettimeofday failed"); -@@ -1402,9 +1402,9 @@ char **envp) +@@ -1409,9 +1409,9 @@ char **envp) } toc_time = toc_timeval.tv_sec; #endif /* !HAVE_CLOCK_GETTIME */ @@ -86,6 +86,3 @@ index 22c824d..17dc6dd 100644 #else toc_time = time(NULL); #endif /* !defined(__OPENSTEP__) */ --- -2.38.1.windows.1 - diff --git a/recipe/patches/0004-Turn-off-outputIsMappableFile-when-building-to-osx-a.patch b/recipe/patches/0004-Turn-off-outputIsMappableFile-when-building-to-osx-a.patch index 21a57f2..8c40615 100644 --- a/recipe/patches/0004-Turn-off-outputIsMappableFile-when-building-to-osx-a.patch +++ b/recipe/patches/0004-Turn-off-outputIsMappableFile-when-building-to-osx-a.patch @@ -1,34 +1,31 @@ -From 5d6c783218d987da96ac96ede628970122eab0b1 Mon Sep 17 00:00:00 2001 +From 4bc8b0d61a4787ef302ddfc0ab6bc46b7804869d Mon Sep 17 00:00:00 2001 From: Eli Rykoff Date: Thu, 24 Feb 2022 21:16:24 -0800 -Subject: [PATCH 4/5] Turn off outputIsMappableFile when building to osx-arm64 +Subject: [PATCH 4/4] Turn off outputIsMappableFile when building to osx-arm64 --- cctools/ld64/src/ld/OutputFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cctools/ld64/src/ld/OutputFile.cpp b/cctools/ld64/src/ld/OutputFile.cpp -index c6b4270..6cd1591 100644 +index 36772bb..d79cd8a 100644 --- a/cctools/ld64/src/ld/OutputFile.cpp +++ b/cctools/ld64/src/ld/OutputFile.cpp -@@ -3805,7 +3805,7 @@ void OutputFile::writeOutputFile(ld::Internal& state) - // Don't use mmap on non-hfs volumes +@@ -3844,7 +3844,7 @@ void OutputFile::writeOutputFile(ld::Internal& state) #ifdef __APPLE__ // ld64-port + // Don't use mmap on non-hfs volumes struct statfs fsInfo; - if ( statfs(_options.outputFilePath(), &fsInfo) != -1 ) { -+ if ( (_options.architecture() != CPU_TYPE_ARM64) && (statfs(_options.outputFilePath(), &fsInfo) != -1) ) { - if ( (strcmp(fsInfo.f_fstypename, "hfs") == 0) || (strcmp(fsInfo.f_fstypename, "apfs") == 0) ) { - (void)unlink(_options.outputFilePath()); - outputIsMappableFile = true; -@@ -3835,7 +3835,7 @@ void OutputFile::writeOutputFile(ld::Internal& state) - end[1] = '\0'; ++ if ( (_options.architecture() != CPU_TYPE_ARM64) && (statfs(_options.outputFilePath(), &fsInfo) != -1) ) { + // + (void)unlink(_options.outputFilePath()); + +@@ -3878,7 +3878,7 @@ void OutputFile::writeOutputFile(ld::Internal& state) + strcpy(dirPath, "./"); // if no slashes path, then writing to cwd #ifdef __APPLE__ // ld64-port - struct statfs fsInfo; -- if ( statfs(dirPath, &fsInfo) != -1 ) { -+ if ( (_options.architecture() != CPU_TYPE_ARM64) && (statfs(dirPath, &fsInfo) != -1) ) { - if ( (strcmp(fsInfo.f_fstypename, "hfs") == 0) || (strcmp(fsInfo.f_fstypename, "apfs") == 0) ) { - outputIsMappableFile = true; - } --- -2.38.1.windows.1 - + struct statfs fsInfo; +- if ( statfs(dirPath, &fsInfo) != -1 ) { ++ if ( (_options.architecture() != CPU_TYPE_ARM64) && (statfs(dirPath, &fsInfo) != -1) ) { + if ( (strcmp(fsInfo.f_fstypename, "hfs") == 0) || (strcmp(fsInfo.f_fstypename, "apfs") == 0) ) { + outputIsMappableFile = true; + } diff --git a/recipe/patches/0005-don-t-try-to-include-__assert-for-NDEBUG-builds.patch b/recipe/patches/0005-don-t-try-to-include-__assert-for-NDEBUG-builds.patch deleted file mode 100644 index 020183d..0000000 --- a/recipe/patches/0005-don-t-try-to-include-__assert-for-NDEBUG-builds.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 875ab8090b8d645b4a9ca7e60753b4726959156a Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Tue, 14 Mar 2023 17:36:17 +1100 -Subject: [PATCH 5/5] don't try to include __assert for NDEBUG builds - ---- - cctools/ld64/src/3rd/helper.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/cctools/ld64/src/3rd/helper.c b/cctools/ld64/src/3rd/helper.c -index 179a233..37b0e2b 100644 ---- a/cctools/ld64/src/3rd/helper.c -+++ b/cctools/ld64/src/3rd/helper.c -@@ -37,6 +37,7 @@ const char ldVersionString[] = "@(#)PROGRAM:ld PROJECT:ld64-" STRINGIFY(LD64_VE - - void __assert_rtn(const char *func, const char *file, int line, const char *msg) - { -+#ifndef NDEBUG - #if defined(__FreeBSD__) || defined(__DragonFly__) - __assert(msg, file, line, func); - #elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) -@@ -48,6 +49,7 @@ void __assert_rtn(const char *func, const char *file, int line, const char *msg) - fflush(NULL); - abort(); - #endif /* __FreeBSD__ */ -+#endif /* NDEBUG */ - } - - int _NSGetExecutablePath(char *epath, unsigned int *size) --- -2.38.1.windows.1 -