aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSimon Wright <simon@pushface.org>2017-09-12 15:29:16 +0000
committerJeff Law <law@gcc.gnu.org>2017-09-12 09:29:16 -0600
commit7d843469d535284337793796ae38ec67b44e1ef3 (patch)
treed55ae2fd6bdd7ff14fa88abd9b21df454c0a4d6e /gcc
parentcbc45bea5f58a19d0545d1101a0a0c1a9e7760d2 (diff)
downloadgcc-7d843469d535284337793796ae38ec67b44e1ef3.zip
gcc-7d843469d535284337793796ae38ec67b44e1ef3.tar.gz
gcc-7d843469d535284337793796ae38ec67b44e1ef3.tar.bz2
re PR target/80204 (macosx-version-min wrong for macOS Sierra 10.12.3)
PR target/80204 * config/darwin-driver.c (darwin_find_version_from_kernel): Eliminate calculation of the minor version, always output as 0. From-SVN: r252029
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/darwin-driver.c16
2 files changed, 11 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eb73164..306cf57 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-02 Simon Wright <simon@pushface.org>
+
+ PR target/80204
+ * config/darwin-driver.c (darwin_find_version_from_kernel): Eliminate
+ calculation of the minor version, always output as 0.
+
2017-09-12 Jakub Jelinek <jakub@redhat.com>
PR target/82112
diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
index e3ed79d..0348b40 100644
--- a/gcc/config/darwin-driver.c
+++ b/gcc/config/darwin-driver.c
@@ -37,9 +37,7 @@ darwin_find_version_from_kernel (void)
size_t osversion_len = sizeof (osversion) - 1;
static int osversion_name[2] = { CTL_KERN, KERN_OSRELEASE };
int major_vers;
- 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,
@@ -61,13 +59,6 @@ darwin_find_version_from_kernel (void)
major_vers = major_vers * 10 + (*version_p++ - '0');
if (*version_p++ != '.')
goto parse_failed;
- version_pend = strchr(version_p, '.');
- if (!version_pend)
- goto parse_failed;
- if (! ISDIGIT (*version_p))
- goto parse_failed;
- strncpy(minor_vers, version_p, version_pend - version_p);
- minor_vers[version_pend - version_p] = '\0';
/* The major kernel version number is 4 plus the second OS version
component. */
@@ -77,7 +68,11 @@ darwin_find_version_from_kernel (void)
FIXME: we should not assume this - a newer linker could be used. */
asprintf (&new_flag, "10.%d", major_vers - 4);
else
- asprintf (&new_flag, "10.%d.%s", major_vers - 4, minor_vers);
+ /* Although the newer linker supports three-component system
+ versions, there's no guarantee that the minor version component
+ of the kernel and the system are the same. Apple's clang always
+ uses 0 as the minor version: do the same. */
+ asprintf (&new_flag, "10.%d.0", major_vers - 4);
return new_flag;
@@ -86,7 +81,6 @@ darwin_find_version_from_kernel (void)
(int) osversion_len, osversion);
return NULL;
}
-
#endif
/* When running on a Darwin system and using that system's headers and