Ticket #45449: llvm-gcc42-yosemite.patch
File llvm-gcc42-yosemite.patch, 9.6 KB (added by jhowarth@…, 10 years ago) |
---|
-
gcc/config/darwin-c.c
diff -uNr llvmgcc42-2336.11.orig/gcc/config/darwin-c.c llvmgcc42-2336.11/gcc/config/darwin-c.c
old new 817 817 } 818 818 819 819 /* Return the value of darwin_macosx_version_min suitable for the 820 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, 821 so '10.4.2' becomes 1042. 820 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, so '10.4.2' 821 becomes 1040 and '10.10.0' becomes 101000. The lowest digit is 822 always zero, as is the second lowest for '10.10.x' and above. 822 823 Print a warning if the version number is not known. */ 823 824 static const char * 824 825 /* APPLE LOCAL ARM 5683689 */ 825 826 macosx_version_as_macro (void) 826 827 { 827 static char result[] = "1000"; 828 static char result[7] = "1000"; 829 int minorDigitIdx; 828 830 829 831 if (strncmp (darwin_macosx_version_min, "10.", 3) != 0) 830 832 goto fail; 831 833 if (! ISDIGIT (darwin_macosx_version_min[3])) 832 834 goto fail; 833 result[2] = darwin_macosx_version_min[3]; 834 if (darwin_macosx_version_min[4] != '\0') 835 { 836 if (darwin_macosx_version_min[4] != '.') 837 goto fail; 838 if (! ISDIGIT (darwin_macosx_version_min[5])) 839 goto fail; 840 if (darwin_macosx_version_min[6] != '\0') 835 836 minorDigitIdx = 3; 837 result[2] = darwin_macosx_version_min[minorDigitIdx++]; 838 if (ISDIGIT (darwin_macosx_version_min[minorDigitIdx])) 839 { 840 /* Starting with OS X 10.10, the macro ends '00' rather than '0', 841 i.e. 10.10.x becomes 101000 rather than 10100. */ 842 result[3] = darwin_macosx_version_min[minorDigitIdx++]; 843 result[4] = '0'; 844 result[5] = '0'; 845 result[6] = '\0'; 846 } 847 if (darwin_macosx_version_min[minorDigitIdx] != '\0' 848 && darwin_macosx_version_min[minorDigitIdx] != '.') 841 849 goto fail; 842 result[3] = darwin_macosx_version_min[5];843 }844 else845 result[3] = '0';846 850 847 851 return result; 848 852 -
gcc/config/darwin-driver.c
diff -uNr llvmgcc42-2336.11.orig/gcc/config/darwin-driver.c llvmgcc42-2336.11/gcc/config/darwin-driver.c
old new 174 174 version_p = osversion + 1; 175 175 if (ISDIGIT (*version_p)) 176 176 major_vers = major_vers * 10 + (*version_p++ - '0'); 177 if (major_vers > 4 + 9)178 goto parse_failed;179 177 if (*version_p++ != '.') 180 178 goto parse_failed; 181 179 version_pend = strchr(version_p, '.'); -
gcc/testsuite/gcc.dg/darwin-minversion-1.c
diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-1.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-1.c
old new 4 4 /* { dg-options "-mmacosx-version-min=10.1 -m32" } */ 5 5 /* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ 6 6 7 int main(void) 7 int 8 main () 8 9 { 9 10 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010 10 11 fail me; -
gcc/testsuite/gcc.dg/darwin-minversion-2.c
diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-2.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-2.c
old new 4 4 /* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.3 -m32" } */ 5 5 /* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ 6 6 7 int main(void) 7 int 8 main () 8 9 { 9 10 #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1030 10 11 fail me; -
llvmgcc42-2336.11/llvmCore/Makefile.rules
old new 557 557 ifeq ($(HOST_OS),Darwin) 558 558 DARWIN_VERSION := `sw_vers -productVersion` 559 559 # Strip a number like 10.4.7 to 10.4 560 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9] ).*/\1/')560 DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9][0-9]).*/\1/') 561 561 # Get "4" out of 10.4 for later pieces in the makefile. 562 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9] ).*/\1/')562 DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9][0-9]).*/\1/') 563 563 564 564 SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress \ 565 565 -dynamiclib -
llvmgcc42-2336.11/
old new 5092 5092 }; 5093 5093 /* LLVM LOCAL end */ 5094 5094 5095 fix = { 5096 hackname = yosemite_fix; 5097 files = xpc/base.h; 5098 sed = "s/__has_extension(attribute_unavailable_with_message)/0/g"; 5099 sed = "s/__has_feature(objc_arc)/0/g"; 5100 test_text = 5101 "__has_extension(attribute_unavailable_with_message)" 5102 "__has_feature(objc_arc)"; 5103 }; 5104 5095 5105 /*EOF*/ -
llvmgcc42-2336.11/
old new 1 1 /* -*- buffer-read-only: t -*- vi: set ro: 2 * 2 * 3 3 * DO NOT EDIT THIS FILE (fixincl.x) 4 * 5 * It has been AutoGen-ed Friday July 17, 2009 at 11:13:21 AM CEST4 * 5 * It has been AutoGen-ed October 22, 2014 at 11:05:07 AM by AutoGen 5.18.2 6 6 * From the definitions inclhack.def 7 7 * and the template file fixincl 8 8 */ 9 /* DO NOT SVN-MERGE THIS FILE, EITHER Fri Jul 17 11:13:21 CEST 20099 /* DO NOT SVN-MERGE THIS FILE, EITHER Wed Oct 22 11:05:07 EDT 2014 10 10 * 11 11 * You must regenerate it. Use the ./genfixes script. 12 12 * … … 15 15 * certain ANSI-incompatible system header files which are fixed to work 16 16 * correctly with ANSI C and placed in a directory that GNU C will search. 17 17 * 18 * This file contains 21 7fixup descriptions.18 * This file contains 218 fixup descriptions. 19 19 * 20 20 * See README for more information. 21 21 * 22 22 * inclhack copyright (c) 1998, 1999, 2000, 2001 23 23 * The Free Software Foundation, Inc. 24 24 * 25 * inclhack is free software. 26 * 27 * You may redistribute it and/or modify it under the terms of the 28 * GNU General Public License, as published by the Free Software 29 * Foundation; either version 2, or (at your option) any later version. 30 * 31 * inclhack is distributed in the hope that it will be useful, 32 * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 * inclhack is free software: you can redistribute it and/or modify it 26 * under the terms of the GNU General Public License as published by the 27 * Free Software Foundation, either version 3 of the License, or 28 * (at your option) any later version. 29 * 30 * inclhack is distributed in the hope that it will be useful, but 31 * WITHOUT ANY WARRANTY; without even the implied warranty of 33 32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 34 33 * See the GNU General Public License for more details. 35 * 36 * You should have received a copy of the GNU General Public License 37 * along with inclhack. See the file "COPYING". If not, 38 * write to: The Free Software Foundation, Inc., 39 * 59 Temple Place - Suite 330, 40 * Boston, MA 02111-1307, USA. 34 * 35 * You should have received a copy of the GNU General Public License along 36 * with this program. If not, see <http://www.gnu.org/licenses/>. 41 37 */ 42 38 43 39 /* * * * * * * * * * * * * * * * * * * * * * * * * * … … 4652 4648 */ 4653 4649 tSCC zMath_ExceptionBypass0[] = 4654 4650 "We have a problem when using C\\+\\+|for C\\+\\+, _[a-z0-9A-Z_]+_exception; for C, exception"; 4655 tSCC zMath_ExceptionBypass1[] =4656 "defined __cplusplus";4657 4651 4658 4652 #define MATH_EXCEPTION_TEST_CT 2 4659 4653 static tTestDesc aMath_ExceptionTests[] = { 4660 4654 { TT_NEGREP, zMath_ExceptionBypass0, (regex_t*)NULL }, 4661 { TT_NEGREP, zMath_ExceptionBypass1, (regex_t*)NULL },4662 4655 { TT_EGREP, zMath_ExceptionSelect0, (regex_t*)NULL }, }; 4663 4656 4664 4657 /* … … 8837 8830 "-e", "s/int __d0, __d1;/__intptr_t __d0, __d1;/g", 8838 8831 (char*)NULL }; 8839 8832 8833 /* * * * * * * * * * * * * * * * * * * * * * * * * * 8834 * 8835 * Description of Yosemite_Fix fix 8836 */ 8837 tSCC zYosemite_FixName[] = 8838 "yosemite_fix"; 8839 8840 /* 8841 * File name selection pattern 8842 */ 8843 tSCC zYosemite_FixList[] = 8844 "xpc/base.h\0"; 8845 /* 8846 * Machine/OS name selection pattern 8847 */ 8848 #define apzYosemite_FixMachs (const char**)NULL 8849 #define YOSEMITE_FIX_TEST_CT 0 8850 #define aYosemite_FixTests (tTestDesc*)NULL 8851 8852 /* 8853 * Fix Command Arguments for Yosemite_Fix 8854 */ 8855 static const char* apzYosemite_FixPatch[] = { "sed", 8856 "-e", "s/__has_extension(attribute_unavailable_with_message)/0/g", 8857 "-e", "s/__has_feature(objc_arc)/0/g", 8858 (char*)NULL }; 8859 8840 8860 8841 8861 /* * * * * * * * * * * * * * * * * * * * * * * * * * 8842 8862 * … … 8844 8864 */ 8845 8865 #define REGEX_COUNT 262 8846 8866 #define MACH_LIST_SIZE_LIMIT 261 8847 #define FIX_COUNT 21 78867 #define FIX_COUNT 218 8848 8868 8849 8869 /* 8850 8870 * Enumerate the fixes … … 9066 9086 X11_CLASS_USAGE_FIXIDX, 9067 9087 X11_NEW_FIXIDX, 9068 9088 X11_SPRINTF_FIXIDX, 9069 GLIBC_FDZERO_INLINE_ASM_FIXIDX 9089 GLIBC_FDZERO_INLINE_ASM_FIXIDX, 9090 YOSEMITE_FIX_FIXIDX 9070 9091 } t_fixinc_idx; 9071 9092 9072 9093 tFixDesc fixDescList[ FIX_COUNT ] = { … … 10153 10174 { zGlibc_Fdzero_Inline_AsmName, zGlibc_Fdzero_Inline_AsmList, 10154 10175 apzGlibc_Fdzero_Inline_AsmMachs, 10155 10176 GLIBC_FDZERO_INLINE_ASM_TEST_CT, FD_MACH_ONLY, 10156 aGlibc_Fdzero_Inline_AsmTests, apzGlibc_Fdzero_Inline_AsmPatch, 0 } 10177 aGlibc_Fdzero_Inline_AsmTests, apzGlibc_Fdzero_Inline_AsmPatch, 0 }, 10178 10179 { zYosemite_FixName, zYosemite_FixList, 10180 apzYosemite_FixMachs, 10181 YOSEMITE_FIX_TEST_CT, FD_MACH_ONLY, 10182 aYosemite_FixTests, apzYosemite_FixPatch, 0 } 10157 10183 };