GCC Bugzilla – Attachment 33932 Details for
Bug 61407
Build errors on latest OS X 10.10 Yosemite with Xcode 6 on GCC 4.8.3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for gcc 4.8 branch (based on gcc 4.8.3)
gcc-4.8.3.diff (text/plain), 7.19 KB, created by
Francois-Xavier Coudert
on 2014-11-10 20:29:13 UTC
(
hide
)
Description:
Patch for gcc 4.8 branch (based on gcc 4.8.3)
Filename:
MIME Type:
Creator:
Francois-Xavier Coudert
Created:
2014-11-10 20:29:13 UTC
Size:
7.19 KB
patch
obsolete
>diff -Nrpu gcc-4.8.3-orig/gcc/config/darwin-c.c gcc-4.8.3/gcc/config/darwin-c.c >--- gcc-4.8.3-orig/gcc/config/darwin-c.c 2013-01-10 21:38:27.000000000 +0100 >+++ gcc-4.8.3/gcc/config/darwin-c.c 2014-11-10 17:37:14.000000000 +0100 >@@ -571,21 +571,34 @@ find_subframework_header (cpp_reader *pf > } > > /* Return the value of darwin_macosx_version_min suitable for the >- __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, >- so '10.4.2' becomes 1040. The lowest digit is always zero. >+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, so '10.4.2' >+ becomes 1040 and '10.10.0' becomes 101000. The lowest digit is >+ always zero, as is the second lowest for '10.10.x' and above. > Print a warning if the version number can't be understood. */ > static const char * > version_as_macro (void) > { >- static char result[] = "1000"; >+ static char result[7] = "1000"; >+ int minorDigitIdx; > > if (strncmp (darwin_macosx_version_min, "10.", 3) != 0) > goto fail; > if (! ISDIGIT (darwin_macosx_version_min[3])) > goto fail; >- result[2] = darwin_macosx_version_min[3]; >- if (darwin_macosx_version_min[4] != '\0' >- && darwin_macosx_version_min[4] != '.') >+ >+ minorDigitIdx = 3; >+ result[2] = darwin_macosx_version_min[minorDigitIdx++]; >+ if (ISDIGIT (darwin_macosx_version_min[minorDigitIdx])) >+ { >+ /* Starting with OS X 10.10, the macro ends '00' rather than '0', >+ i.e. 10.10.x becomes 101000 rather than 10100. */ >+ result[3] = darwin_macosx_version_min[minorDigitIdx++]; >+ result[4] = '0'; >+ result[5] = '0'; >+ result[6] = '\0'; >+ } >+ if (darwin_macosx_version_min[minorDigitIdx] != '\0' >+ && darwin_macosx_version_min[minorDigitIdx] != '.') > goto fail; > > return result; >diff -Nrpu gcc-4.8.3-orig/gcc/config/darwin-driver.c gcc-4.8.3/gcc/config/darwin-driver.c >--- gcc-4.8.3-orig/gcc/config/darwin-driver.c 2013-01-10 21:38:27.000000000 +0100 >+++ gcc-4.8.3/gcc/config/darwin-driver.c 2014-11-10 17:37:14.000000000 +0100 >@@ -29,8 +29,8 @@ along with GCC; see the file COPYING3. > #include <sys/sysctl.h> > #include "xregex.h" > >-static bool >-darwin_find_version_from_kernel (char *new_flag) >+static char * >+darwin_find_version_from_kernel (void) > { > char osversion[32]; > size_t osversion_len = sizeof (osversion) - 1; >@@ -39,6 +39,7 @@ darwin_find_version_from_kernel (char *n > char minor_vers[6]; > char * version_p; > char * version_pend; >+ char * new_flag; > > /* Determine the version of the running OS. If we can't, warn user, > and do nothing. */ >@@ -46,7 +47,7 @@ darwin_find_version_from_kernel (char *n > &osversion_len, NULL, 0) == -1) > { > warning (0, "sysctl for kern.osversion failed: %m"); >- return false; >+ return NULL; > } > > /* Try to parse the first two parts of the OS version number. Warn >@@ -57,8 +58,6 @@ darwin_find_version_from_kernel (char *n > 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, '.'); >@@ -74,17 +73,16 @@ darwin_find_version_from_kernel (char *n > if (major_vers - 4 <= 4) > /* On 10.4 and earlier, the old linker is used which does not > support three-component system versions. */ >- sprintf (new_flag, "10.%d", major_vers - 4); >+ asprintf (&new_flag, "10.%d", major_vers - 4); > else >- sprintf (new_flag, "10.%d.%s", major_vers - 4, >- minor_vers); >+ asprintf (&new_flag, "10.%d.%s", major_vers - 4, minor_vers); > >- return true; >+ return new_flag; > > parse_failed: > warning (0, "couldn%'t understand kern.osversion %q.*s", > (int) osversion_len, osversion); >- return false; >+ return NULL; > } > > #endif >@@ -105,7 +103,7 @@ darwin_default_min_version (unsigned int > const unsigned int argc = *decoded_options_count; > struct cl_decoded_option *const argv = *decoded_options; > unsigned int i; >- static char new_flag[sizeof ("10.0.0") + 6]; >+ const char *new_flag; > > /* If the command-line is empty, just return. */ > if (argc <= 1) >@@ -142,16 +140,16 @@ darwin_default_min_version (unsigned int > > #ifndef CROSS_DIRECTORY_STRUCTURE > >- /* Try to find the version from the kernel, if we fail - we print a message >- and give up. */ >- if (!darwin_find_version_from_kernel (new_flag)) >- return; >+ /* Try to find the version from the kernel, if we fail - we print a message >+ and give up. */ >+ new_flag = darwin_find_version_from_kernel (); >+ if (!new_flag) >+ return; > > #else > >- /* For cross-compilers, default to the target OS version. */ >- >- strncpy (new_flag, DEF_MIN_OSX_VERSION, sizeof (new_flag)); >+ /* For cross-compilers, default to the target OS version. */ >+ new_flag = DEF_MIN_OSX_VERSION; > > #endif /* CROSS_DIRECTORY_STRUCTURE */ > >@@ -165,7 +163,6 @@ darwin_default_min_version (unsigned int > memcpy (*decoded_options + 2, argv + 1, > (argc - 1) * sizeof (struct cl_decoded_option)); > return; >- > } > > /* Translate -filelist and -framework options in *DECODED_OPTIONS >diff -Nrpu gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-1.c gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-1.c >--- gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-1.c 2007-02-20 17:45:38.000000000 +0100 >+++ gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-1.c 2014-11-10 17:37:14.000000000 +0100 >@@ -2,7 +2,8 @@ > /* { 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 -Nrpu gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-2.c gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-2.c >--- gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-2.c 2007-02-20 17:45:38.000000000 +0100 >+++ gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-2.c 2014-11-10 17:37:14.000000000 +0100 >@@ -2,7 +2,8 @@ > /* { 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 -Nrpu gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-3.c gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-3.c >--- gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-3.c 2007-06-07 20:56:51.000000000 +0200 >+++ gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-3.c 2014-11-10 17:37:14.000000000 +0100 >@@ -2,7 +2,8 @@ > /* { dg-options "-mmacosx-version-min=10.4.10" } */ > /* { dg-do compile { target *-*-darwin* } } */ > >-int main(void) >+int >+main () > { > #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 1040 > fail me; >diff -Nrpu gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-4.c gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-4.c >--- gcc-4.8.3-orig/gcc/testsuite/gcc.dg/darwin-minversion-4.c 1970-01-01 01:00:00.000000000 +0100 >+++ gcc-4.8.3/gcc/testsuite/gcc.dg/darwin-minversion-4.c 2014-11-10 17:37:14.000000000 +0100 >@@ -0,0 +1,12 @@ >+/* Test that major versions greater than 9 work and have the additional 0. */ >+/* { dg-options "-mmacosx-version-min=10.10.0" } */ >+/* { dg-do compile { target *-*-darwin* } } */ >+ >+int >+main () >+{ >+#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ != 101000 >+ fail me; >+#endif >+ return 0; >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 61407
:
32886
|
32949
|
33180
|
33461
|
33464
|
33824
| 33932