From a812bac82e8b3060c0cf9fcde1388278773c90a4 Mon Sep 17 00:00:00 2001 From: greatbridf Date: Fri, 6 Dec 2024 20:43:41 +0800 Subject: [PATCH 1/2] Remove redefinitions in gcc source tree. Removed redefinitions of toupper etc. in gcc source tree that conflict with new macOS headers. --- .../gcc-9.2.0/0050-remove-extra-defines.diff | 51 +++++++++++++++++++ .../gcc-9.4.0/0021-remove-extra-defines.diff | 51 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 patches/gcc-9.2.0/0050-remove-extra-defines.diff create mode 100644 patches/gcc-9.4.0/0021-remove-extra-defines.diff diff --git a/patches/gcc-9.2.0/0050-remove-extra-defines.diff b/patches/gcc-9.2.0/0050-remove-extra-defines.diff new file mode 100644 index 0000000..5107016 --- /dev/null +++ b/patches/gcc-9.2.0/0050-remove-extra-defines.diff @@ -0,0 +1,51 @@ +diff --git a/gcc/config.host b/gcc/config.host +index 816a0f0..030e829 100644 +--- a/gcc/config.host ++++ b/gcc/config.host +@@ -93,8 +93,8 @@ esac + case ${host} in + *-darwin*) + # Generic darwin host support. +- out_host_hook_obj=host-darwin.o +- host_xmake_file="${host_xmake_file} x-darwin" ++ # out_host_hook_obj=host-darwin.o ++ # host_xmake_file="${host_xmake_file} x-darwin" + ;; + esac + +diff --git a/include/safe-ctype.h b/include/safe-ctype.h +index b6d585c..1f4c47f 100644 +--- a/include/safe-ctype.h ++++ b/include/safe-ctype.h +@@ -120,31 +120,5 @@ extern const unsigned char _sch_tolower[256]; + So we include ctype.h here and then immediately redefine its macros. */ + + #include +-#undef isalpha +-#define isalpha(c) do_not_use_isalpha_with_safe_ctype +-#undef isalnum +-#define isalnum(c) do_not_use_isalnum_with_safe_ctype +-#undef iscntrl +-#define iscntrl(c) do_not_use_iscntrl_with_safe_ctype +-#undef isdigit +-#define isdigit(c) do_not_use_isdigit_with_safe_ctype +-#undef isgraph +-#define isgraph(c) do_not_use_isgraph_with_safe_ctype +-#undef islower +-#define islower(c) do_not_use_islower_with_safe_ctype +-#undef isprint +-#define isprint(c) do_not_use_isprint_with_safe_ctype +-#undef ispunct +-#define ispunct(c) do_not_use_ispunct_with_safe_ctype +-#undef isspace +-#define isspace(c) do_not_use_isspace_with_safe_ctype +-#undef isupper +-#define isupper(c) do_not_use_isupper_with_safe_ctype +-#undef isxdigit +-#define isxdigit(c) do_not_use_isxdigit_with_safe_ctype +-#undef toupper +-#define toupper(c) do_not_use_toupper_with_safe_ctype +-#undef tolower +-#define tolower(c) do_not_use_tolower_with_safe_ctype + + #endif /* SAFE_CTYPE_H */ diff --git a/patches/gcc-9.4.0/0021-remove-extra-defines.diff b/patches/gcc-9.4.0/0021-remove-extra-defines.diff new file mode 100644 index 0000000..5107016 --- /dev/null +++ b/patches/gcc-9.4.0/0021-remove-extra-defines.diff @@ -0,0 +1,51 @@ +diff --git a/gcc/config.host b/gcc/config.host +index 816a0f0..030e829 100644 +--- a/gcc/config.host ++++ b/gcc/config.host +@@ -93,8 +93,8 @@ esac + case ${host} in + *-darwin*) + # Generic darwin host support. +- out_host_hook_obj=host-darwin.o +- host_xmake_file="${host_xmake_file} x-darwin" ++ # out_host_hook_obj=host-darwin.o ++ # host_xmake_file="${host_xmake_file} x-darwin" + ;; + esac + +diff --git a/include/safe-ctype.h b/include/safe-ctype.h +index b6d585c..1f4c47f 100644 +--- a/include/safe-ctype.h ++++ b/include/safe-ctype.h +@@ -120,31 +120,5 @@ extern const unsigned char _sch_tolower[256]; + So we include ctype.h here and then immediately redefine its macros. */ + + #include +-#undef isalpha +-#define isalpha(c) do_not_use_isalpha_with_safe_ctype +-#undef isalnum +-#define isalnum(c) do_not_use_isalnum_with_safe_ctype +-#undef iscntrl +-#define iscntrl(c) do_not_use_iscntrl_with_safe_ctype +-#undef isdigit +-#define isdigit(c) do_not_use_isdigit_with_safe_ctype +-#undef isgraph +-#define isgraph(c) do_not_use_isgraph_with_safe_ctype +-#undef islower +-#define islower(c) do_not_use_islower_with_safe_ctype +-#undef isprint +-#define isprint(c) do_not_use_isprint_with_safe_ctype +-#undef ispunct +-#define ispunct(c) do_not_use_ispunct_with_safe_ctype +-#undef isspace +-#define isspace(c) do_not_use_isspace_with_safe_ctype +-#undef isupper +-#define isupper(c) do_not_use_isupper_with_safe_ctype +-#undef isxdigit +-#define isxdigit(c) do_not_use_isxdigit_with_safe_ctype +-#undef toupper +-#define toupper(c) do_not_use_toupper_with_safe_ctype +-#undef tolower +-#define tolower(c) do_not_use_tolower_with_safe_ctype + + #endif /* SAFE_CTYPE_H */ From da8e626ac28ab7319bb5260361896ec87f10230f Mon Sep 17 00:00:00 2001 From: greatbridf Date: Fri, 6 Dec 2024 21:39:09 +0800 Subject: [PATCH 2/2] Remove the patch for old version of gcc --- .../gcc-9.2.0/0050-remove-extra-defines.diff | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 patches/gcc-9.2.0/0050-remove-extra-defines.diff diff --git a/patches/gcc-9.2.0/0050-remove-extra-defines.diff b/patches/gcc-9.2.0/0050-remove-extra-defines.diff deleted file mode 100644 index 5107016..0000000 --- a/patches/gcc-9.2.0/0050-remove-extra-defines.diff +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/gcc/config.host b/gcc/config.host -index 816a0f0..030e829 100644 ---- a/gcc/config.host -+++ b/gcc/config.host -@@ -93,8 +93,8 @@ esac - case ${host} in - *-darwin*) - # Generic darwin host support. -- out_host_hook_obj=host-darwin.o -- host_xmake_file="${host_xmake_file} x-darwin" -+ # out_host_hook_obj=host-darwin.o -+ # host_xmake_file="${host_xmake_file} x-darwin" - ;; - esac - -diff --git a/include/safe-ctype.h b/include/safe-ctype.h -index b6d585c..1f4c47f 100644 ---- a/include/safe-ctype.h -+++ b/include/safe-ctype.h -@@ -120,31 +120,5 @@ extern const unsigned char _sch_tolower[256]; - So we include ctype.h here and then immediately redefine its macros. */ - - #include --#undef isalpha --#define isalpha(c) do_not_use_isalpha_with_safe_ctype --#undef isalnum --#define isalnum(c) do_not_use_isalnum_with_safe_ctype --#undef iscntrl --#define iscntrl(c) do_not_use_iscntrl_with_safe_ctype --#undef isdigit --#define isdigit(c) do_not_use_isdigit_with_safe_ctype --#undef isgraph --#define isgraph(c) do_not_use_isgraph_with_safe_ctype --#undef islower --#define islower(c) do_not_use_islower_with_safe_ctype --#undef isprint --#define isprint(c) do_not_use_isprint_with_safe_ctype --#undef ispunct --#define ispunct(c) do_not_use_ispunct_with_safe_ctype --#undef isspace --#define isspace(c) do_not_use_isspace_with_safe_ctype --#undef isupper --#define isupper(c) do_not_use_isupper_with_safe_ctype --#undef isxdigit --#define isxdigit(c) do_not_use_isxdigit_with_safe_ctype --#undef toupper --#define toupper(c) do_not_use_toupper_with_safe_ctype --#undef tolower --#define tolower(c) do_not_use_tolower_with_safe_ctype - - #endif /* SAFE_CTYPE_H */