Skip to content

Commit

Permalink
gcc14: update to gcc-14.1-darwin-r1 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
cjones051073 committed Jul 9, 2024
1 parent d4bf548 commit 56c6f00
Show file tree
Hide file tree
Showing 2 changed files with 266 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lang/gcc14/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ if { ${subport} ne ${libcxxname} && ${os.platform} eq "darwin" } {

if { ${os.platform} eq "darwin" } {
# Patch generated from https://github.com/iains/gcc-14-branch
# git diff --no-prefix releases/gcc-14.1.0 gcc-14.1-darwin-r0
# git diff --no-prefix releases/gcc-14.1.0 gcc-14.1-darwin-r1
patchfiles-append patch-darwin-gcc-${version}.diff
# GCC fixinc work-around for sys/ucred.h on OSX10.14.4 no longer seems to work ???
if { ${os.major} == 18 } {
Expand Down
267 changes: 265 additions & 2 deletions lang/gcc14/files/patch-darwin-gcc-14.1.0.diff
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git README.md README.md
new file mode 100644
index 00000000000..6584ea4b009
index 00000000000..3a5fd89a399
--- /dev/null
+++ README.md
@@ -0,0 +1,29 @@
@@ -0,0 +1,33 @@
+# This is a branch of GCC-14.1 supporting AArch64(Arm64) on Darwin.
+
+The branch is suitable for powerpc, i686, x86_64 and aarch64 Darwin from Darwin9 (MacOSX 10.5) through Darwin23 (macOS 14 / Sonoma) on architectures relevant to each version.
Expand All @@ -20,6 +20,10 @@ index 00000000000..6584ea4b009
+Please see gcc/config/aarch64/darwinpcs.md for a description of the AArch64 ABI
+support.
+
+**_The current release is GCC-14.1-darwin-r1. (June 2024)_**
+
+This is a bugfix release; since we now have support for handling the availability attribute, we need to remove the `fixincludes` that corrected missing cases.
+
+**_The current release is GCC-14.1-darwin-r0. (May 2024)_**
+
+This release:
Expand Down Expand Up @@ -59,6 +63,265 @@ index 042681c27be..21218446587 100644
powerpc-*-darwin*)
;;
i[[3456789]]86-*-darwin*)
diff --git fixincludes/fixincl.x fixincludes/fixincl.x
index e52f11d8460..8adc6bda2a3 100644
--- fixincludes/fixincl.x
+++ fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed August 17, 2023 at 10:16:38 AM by AutoGen 5.18.12
+ * It has been AutoGen-ed May 13, 2024 at 05:50:22 PM by AutoGen 5.18.7
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Aug 17 10:16:38 CEST 2023
+/* DO NOT SVN-MERGE THIS FILE, EITHER Mon May 13 17:50:22 BST 2024
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 274 fixup descriptions.
+ * This file contains 272 fixup descriptions.
*
* See README for more information.
*
@@ -267,56 +267,6 @@ static const char* apzAab_Darwin7_9_Long_Double_FuncsPatch[] = {
#endif /* __MATH__ */",
(char*)NULL };

-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Description of Darwin_Api_Availability fix
- */
-tSCC zDarwin_Api_AvailabilityName[] =
- "darwin_api_availability";
-
-/*
- * File name selection pattern
- */
-tSCC zDarwin_Api_AvailabilityList[] =
- "os/availability.h\0";
-/*
- * Machine/OS name selection pattern
- */
-tSCC* apzDarwin_Api_AvailabilityMachs[] = {
- "*-*-darwin*",
- (const char*)NULL };
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zDarwin_Api_AvailabilitySelect0[] =
- " *#define __API_AVAILABLE.*\n\
- *#define __API_DEPRECATED.*\n\
- *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n\
- *#define __API_UNAVAILABLE.*\n";
-
-/*
- * content bypass pattern - skip fix if pattern found
- */
-tSCC zDarwin_Api_AvailabilityBypass0[] =
- "__IPHONE_OS_VERSION_MIN_REQUIRED";
-
-#define DARWIN_API_AVAILABILITY_TEST_CT 2
-static tTestDesc aDarwin_Api_AvailabilityTests[] = {
- { TT_NEGREP, zDarwin_Api_AvailabilityBypass0, (regex_t*)NULL },
- { TT_EGREP, zDarwin_Api_AvailabilitySelect0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Darwin_Api_Availability
- */
-static const char* apzDarwin_Api_AvailabilityPatch[] = {
- "format",
- " #define API_AVAILABLE(...)\n\
- #define API_DEPRECATED(...)\n\
- #define API_DEPRECATED_WITH_REPLACEMENT(...)\n\
- #define API_UNAVAILABLE(...)\n",
- (char*)NULL };
-
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Aab_Fd_Zero_Asm_Posix_Types_H fix
@@ -2763,51 +2713,6 @@ extern \"C\" {\n\
#endif\n",
(char*)NULL };

-/* * * * * * * * * * * * * * * * * * * * * * * * * *
- *
- * Description of Darwin_Availabilityinternal fix
- */
-tSCC zDarwin_AvailabilityinternalName[] =
- "darwin_availabilityinternal";
-
-/*
- * File name selection pattern
- */
-tSCC zDarwin_AvailabilityinternalList[] =
- "AvailabilityInternal.h\0";
-/*
- * Machine/OS name selection pattern
- */
-tSCC* apzDarwin_AvailabilityinternalMachs[] = {
- "*-*-darwin*",
- (const char*)NULL };
-
-/*
- * content selection pattern - do fix if pattern found
- */
-tSCC zDarwin_AvailabilityinternalSelect0[] =
- "#define[ \t]+(__API_[ADU]\\([^)]*\\)).*";
-
-#define DARWIN_AVAILABILITYINTERNAL_TEST_CT 1
-static tTestDesc aDarwin_AvailabilityinternalTests[] = {
- { TT_EGREP, zDarwin_AvailabilityinternalSelect0, (regex_t*)NULL }, };
-
-/*
- * Fix Command Arguments for Darwin_Availabilityinternal
- */
-static const char* apzDarwin_AvailabilityinternalPatch[] = {
- "format",
- "#if defined(__has_attribute)\n\
- #if __has_attribute(availability)\n\
-%0\n\
- #else\n\
- #define %1\n\
- #endif\n\
-#else\n\
- #define %1\n\
-#endif",
- (char*)NULL };
-
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Description of Darwin_9_Long_Double_Funcs_2 fix
@@ -11169,9 +11074,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 313
+#define REGEX_COUNT 310
#define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT 274
+#define FIX_COUNT 272

/*
* Enumerate the fixes
@@ -11180,7 +11085,6 @@ typedef enum {
AAB_AIX_STDIO_FIXIDX,
AAB_AIX_FCNTL_FIXIDX,
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_FIXIDX,
- DARWIN_API_AVAILABILITY_FIXIDX,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX,
AAB_FD_ZERO_GNU_TYPES_H_FIXIDX,
AAB_FD_ZERO_SELECTBITS_H_FIXIDX,
@@ -11242,7 +11146,6 @@ typedef enum {
CTRL_QUOTES_DEF_FIXIDX,
CTRL_QUOTES_USE_FIXIDX,
CXX_UNREADY_FIXIDX,
- DARWIN_AVAILABILITYINTERNAL_FIXIDX,
DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
DARWIN_EXTERNC_FIXIDX,
DARWIN_GCC4_BREAKAGE_FIXIDX,
@@ -11469,11 +11372,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
AAB_DARWIN7_9_LONG_DOUBLE_FUNCS_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
aAab_Darwin7_9_Long_Double_FuncsTests, apzAab_Darwin7_9_Long_Double_FuncsPatch, 0 },

- { zDarwin_Api_AvailabilityName, zDarwin_Api_AvailabilityList,
- apzDarwin_Api_AvailabilityMachs,
- DARWIN_API_AVAILABILITY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aDarwin_Api_AvailabilityTests, apzDarwin_Api_AvailabilityPatch, 0 },
-
{ zAab_Fd_Zero_Asm_Posix_Types_HName, zAab_Fd_Zero_Asm_Posix_Types_HList,
apzAab_Fd_Zero_Asm_Posix_Types_HMachs,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
@@ -11779,11 +11677,6 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
CXX_UNREADY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aCxx_UnreadyTests, apzCxx_UnreadyPatch, 0 },

- { zDarwin_AvailabilityinternalName, zDarwin_AvailabilityinternalList,
- apzDarwin_AvailabilityinternalMachs,
- DARWIN_AVAILABILITYINTERNAL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
- aDarwin_AvailabilityinternalTests, apzDarwin_AvailabilityinternalPatch, 0 },
-
{ zDarwin_9_Long_Double_Funcs_2Name, zDarwin_9_Long_Double_Funcs_2List,
apzDarwin_9_Long_Double_Funcs_2Machs,
DARWIN_9_LONG_DOUBLE_FUNCS_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git fixincludes/inclhack.def fixincludes/inclhack.def
index 19e0ea2df66..9df2abbff7b 100644
--- fixincludes/inclhack.def
+++ fixincludes/inclhack.def
@@ -194,33 +194,6 @@ fix = {
_EndOfHeader_;
};

-/*
- * SDKs for 10.13 and 10.14 omit the definitions for API_AVAILABLE where
- * __attribute__((availability)) is not supported.
- */
-fix = {
- hackname = darwin_api_availability;
- mach = "*-*-darwin*";
- files = os/availability.h;
- bypass = "__IPHONE_OS_VERSION_MIN_REQUIRED";
- select =
- " *#define __API_AVAILABLE.*\n"
- " *#define __API_DEPRECATED.*\n"
- " *#define __API_DEPRECATED_WITH_REPLACEMENT.*\n"
- " *#define __API_UNAVAILABLE.*\n";
- c_fix = format;
- c_fix_arg =
- " #define API_AVAILABLE(...)\n"
- " #define API_DEPRECATED(...)\n"
- " #define API_DEPRECATED_WITH_REPLACEMENT(...)\n"
- " #define API_UNAVAILABLE(...)\n";
- test_text =
- "#define __API_AVAILABLE(...)\n"
- "#define __API_DEPRECATED(...)\n"
- "#define __API_DEPRECATED_WITH_REPLACEMENT(...)\n"
- "#define __API_UNAVAILABLE(...)\n";
-};
-
/*
* This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
*/
@@ -1350,32 +1323,6 @@ fix = {
test_text = "extern void* malloc( size_t );";
};

-/*
- * macOS 10.12 <AvailabilityInternal.h> uses __attribute__((availability))
- * unconditionally.
- */
-fix = {
- hackname = darwin_availabilityinternal;
- mach = "*-*-darwin*";
- files = AvailabilityInternal.h;
- select = "#define[ \t]+(__API_[ADU]\\([^)]*\\)).*";
- c_fix = format;
- c_fix_arg = <<- _EOFix_
- #if defined(__has_attribute)
- #if __has_attribute(availability)
- %0
- #else
- #define %1
- #endif
- #else
- #define %1
- #endif
- _EOFix_;
-
- test_text = "#define __API_A(x) __attribute__((availability(__API_AVAILABLE_PLATFORM_##x)))\n"
- "#define __API_D(msg,x) __attribute__((availability(__API_DEPRECATED_PLATFORM_##x,message=msg)))";
-};
-
/*
* For the AAB_darwin7_9_long_double_funcs fix (and later fixes for long long)
* to be useful, the main math.h must use <> and not "" includes.
diff --git gcc/ada/init.c gcc/ada/init.c
index 7cf77471f1d..8d5acdd6fb6 100644
--- gcc/ada/init.c
Expand Down

0 comments on commit 56c6f00

Please sign in to comment.