[llvm-commits] [llvm-gcc-4.2] r129912 - /llvm-gcc-4.2/trunk/gcc/config/darwin.c
Bob Wilson
bob.wilson at apple.com
Thu Apr 21 08:40:05 PDT 2011
Author: bwilson
Date: Thu Apr 21 10:40:04 2011
New Revision: 129912
URL: http://llvm.org/viewvc/llvm-project?rev=129912&view=rev
Log:
Fix crash when darwin_macosx_version_min is not set.
Modified:
llvm-gcc-4.2/trunk/gcc/config/darwin.c
Modified: llvm-gcc-4.2/trunk/gcc/config/darwin.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/darwin.c?rev=129912&r1=129911&r2=129912&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/darwin.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/darwin.c Thu Apr 21 10:40:04 2011
@@ -2789,7 +2789,7 @@
/* LLVM LOCAL begin radar 6230142 */
unsigned darwin_llvm_override_target_version(const char *triple, char **new_triple) {
- int os_len = 0, base_len = 0, version = 0;
+ int os_len = 0, base_len = 0;
int isDarwin = 0, isIOS = 0, isOSX = 0;
char *substr;
@@ -2804,11 +2804,6 @@
else
return 0;
- /* llvm-gcc doesn't support pre-10.0 macosx systems. */
- version = strverscmp (darwin_macosx_version_min, "10.0");
- if (version < 0)
- return 0;
-
base_len = substr - triple;
if ((isIOS || isDarwin) && darwin_iphoneos_version_min) {
os_len = strlen(darwin_iphoneos_version_min) + strlen("ios");
@@ -2821,6 +2816,9 @@
(*new_triple)[base_len+os_len+1] = '\0';
return 1;
} else if ((isOSX || isDarwin) && darwin_macosx_version_min) {
+ /* llvm-gcc doesn't support pre-10.0 macosx systems. */
+ if (strverscmp (darwin_macosx_version_min, "10.0") < 0)
+ return 0;
os_len = strlen(darwin_macosx_version_min) + strlen("macosx");
*new_triple = ggc_alloc(base_len + os_len + 1);
strncpy(*new_triple, triple, base_len);
More information about the llvm-commits
mailing list