-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #307880 from reckenrode/ld64
cctools: 973.0.1 -> 1010.6
- Loading branch information
Showing
54 changed files
with
3,150 additions
and
1,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
pkgs/by-name/cc/cctools/0001-Fix-build-issues-with-misc-redo_prebinding.c.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
From 55b2a5fcc38eb62f53e155bd8c741481690f1c73 Mon Sep 17 00:00:00 2001 | ||
From: Randy Eckenrode <randy@largeandhighquality.com> | ||
Date: Wed, 10 Apr 2024 19:08:39 -0400 | ||
Subject: [PATCH 1/6] Fix build issues with misc/redo_prebinding.c | ||
|
||
- Add missing headers; and | ||
- Add missing arguments to `writeout`. | ||
--- | ||
misc/redo_prebinding.c | 7 ++++--- | ||
1 file changed, 4 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/misc/redo_prebinding.c b/misc/redo_prebinding.c | ||
index a5a3c81..9d0f4c8 100644 | ||
--- a/misc/redo_prebinding.c | ||
+++ b/misc/redo_prebinding.c | ||
@@ -83,6 +83,7 @@ | ||
#include <mach-o/redo_prebinding.h> | ||
#endif /* defined(LIBRARY_API) */ | ||
|
||
+#import <stdint.h> | ||
#import <stdio.h> | ||
#import <stdlib.h> | ||
#import <string.h> | ||
@@ -106,7 +107,7 @@ | ||
#import <stuff/hppa.h> | ||
#import <stuff/execute.h> | ||
#import <stuff/guess_short_name.h> | ||
-//#import <stuff/seg_addr_table.h> | ||
+#import <stuff/seg_addr_table.h> | ||
#import <stuff/macosx_deployment_target.h> | ||
|
||
#include <mach-o/dyld.h> | ||
@@ -918,7 +919,7 @@ char *envp[]) | ||
if(write_to_stdout) | ||
output_file = NULL; | ||
writeout(archs, narchs, output_file, mode, TRUE, FALSE, FALSE, | ||
- FALSE, NULL); | ||
+ FALSE, FALSE, NULL); | ||
if(errors){ | ||
if(write_to_stdout == FALSE) | ||
unlink(output_file); | ||
@@ -928,7 +929,7 @@ char *envp[]) | ||
else{ | ||
output_file = makestr(input_file, ".redo_prebinding", NULL); | ||
writeout(archs, narchs, output_file, mode, TRUE, FALSE, FALSE, | ||
- FALSE, NULL); | ||
+ FALSE, FALSE, NULL); | ||
if(errors){ | ||
unlink(output_file); | ||
return(2); | ||
-- | ||
2.45.2 | ||
|
25 changes: 25 additions & 0 deletions
25
pkgs/by-name/cc/cctools/0002-Rely-on-libcd_is_blob_a_linker_signature.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 419c469634891d09f6688d56da9e26431018f342 Mon Sep 17 00:00:00 2001 | ||
From: Randy Eckenrode <randy@largeandhighquality.com> | ||
Date: Wed, 10 Apr 2024 20:36:53 -0400 | ||
Subject: [PATCH 2/6] Rely on libcd_is_blob_a_linker_signature | ||
|
||
--- | ||
libstuff/code_directory.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/libstuff/code_directory.c b/libstuff/code_directory.c | ||
index 7c158fa..3b8eb77 100644 | ||
--- a/libstuff/code_directory.c | ||
+++ b/libstuff/code_directory.c | ||
@@ -146,7 +146,7 @@ static const char* format_version_xyz(uint32_t version) | ||
*/ | ||
int codedir_is_linker_signed(const char* data, uint32_t size) | ||
{ | ||
-#if 1 | ||
+#if 0 | ||
// HACK: libcodedirectory.h is in both the macOS SDK in /usr/local/include, and in the tool chain at /usr/include. | ||
// but there is no way to control clang's search path to look in the toolchain first. | ||
// So, declare newer API locally. Once this new header is in all SDKs we can remove this. | ||
-- | ||
2.45.2 | ||
|
50 changes: 50 additions & 0 deletions
50
pkgs/by-name/cc/cctools/0003-Fix-utimensat-compatability-with-the-10.12-SDK.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
From 989ba5e30cefa0dd8990da158661713c4a21c0fe Mon Sep 17 00:00:00 2001 | ||
From: Randy Eckenrode <randy@largeandhighquality.com> | ||
Date: Thu, 11 Apr 2024 18:05:34 -0400 | ||
Subject: [PATCH 3/6] Fix utimensat compatability with the 10.12 SDK | ||
|
||
--- | ||
include/compat.h | 3 +++ | ||
libstuff/writeout.c | 2 +- | ||
misc/lipo.c | 2 +- | ||
3 files changed, 5 insertions(+), 2 deletions(-) | ||
create mode 100644 include/compat.h | ||
|
||
diff --git a/include/compat.h b/include/compat.h | ||
new file mode 100644 | ||
index 0000000..8b1b866 | ||
--- /dev/null | ||
+++ b/include/compat.h | ||
@@ -0,0 +1,3 @@ | ||
+#pragma once | ||
+#include <time.h> | ||
+extern int utimensat(int dirfd, const char* pathname, const struct timespec times[_Nullable 2], int flags); | ||
diff --git a/libstuff/writeout.c b/libstuff/writeout.c | ||
index f904caa..03fa535 100644 | ||
--- a/libstuff/writeout.c | ||
+++ b/libstuff/writeout.c | ||
@@ -297,7 +297,7 @@ no_throttle: | ||
* have been zeroed out when the library was created. writeout | ||
* will not zero out the modification time in the filesystem. | ||
*/ | ||
- if (__builtin_available(macOS 10.12, *)) { | ||
+ if (__builtin_available(macOS 10.13, *)) { | ||
struct timespec times[2] = {0}; | ||
memcpy(×[0], &toc_timespec, sizeof(struct timespec)); | ||
memcpy(×[1], &toc_timespec, sizeof(struct timespec)); | ||
diff --git a/misc/lipo.c b/misc/lipo.c | ||
index 04a3eca..887c049 100644 | ||
--- a/misc/lipo.c | ||
+++ b/misc/lipo.c | ||
@@ -607,7 +607,7 @@ unknown_flag: | ||
if(close(fd) == -1) | ||
system_fatal("can't close output file: %s",output_file); | ||
#ifndef __OPENSTEP__ | ||
- if (__builtin_available(macOS 10.12, *)) { | ||
+ if (__builtin_available(macOS 10.13, *)) { | ||
time_result = utimensat(AT_FDCWD, output_file, | ||
output_times, 0); | ||
} | ||
-- | ||
2.45.2 | ||
|
57 changes: 57 additions & 0 deletions
57
pkgs/by-name/cc/cctools/0004-Use-nixpkgs-clang-with-the-assembler-driver.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
From 86b5ad551ef0ffc7ca4da24b7619937bec738522 Mon Sep 17 00:00:00 2001 | ||
From: Randy Eckenrode <randy@largeandhighquality.com> | ||
Date: Mon, 15 Apr 2024 20:47:59 -0400 | ||
Subject: [PATCH 4/6] Use nixpkgs clang with the assembler driver | ||
|
||
--- | ||
as/driver.c | 20 +++----------------- | ||
1 file changed, 3 insertions(+), 17 deletions(-) | ||
|
||
diff --git a/as/driver.c b/as/driver.c | ||
index a0d49ad..c15dcbf 100644 | ||
--- a/as/driver.c | ||
+++ b/as/driver.c | ||
@@ -36,7 +36,7 @@ char **envp) | ||
char *p, c, *arch_name, *as, *as_local; | ||
char **new_argv; | ||
const char *CLANG = "clang"; | ||
- char *prefix, buf[MAXPATHLEN], resolved_name[PATH_MAX]; | ||
+ char *prefix = "@clang-unwrapped@/bin/"; | ||
uint32_t bufsize; | ||
struct arch_flag arch_flag; | ||
const struct arch_flag *arch_flags, *family_arch_flag; | ||
@@ -50,22 +50,6 @@ char **envp) | ||
qflag = FALSE; | ||
Qflag = FALSE; | ||
some_input_files = FALSE; | ||
- /* | ||
- * Construct the prefix to the assembler driver. | ||
- */ | ||
- bufsize = MAXPATHLEN; | ||
- p = buf; | ||
- i = _NSGetExecutablePath(p, &bufsize); | ||
- if(i == -1){ | ||
- p = allocate(bufsize); | ||
- _NSGetExecutablePath(p, &bufsize); | ||
- } | ||
- prefix = realpath(p, resolved_name); | ||
- if(prefix == NULL) | ||
- system_fatal("realpath(3) for %s failed", p); | ||
- p = rindex(prefix, '/'); | ||
- if(p != NULL) | ||
- p[1] = '\0'; | ||
/* | ||
* Process the assembler flags exactly like the assembler would (except | ||
* let the assembler complain about multiple flags, bad combinations of | ||
@@ -362,6 +346,8 @@ char **envp) | ||
exit(1); | ||
} | ||
|
||
+ prefix = "@gas@/bin/"; /* `libexec` is found relative to the assembler driver’s path. */ | ||
+ | ||
/* | ||
* If this assembler exist try to run it else print an error message. | ||
*/ | ||
-- | ||
2.45.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From e62f7d75380540937f24f896c82736a1e653cc75 Mon Sep 17 00:00:00 2001 | ||
From: Randy Eckenrode <randy@largeandhighquality.com> | ||
Date: Mon, 22 Apr 2024 18:15:53 -0400 | ||
Subject: [PATCH 5/6] Find ld64 in the store | ||
|
||
--- | ||
libstuff/execute.c | 5 +++++ | ||
1 file changed, 5 insertions(+) | ||
|
||
diff --git a/libstuff/execute.c b/libstuff/execute.c | ||
index 8526ab7..abbbf1b 100644 | ||
--- a/libstuff/execute.c | ||
+++ b/libstuff/execute.c | ||
@@ -149,6 +149,11 @@ char * | ||
cmd_with_prefix( | ||
char *str) | ||
{ | ||
+ // Return the path to ld64 in the store. | ||
+ if (strcmp(str, "ld") == 0) { | ||
+ return "@ld64_path@"; | ||
+ } | ||
+ | ||
int i; | ||
char *p; | ||
char *prefix, buf[MAXPATHLEN], resolved_name[PATH_MAX]; | ||
-- | ||
2.45.2 | ||
|
30 changes: 30 additions & 0 deletions
30
pkgs/by-name/cc/cctools/0006-Support-target-prefixes-in-ranlib-detection.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From e25de788260051892b9e34177ea957cbafe6c415 Mon Sep 17 00:00:00 2001 | ||
From: Randy Eckenrode <randy@largeandhighquality.com> | ||
Date: Thu, 2 May 2024 07:55:05 -0400 | ||
Subject: [PATCH 6/6] Support target prefixes in ranlib detection | ||
|
||
--- | ||
misc/libtool.c | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/misc/libtool.c b/misc/libtool.c | ||
index 289ec4d..8265d53 100644 | ||
--- a/misc/libtool.c | ||
+++ b/misc/libtool.c | ||
@@ -426,11 +426,11 @@ char **envp) | ||
p++; | ||
else | ||
p = argv[0]; | ||
- if(strncmp(p, "ranlib", sizeof("ranlib") - 1) == 0) { | ||
+ if(strncmp(p, "@targetPrefix@ranlib", sizeof("@targetPrefix@ranlib") - 1) == 0) { | ||
cmd_flags.ranlib = TRUE; | ||
} | ||
else if (getenv("LIBTOOL_FORCE_RANLIB")) { | ||
- progname = "ranlib"; | ||
+ progname = "@targetPrefix@ranlib"; | ||
cmd_flags.ranlib = TRUE; | ||
} | ||
|
||
-- | ||
2.45.2 | ||
|
Oops, something went wrong.