diff -uNr llvmgcc42-2336.11.orig/fixincludes/fixincl.x llvmgcc42-2336.11/fixincludes/fixincl.x --- llvmgcc42-2336.11.orig/fixincludes/fixincl.x 2012-04-23 19:30:45.000000000 -0400 +++ llvmgcc42-2336.11/fixincludes/fixincl.x 2014-12-02 13:57:54.000000000 -0500 @@ -1,12 +1,12 @@ /* -*- buffer-read-only: t -*- vi: set ro: - * + * * DO NOT EDIT THIS FILE (fixincl.x) - * - * It has been AutoGen-ed Friday July 17, 2009 at 11:13:21 AM CEST + * + * It has been AutoGen-ed October 22, 2014 at 11:05:07 AM by AutoGen 5.18.2 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Jul 17 11:13:21 CEST 2009 +/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Oct 22 11:05:07 EDT 2014 * * You must regenerate it. Use the ./genfixes script. * @@ -15,29 +15,25 @@ * 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 217 fixup descriptions. + * This file contains 218 fixup descriptions. * * See README for more information. * * inclhack copyright (c) 1998, 1999, 2000, 2001 * The Free Software Foundation, Inc. * - * inclhack is free software. - * - * You may redistribute it and/or modify it under the terms of the - * GNU General Public License, as published by the Free Software - * Foundation; either version 2, or (at your option) any later version. - * - * inclhack is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * inclhack is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * inclhack is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with inclhack. See the file "COPYING". If not, - * write to: The Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . */ /* * * * * * * * * * * * * * * * * * * * * * * * * * @@ -4652,13 +4648,10 @@ */ tSCC zMath_ExceptionBypass0[] = "We have a problem when using C\\+\\+|for C\\+\\+, _[a-z0-9A-Z_]+_exception; for C, exception"; -tSCC zMath_ExceptionBypass1[] = - "defined __cplusplus"; #define MATH_EXCEPTION_TEST_CT 2 static tTestDesc aMath_ExceptionTests[] = { { TT_NEGREP, zMath_ExceptionBypass0, (regex_t*)NULL }, - { TT_NEGREP, zMath_ExceptionBypass1, (regex_t*)NULL }, { TT_EGREP, zMath_ExceptionSelect0, (regex_t*)NULL }, }; /* @@ -8837,6 +8830,33 @@ "-e", "s/int __d0, __d1;/__intptr_t __d0, __d1;/g", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Yosemite_Fix fix + */ +tSCC zYosemite_FixName[] = + "yosemite_fix"; + +/* + * File name selection pattern + */ +tSCC zYosemite_FixList[] = + "xpc/base.h\0"; +/* + * Machine/OS name selection pattern + */ +#define apzYosemite_FixMachs (const char**)NULL +#define YOSEMITE_FIX_TEST_CT 0 +#define aYosemite_FixTests (tTestDesc*)NULL + +/* + * Fix Command Arguments for Yosemite_Fix + */ +static const char* apzYosemite_FixPatch[] = { "sed", + "-e", "s/__has_extension(attribute_unavailable_with_message)/0/g", + "-e", "s/__has_feature(objc_arc)/0/g", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -8844,7 +8864,7 @@ */ #define REGEX_COUNT 262 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 217 +#define FIX_COUNT 218 /* * Enumerate the fixes @@ -9066,7 +9086,8 @@ X11_CLASS_USAGE_FIXIDX, X11_NEW_FIXIDX, X11_SPRINTF_FIXIDX, - GLIBC_FDZERO_INLINE_ASM_FIXIDX + GLIBC_FDZERO_INLINE_ASM_FIXIDX, + YOSEMITE_FIX_FIXIDX } t_fixinc_idx; tFixDesc fixDescList[ FIX_COUNT ] = { @@ -10153,5 +10174,10 @@ { zGlibc_Fdzero_Inline_AsmName, zGlibc_Fdzero_Inline_AsmList, apzGlibc_Fdzero_Inline_AsmMachs, GLIBC_FDZERO_INLINE_ASM_TEST_CT, FD_MACH_ONLY, - aGlibc_Fdzero_Inline_AsmTests, apzGlibc_Fdzero_Inline_AsmPatch, 0 } + aGlibc_Fdzero_Inline_AsmTests, apzGlibc_Fdzero_Inline_AsmPatch, 0 }, + + { zYosemite_FixName, zYosemite_FixList, + apzYosemite_FixMachs, + YOSEMITE_FIX_TEST_CT, FD_MACH_ONLY, + aYosemite_FixTests, apzYosemite_FixPatch, 0 } }; diff -uNr llvmgcc42-2336.11.orig/fixincludes/inclhack.def llvmgcc42-2336.11/fixincludes/inclhack.def --- llvmgcc42-2336.11.orig/fixincludes/inclhack.def 2009-07-17 07:19:33.000000000 -0400 +++ llvmgcc42-2336.11/fixincludes/inclhack.def 2014-12-02 13:57:54.000000000 -0500 @@ -5092,4 +5092,14 @@ }; /* LLVM LOCAL end */ +fix = { + hackname = yosemite_fix; + files = xpc/base.h; + sed = "s/__has_extension(attribute_unavailable_with_message)/0/g"; + sed = "s/__has_feature(objc_arc)/0/g"; + test_text = + "__has_extension(attribute_unavailable_with_message)" + "__has_feature(objc_arc)"; +}; + /*EOF*/ diff -uNr llvmgcc42-2336.11.orig/gcc/config/darwin-c.c llvmgcc42-2336.11/gcc/config/darwin-c.c --- llvmgcc42-2336.11.orig/gcc/config/darwin-c.c 2010-07-26 19:03:00.000000000 -0400 +++ llvmgcc42-2336.11/gcc/config/darwin-c.c 2014-12-02 14:11:57.000000000 -0500 @@ -816,35 +816,177 @@ return 0; } -/* Return the value of darwin_macosx_version_min suitable for the - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, - so '10.4.2' becomes 1042. - Print a warning if the version number is not known. */ +/* Given a version string, return the version as a statically-allocated + array of three non-negative integers. If the version string is + invalid, return null. + + Version strings must consist of one, two, or three tokens, each + separated by a single period. Each token must contain only the + characters '0' through '9' and is converted to an equivalent + integer. Omitted tokens are treated as zeros. For example: + + "10" becomes {10,0,0} + "10.10" becomes {10,10,0} + "10.10.1" becomes {10,10,1} + "10.000010.1" becomes {10,10,1} + "10.010.001" becomes {10,10,1} + "000010.10.00001" becomes {10,10,1} */ + +enum version_components { MAJOR, MINOR, TINY }; + +static const unsigned long * +parse_version (const char *version_str) +{ + size_t version_len; + char *end; + static unsigned long version_array[3]; + + if (! version_str) + return NULL; + + version_len = strlen (version_str); + if (version_len < 1) + return NULL; + + /* Version string must consist of digits and periods only. */ + if (strspn (version_str, "0123456789.") != version_len) + return NULL; + + if (! ISDIGIT (version_str[0]) || ! ISDIGIT (version_str[version_len - 1])) + return NULL; + + version_array[MAJOR] = strtoul (version_str, &end, 10); + version_str = end + ((*end == '.') ? 1 : 0); + + /* Version string must not contain adjacent periods. */ + if (*version_str == '.') + return NULL; + + version_array[MINOR] = strtoul (version_str, &end, 10); + version_str = end + ((*end == '.') ? 1 : 0); + + version_array[TINY] = strtoul (version_str, &end, 10); + + /* Version string must contain no more than three tokens. */ + if (*end != '\0') + return NULL; + + return version_array; +} + +/* Given a three-component version represented as an array of + non-negative integers, return a statically-allocated string suitable + for the legacy __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro. + If the version is invalid and cannot be coerced into a valid form, + return null. + + The legacy format is a four-character string -- two chars for the + major number and one each for the minor and tiny numbers. Major + numbers are zero-padded if necessary. Minor and tiny numbers from + 10 through 99 are permitted but are clamped to 9 (for example, + {10,9,10} produces "1099"). Versions containing numbers greater + than 99 are rejected. */ + static const char * /* APPLE LOCAL ARM 5683689 */ +version_as_legacy_macro (const unsigned long *version) +{ + unsigned long major, minor, tiny; + static char result[sizeof "9999"]; + + if (! version) + return NULL; + + major = version[MAJOR]; + minor = version[MINOR]; + tiny = version[TINY]; + + if (major > 99 || minor > 99 || tiny > 99) + return NULL; + + minor = ((minor > 9) ? 9 : minor); + tiny = ((tiny > 9) ? 9 : tiny); + + /* NOTE: Cast result of sizeof so that result of sprintf is not + converted to an unsigned type. */ + if (sprintf (result, "%02lu%lu%lu", major, minor, tiny) + != (int) sizeof "9999" - 1) + return NULL; + + return result; +} + +/* Given a three-component version represented as an array of + non-negative integers, return a statically-allocated string suitable + for the modern __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro + or the __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ macro. If the + version is invalid, return null. + + The modern format is a five- or six-character string -- one or two + chars for the major number and two each for the minor and tiny + numbers, which are zero-padded if necessary (for example, {8,1,0} + produces "80100", and {10,10,1} produces "101001"). Versions + containing numbers greater than 99 are rejected. */ + +static const char * +version_as_modern_macro (const unsigned long *version) +{ + unsigned long major, minor, tiny; + static char result[sizeof "999999"]; + + if (! version) + return NULL; + + major = version[MAJOR]; + minor = version[MINOR]; + tiny = version[TINY]; + + if (major > 99 || minor > 99 || tiny > 99) + return NULL; + + /* NOTE: 'sizeof ((x > y) ? "foo" : "bar")' returns size of char + pointer instead of char array, so use + '(x > y) ? sizeof "foo" : sizeof "bar"' instead. */ + /* NOTE: Cast result of sizeof so that result of sprintf is not + converted to an unsigned type. */ + if (sprintf (result, "%lu%02lu%02lu", major, minor, tiny) + != (int) ((major > 9) ? sizeof "999999" : sizeof "99999") - 1) + return NULL; + + return result; +} + +/* Return the value of darwin_macosx_version_min, suitably formatted + for the __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro. Values + representing OS X 10.9 and earlier are encoded using the legacy + four-character format, while 10.10 and later use a modern + six-character format. (For example, "10.9" produces "1090", and + "10.10.1" produces "101001".) If the value is invalid and cannot be + coerced into a valid form, print a warning and return "1000". */ + +static const char * macosx_version_as_macro (void) { - static char result[] = "1000"; + const unsigned long *version_array; + const char *version_macro; - if (strncmp (darwin_macosx_version_min, "10.", 3) != 0) + version_array = parse_version (darwin_macosx_version_min); + if (! version_array) goto fail; - if (! ISDIGIT (darwin_macosx_version_min[3])) + + /* Do not assume that the major number will always be exactly 10. */ + if (version_array[MAJOR] < 10 || version_array[MAJOR] > 10) goto fail; - result[2] = darwin_macosx_version_min[3]; - if (darwin_macosx_version_min[4] != '\0') - { - if (darwin_macosx_version_min[4] != '.') - goto fail; - if (! ISDIGIT (darwin_macosx_version_min[5])) - goto fail; - if (darwin_macosx_version_min[6] != '\0') - goto fail; - result[3] = darwin_macosx_version_min[5]; - } + + if (version_array[MAJOR] == 10 && version_array[MINOR] < 10) + version_macro = version_as_legacy_macro (version_array); else - result[3] = '0'; + version_macro = version_as_modern_macro (version_array); - return result; + if (! version_macro) + goto fail; + + return version_macro; fail: error ("Unknown value %qs of -mmacosx-version-min", diff -uNr llvmgcc42-2336.11.orig/gcc/config/darwin-driver.c llvmgcc42-2336.11/gcc/config/darwin-driver.c --- llvmgcc42-2336.11.orig/gcc/config/darwin-driver.c 2009-07-22 16:36:27.000000000 -0400 +++ llvmgcc42-2336.11/gcc/config/darwin-driver.c 2014-12-02 13:57:54.000000000 -0500 @@ -174,8 +174,6 @@ version_p = osversion + 1; if (ISDIGIT (*version_p)) major_vers = major_vers * 10 + (*version_p++ - '0'); - if (major_vers > 4 + 9) - goto parse_failed; if (*version_p++ != '.') goto parse_failed; version_pend = strchr(version_p, '.'); 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 --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-1.c 2008-11-25 18:00:54.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-1.c 2014-12-02 14:14:00.000000000 -0500 @@ -1,10 +1,9 @@ -/* APPLE LOCAL file mainline 2007-02-20 5005743 */ /* Basic test for -mmacosx-version-min switch on Darwin. */ -/* APPLE LOCAL 64-bit default */ -/* { dg-options "-mmacosx-version-min=10.1 -m32" } */ -/* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.1" } */ +/* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1010 fail me; diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-10.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-10.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-10.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-10.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,16 @@ +/* PR target/63810: Test that a version with a zero-padded minor + number < 10 and a zero-padded tiny number < 10 produces the correct + four-character macro. */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=10.07.02" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1072 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-11.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-11.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-11.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-11.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,15 @@ +/* PR target/63810: Test that a version with outrageous zero-padding and + a minor number > 9 still produces a six-character macro. */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=00010.010.0000098" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101098 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-12.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-12.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-12.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-12.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,15 @@ +/* PR target/63810: Test that a version with outrageous zero-padding and + a minor number < 10 still produces a four-character macro. */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=010.008.000031" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1089 + fail me; +#endif + return 0; +} 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 --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-2.c 2008-11-25 18:00:54.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-2.c 2014-12-02 14:14:00.000000000 -0500 @@ -1,10 +1,9 @@ -/* APPLE LOCAL file mainline 2007-02-20 5005743 */ /* Basic test for -mmacosx-version-min switch on Darwin. */ -/* APPLE LOCAL 64-bit default */ -/* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.3 -m32" } */ -/* { dg-do run { target powerpc*-*-darwin* i?86*-*-darwin* } } */ +/* { dg-options "-mmacosx-version-min=10.1 -mmacosx-version-min=10.3" } */ +/* { dg-do run { target *-*-darwin* } } */ -int main(void) +int +main () { #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1030 fail me; diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-3.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-3.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-3.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-3.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,12 @@ +/* Test that most minor versions < 10 work. */ +/* { dg-options "-mmacosx-version-min=10.4.1" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1041 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-4.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-4.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-4.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-4.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,12 @@ +/* Test that minor versions > 9 produce a six-character macro. */ +/* { dg-options "-mmacosx-version-min=10.10.1" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101001 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-5.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-5.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-5.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-5.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,16 @@ +/* PR target/63810: Test that a version with minor number < 10 and tiny + number > 9 produces a four-character macro with the tiny number + clamped to 9. */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=10.9.10" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1099 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-6.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-6.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-6.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-6.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,15 @@ +/* PR target/63810: Test that tiny numbers are preserved in + six-character macros. */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=10.10.11" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101011 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-7.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-7.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-7.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-7.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,15 @@ +/* PR target/63810: Test that tiny numbers < 10 are preserved in + four-character macros. */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=10.9.1" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1091 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-8.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-8.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-8.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-8.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,15 @@ +/* PR target/63810: Test that a version with minor number > 9 and no + tiny number produces a six-character macro ending in "00". */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=10.11" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101100 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-9.c llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-9.c --- llvmgcc42-2336.11.orig/gcc/testsuite/gcc.dg/darwin-minversion-9.c 1969-12-31 19:00:00.000000000 -0500 +++ llvmgcc42-2336.11/gcc/testsuite/gcc.dg/darwin-minversion-9.c 2014-12-02 14:14:00.000000000 -0500 @@ -0,0 +1,15 @@ +/* PR target/63810: Test that a version with a zero-padded minor + number < 10 produces a four-character macro. */ +/* Added by Lawrence Velázquez . */ + +/* { dg-options "-mmacosx-version-min=10.08.4" } */ +/* { dg-do compile { target *-*-darwin* } } */ + +int +main () +{ +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1084 + fail me; +#endif + return 0; +} diff -uNr llvmgcc42-2336.11.orig/llvmCore/Makefile.rules llvmgcc42-2336.11/llvmCore/Makefile.rules --- llvmgcc42-2336.11.orig/llvmCore/Makefile.rules 2014-12-02 13:56:04.000000000 -0500 +++ llvmgcc42-2336.11/llvmCore/Makefile.rules 2014-12-02 13:57:54.000000000 -0500 @@ -557,9 +557,9 @@ ifeq ($(HOST_OS),Darwin) DARWIN_VERSION := `sw_vers -productVersion` # Strip a number like 10.4.7 to 10.4 - DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9]).*/\1/') + DARWIN_VERSION := $(shell echo $(DARWIN_VERSION)| sed -E 's/(10.[0-9][0-9]).*/\1/') # Get "4" out of 10.4 for later pieces in the makefile. - DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9]).*/\1/') + DARWIN_MAJVERS := $(shell echo $(DARWIN_VERSION)| sed -E 's/10.([0-9][0-9]).*/\1/') SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress \ -dynamiclib