Patchwork [Ada,Darwin] Fix bootstrap issue on Darwin8.

login
register
mail settings
Submitter IainS
Date Sept. 5, 2011, 6:51 p.m.
Message ID <CD1BEE3F-C52B-4312-A612-1C46E0DB4D2F@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/113428/
State New
Headers show

Comments

IainS - Sept. 5, 2011, 6:51 p.m.
Darwin8 does not have _SC_NPROCESSORS_ONLN defined.

OK for trunk & 4.6?
Iain
Index: gcc/ada/adaint.c
===================================================================
--- gcc/ada/adaint.c	(revision 178554)
+++ gcc/ada/adaint.c	(working copy)
@@ -2460,7 +2460,10 @@ __gnat_number_of_cpus (void)
   int cores = 1;
 
 #if defined (linux) || defined (sun) || defined (AIX) \
-    || (defined (__alpha__)  && defined (_osf_)) || defined (__APPLE__)
+    || (defined (__alpha__)  && defined (_osf_)) \
+    || (defined (__APPLE__) \
+        && defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \
+        && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050)
   cores = (int) sysconf (_SC_NPROCESSORS_ONLN);
 
 #elif (defined (__mips) && defined (__sgi))
Arnaud Charlet - Sept. 5, 2011, 7:04 p.m.
> Darwin8 does not have _SC_NPROCESSORS_ONLN defined.

Is Darwin8 still active/supported?

> OK for trunk & 4.6?

Not as submitted, you haven't provided a suitable changelog for review.

Also, when you repost your patch, can you please send a single version of
the patch (either inline or as an attachment)? TIA.

Arno

Patch

Index: gcc/ada/adaint.c
===================================================================
--- gcc/ada/adaint.c	(revision 178554)
+++ gcc/ada/adaint.c	(working copy)
@@ -2460,7 +2460,10 @@  __gnat_number_of_cpus (void)
    int cores = 1;

  #if defined (linux) || defined (sun) || defined (AIX) \
-    || (defined (__alpha__)  && defined (_osf_)) || defined (__APPLE__)
+    || (defined (__alpha__)  && defined (_osf_)) \
+    || (defined (__APPLE__) \
+        && defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \
+        && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050)
    cores = (int) sysconf (_SC_NPROCESSORS_ONLN);

  #elif (defined (__mips) && defined (__sgi))