forked from macports/macports-ports
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds 2 patches to make gcc14 build on Tiger. The patches correspond to the following upstream bugs: 1. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117834 2. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117857
- Loading branch information
Showing
3 changed files
with
103 additions
and
0 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
33 changes: 33 additions & 0 deletions
33
lang/gcc14/files/darwin8-define-PTHREAD_RWLOCK_INITIALIZER.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,33 @@ | ||
From c86f77d40e74cbbd6bc2bb4b2d8aaa30bac04f23 Mon Sep 17 00:00:00 2001 | ||
From: Gleb Mazovetskiy <[email protected]> | ||
Date: Thu, 28 Nov 2024 16:00:06 +0000 | ||
Subject: [PATCH] define PTHREAD_RWLOCK_INITIALIZER | ||
|
||
Per https://github.com/macports/macports-ports/pull/26655#issuecomment-2506351012 | ||
|
||
Remove this patch once | ||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117834 is resolved | ||
--- | ||
libgcc/gthr-posix.h | 6 ++++++ | ||
1 file changed, 6 insertions(+) | ||
|
||
diff --git libgcc/gthr-posix.h libgcc/gthr-posix.h | ||
index 82e8f9ffcf6..f87283cb0e4 100644 | ||
--- libgcc/gthr-posix.h | ||
+++ libgcc/gthr-posix.h | ||
@@ -62,6 +62,12 @@ typedef struct timespec __gthread_time_t; | ||
#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER | ||
#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function | ||
#ifndef __cplusplus | ||
+#ifndef PTHREAD_RWLOCK_INITIALIZER | ||
+#ifndef _PTHREAD_RWLOCK_SIG_init | ||
+#define _PTHREAD_RWLOCK_SIG_init 0x2DA8B3B4 | ||
+#endif | ||
+#define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWLOCK_SIG_init, {0}} | ||
+#endif | ||
#define __GTHREAD_RWLOCK_INIT PTHREAD_RWLOCK_INITIALIZER | ||
#endif | ||
#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT | ||
-- | ||
2.43.0 | ||
|
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,62 @@ | ||
From 7abb2866863471eb6252ebec67ac2de56abda0db Mon Sep 17 00:00:00 2001 | ||
From: Gleb Mazovetskiy <[email protected]> | ||
Date: Sat, 30 Nov 2024 08:57:43 +0000 | ||
Subject: [PATCH] darwin8 ttyname_r patch | ||
|
||
--- | ||
libgfortran/io/unix.c | 7 +++++++ | ||
.../sanitizer_common_interceptors.inc | 12 ++++++++++++ | ||
2 files changed, 19 insertions(+) | ||
|
||
diff --git libgfortran/io/unix.c libgfortran/io/unix.c | ||
index 16600c855f2..80d2fad7ef8 100644 | ||
--- libgfortran/io/unix.c | ||
+++ libgfortran/io/unix.c | ||
@@ -2094,7 +2094,14 @@ stream_ttyname (stream *s __attribute__ ((unused)), | ||
size_t buflen __attribute__ ((unused))) | ||
{ | ||
#ifdef HAVE_TTYNAME_R | ||
+#if __DARWIN_UNIX03 | ||
return ttyname_r (((unix_stream *)s)->fd, buf, buflen); | ||
+#else | ||
+ char *p = ttyname_r (((unix_stream *)s)->fd, buf, buflen); | ||
+ if (!p) | ||
+ return errno; | ||
+ return 0; | ||
+#endif | ||
#elif defined HAVE_TTYNAME | ||
char *p; | ||
size_t plen; | ||
diff --git libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc | ||
index 607ecae6808..2d2fceedf79 100644 | ||
--- libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc | ||
+++ libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc | ||
@@ -5036,6 +5036,7 @@ INTERCEPTOR(char *, ttyname, int fd) { | ||
#endif | ||
|
||
#if SANITIZER_INTERCEPT_TTYNAME_R | ||
+#if __DARWIN_UNIX03 | ||
INTERCEPTOR(int, ttyname_r, int fd, char *name, SIZE_T namesize) { | ||
void *ctx; | ||
COMMON_INTERCEPTOR_ENTER(ctx, ttyname_r, fd, name, namesize); | ||
@@ -5044,6 +5045,17 @@ INTERCEPTOR(int, ttyname_r, int fd, char *name, SIZE_T namesize) { | ||
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, internal_strlen(name) + 1); | ||
return res; | ||
} | ||
+#else | ||
+INTERCEPTOR(char*, ttyname_r, int fd, char *name, SIZE_T namesize) { | ||
+ void *ctx; | ||
+ COMMON_INTERCEPTOR_ENTER(ctx, ttyname_r, fd, name, namesize); | ||
+ char *res = REAL(ttyname_r)(fd, name, namesize); | ||
+ if (res != nullptr) | ||
+ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, name, internal_strlen(name) + 1); | ||
+ return res; | ||
+} | ||
+#endif | ||
+ | ||
#define INIT_TTYNAME_R COMMON_INTERCEPT_FUNCTION(ttyname_r); | ||
#else | ||
#define INIT_TTYNAME_R | ||
-- | ||
2.43.0 | ||
|