Patchwork Fix PR60644

login
register
mail settings
Submitter Alexander Ivchenko
Date March 26, 2014, 2:56 p.m.
Message ID <CACysShhtg7wo-wOuCTJwihPcm_gZn4u876rmkUuKo-NxwNmg5Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/333970/
State New
Headers show

Comments

Alexander Ivchenko - March 26, 2014, 2:56 p.m.
Hi,

In gcc/config/linux-android.h we have "builtin_define ("__ANDROID__");"
So "ANDROID" as in libcilkrts now is not the correct macro to check.

Bootstrapped and passed cilk testsuite on x86_64-unknown-linux-gnu.





Is it OK?

--Alexander
Alexander Ivchenko - March 27, 2014, 9:43 a.m.
Adding Balaji.

--Alexander

2014-03-26 18:56 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
> Hi,
>
> In gcc/config/linux-android.h we have "builtin_define ("__ANDROID__");"
> So "ANDROID" as in libcilkrts now is not the correct macro to check.
>
> Bootstrapped and passed cilk testsuite on x86_64-unknown-linux-gnu.
>
> diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
> index eb0d6ec..65efef0 100644
> --- a/libcilkrts/ChangeLog
> +++ b/libcilkrts/ChangeLog
> @@ -1,3 +1,12 @@
> +2014-03-26  Alexander Ivchenko  <alexander.ivchenko@intel.com>
> +
> + PR bootstrap/60644
> +
> + * include/cilk/metaprogramming.h: Change ANDROID to __ANDROID__.
> + * include/cilk/reducer_min_max.h: Ditto.
> + * runtime/bug.h: Ditto.
> + * runtime/os-unix.c: Ditto.
> +
>  2014-03-20  Tobias Burnus  <burnus@net-b.de>
>
>   PR other/60589
> diff --git a/libcilkrts/include/cilk/metaprogramming.h
> b/libcilkrts/include/cilk/metaprogramming.h
> index 5f6f29d..29b0839 100644
> --- a/libcilkrts/include/cilk/metaprogramming.h
> +++ b/libcilkrts/include/cilk/metaprogramming.h
> @@ -468,7 +468,7 @@ inline void* allocate_aligned(std::size_t size,
> std::size_t alignment)
>  #ifdef _WIN32
>      return _aligned_malloc(size, alignment);
>  #else
> -#if defined(ANDROID) || defined(__ANDROID__)
> +#if defined(__ANDROID__)
>      return memalign(std::max(alignment, sizeof(void*)), size);
>  #else
>      void* ptr;
> diff --git a/libcilkrts/include/cilk/reducer_min_max.h
> b/libcilkrts/include/cilk/reducer_min_max.h
> index 55f068c..7fe09e8 100644
> --- a/libcilkrts/include/cilk/reducer_min_max.h
> +++ b/libcilkrts/include/cilk/reducer_min_max.h
> @@ -3025,7 +3025,7 @@ struct legacy_reducer_downcast< reducer<
> op_min_index<Index, Type, Compare, Alig
>  #include <limits.h>
>
>  /* Wchar_t min/max constants */
> -#if defined(_MSC_VER) || defined(ANDROID)
> +#if defined(_MSC_VER) || defined(__ANDROID__)
>  #   include <wchar.h>
>  #else
>  #   include <stdint.h>
> diff --git a/libcilkrts/runtime/bug.h b/libcilkrts/runtime/bug.h
> index bb18913..1a64bea 100644
> --- a/libcilkrts/runtime/bug.h
> +++ b/libcilkrts/runtime/bug.h
> @@ -90,7 +90,7 @@ COMMON_PORTABLE extern const char *const
> __cilkrts_assertion_failed;
>   * GPL V3 licensed.
>   */
>  COMMON_PORTABLE void cilkbug_assert_no_uncaught_exception(void);
> -#if defined(_WIN32) || defined(ANDROID)
> +#if defined(_WIN32) || defined(__ANDROID__)
>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION()
>  #else
>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION() \
> diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
> index fafb91d..85bc08d 100644
> --- a/libcilkrts/runtime/os-unix.c
> +++ b/libcilkrts/runtime/os-unix.c
> @@ -282,7 +282,7 @@ void __cilkrts_init_tls_variables(void)
>  }
>  #endif
>
> -#if defined (__linux__) && ! defined(ANDROID)
> +#if defined (__linux__) && ! defined(__ANDROID__)
>  /*
>   * Get the thread id, rather than the pid. In the case of MIC offload, it's
>   * possible that we have multiple threads entering Cilk, and each has a
> @@ -354,7 +354,7 @@ static int linux_get_affinity_count (int tid)
>
>  COMMON_SYSDEP int __cilkrts_hardware_cpu_count(void)
>  {
> -#if defined ANDROID || (defined(__sun__) && defined(__svr4__))
> +#if defined __ANDROID__ || (defined(__sun__) && defined(__svr4__))
>      return sysconf (_SC_NPROCESSORS_ONLN);
>  #elif defined __MIC__
>      /// HACK: Usually, the 3rd and 4th hyperthreads are not beneficial
> @@ -409,7 +409,7 @@ COMMON_SYSDEP void __cilkrts_yield(void)
>      // giving up the processor and latency starting up when work becomes
>      // available
>      _mm_delay_32(1024);
> -#elif defined(ANDROID) || (defined(__sun__) && defined(__svr4__))
> +#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
>      // On Android and Solaris, call sched_yield to yield quantum.  I'm not
>      // sure why we don't do this on Linux also.
>      sched_yield();
>
>
>
>
> Is it OK?
>
> --Alexander
Alexander Ivchenko - April 4, 2014, 10:03 a.m.
*ping*

--Alexander

2014-03-27 13:43 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
> Adding Balaji.
>
> --Alexander
>
> 2014-03-26 18:56 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
>> Hi,
>>
>> In gcc/config/linux-android.h we have "builtin_define ("__ANDROID__");"
>> So "ANDROID" as in libcilkrts now is not the correct macro to check.
>>
>> Bootstrapped and passed cilk testsuite on x86_64-unknown-linux-gnu.
>>
>> diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
>> index eb0d6ec..65efef0 100644
>> --- a/libcilkrts/ChangeLog
>> +++ b/libcilkrts/ChangeLog
>> @@ -1,3 +1,12 @@
>> +2014-03-26  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>> +
>> + PR bootstrap/60644
>> +
>> + * include/cilk/metaprogramming.h: Change ANDROID to __ANDROID__.
>> + * include/cilk/reducer_min_max.h: Ditto.
>> + * runtime/bug.h: Ditto.
>> + * runtime/os-unix.c: Ditto.
>> +
>>  2014-03-20  Tobias Burnus  <burnus@net-b.de>
>>
>>   PR other/60589
>> diff --git a/libcilkrts/include/cilk/metaprogramming.h
>> b/libcilkrts/include/cilk/metaprogramming.h
>> index 5f6f29d..29b0839 100644
>> --- a/libcilkrts/include/cilk/metaprogramming.h
>> +++ b/libcilkrts/include/cilk/metaprogramming.h
>> @@ -468,7 +468,7 @@ inline void* allocate_aligned(std::size_t size,
>> std::size_t alignment)
>>  #ifdef _WIN32
>>      return _aligned_malloc(size, alignment);
>>  #else
>> -#if defined(ANDROID) || defined(__ANDROID__)
>> +#if defined(__ANDROID__)
>>      return memalign(std::max(alignment, sizeof(void*)), size);
>>  #else
>>      void* ptr;
>> diff --git a/libcilkrts/include/cilk/reducer_min_max.h
>> b/libcilkrts/include/cilk/reducer_min_max.h
>> index 55f068c..7fe09e8 100644
>> --- a/libcilkrts/include/cilk/reducer_min_max.h
>> +++ b/libcilkrts/include/cilk/reducer_min_max.h
>> @@ -3025,7 +3025,7 @@ struct legacy_reducer_downcast< reducer<
>> op_min_index<Index, Type, Compare, Alig
>>  #include <limits.h>
>>
>>  /* Wchar_t min/max constants */
>> -#if defined(_MSC_VER) || defined(ANDROID)
>> +#if defined(_MSC_VER) || defined(__ANDROID__)
>>  #   include <wchar.h>
>>  #else
>>  #   include <stdint.h>
>> diff --git a/libcilkrts/runtime/bug.h b/libcilkrts/runtime/bug.h
>> index bb18913..1a64bea 100644
>> --- a/libcilkrts/runtime/bug.h
>> +++ b/libcilkrts/runtime/bug.h
>> @@ -90,7 +90,7 @@ COMMON_PORTABLE extern const char *const
>> __cilkrts_assertion_failed;
>>   * GPL V3 licensed.
>>   */
>>  COMMON_PORTABLE void cilkbug_assert_no_uncaught_exception(void);
>> -#if defined(_WIN32) || defined(ANDROID)
>> +#if defined(_WIN32) || defined(__ANDROID__)
>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION()
>>  #else
>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION() \
>> diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
>> index fafb91d..85bc08d 100644
>> --- a/libcilkrts/runtime/os-unix.c
>> +++ b/libcilkrts/runtime/os-unix.c
>> @@ -282,7 +282,7 @@ void __cilkrts_init_tls_variables(void)
>>  }
>>  #endif
>>
>> -#if defined (__linux__) && ! defined(ANDROID)
>> +#if defined (__linux__) && ! defined(__ANDROID__)
>>  /*
>>   * Get the thread id, rather than the pid. In the case of MIC offload, it's
>>   * possible that we have multiple threads entering Cilk, and each has a
>> @@ -354,7 +354,7 @@ static int linux_get_affinity_count (int tid)
>>
>>  COMMON_SYSDEP int __cilkrts_hardware_cpu_count(void)
>>  {
>> -#if defined ANDROID || (defined(__sun__) && defined(__svr4__))
>> +#if defined __ANDROID__ || (defined(__sun__) && defined(__svr4__))
>>      return sysconf (_SC_NPROCESSORS_ONLN);
>>  #elif defined __MIC__
>>      /// HACK: Usually, the 3rd and 4th hyperthreads are not beneficial
>> @@ -409,7 +409,7 @@ COMMON_SYSDEP void __cilkrts_yield(void)
>>      // giving up the processor and latency starting up when work becomes
>>      // available
>>      _mm_delay_32(1024);
>> -#elif defined(ANDROID) || (defined(__sun__) && defined(__svr4__))
>> +#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
>>      // On Android and Solaris, call sched_yield to yield quantum.  I'm not
>>      // sure why we don't do this on Linux also.
>>      sched_yield();
>>
>>
>>
>>
>> Is it OK?
>>
>> --Alexander
Richard Guenther - April 4, 2014, 10:19 a.m.
On Fri, Apr 4, 2014 at 12:03 PM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
> *ping*

I wonder whether this is consistend between compilers (note GCC is not
upstream here?).  So eventually all places should be ANDROID || __ANDROID__?

Richard.

> --Alexander
>
> 2014-03-27 13:43 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
>> Adding Balaji.
>>
>> --Alexander
>>
>> 2014-03-26 18:56 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
>>> Hi,
>>>
>>> In gcc/config/linux-android.h we have "builtin_define ("__ANDROID__");"
>>> So "ANDROID" as in libcilkrts now is not the correct macro to check.
>>>
>>> Bootstrapped and passed cilk testsuite on x86_64-unknown-linux-gnu.
>>>
>>> diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
>>> index eb0d6ec..65efef0 100644
>>> --- a/libcilkrts/ChangeLog
>>> +++ b/libcilkrts/ChangeLog
>>> @@ -1,3 +1,12 @@
>>> +2014-03-26  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>>> +
>>> + PR bootstrap/60644
>>> +
>>> + * include/cilk/metaprogramming.h: Change ANDROID to __ANDROID__.
>>> + * include/cilk/reducer_min_max.h: Ditto.
>>> + * runtime/bug.h: Ditto.
>>> + * runtime/os-unix.c: Ditto.
>>> +
>>>  2014-03-20  Tobias Burnus  <burnus@net-b.de>
>>>
>>>   PR other/60589
>>> diff --git a/libcilkrts/include/cilk/metaprogramming.h
>>> b/libcilkrts/include/cilk/metaprogramming.h
>>> index 5f6f29d..29b0839 100644
>>> --- a/libcilkrts/include/cilk/metaprogramming.h
>>> +++ b/libcilkrts/include/cilk/metaprogramming.h
>>> @@ -468,7 +468,7 @@ inline void* allocate_aligned(std::size_t size,
>>> std::size_t alignment)
>>>  #ifdef _WIN32
>>>      return _aligned_malloc(size, alignment);
>>>  #else
>>> -#if defined(ANDROID) || defined(__ANDROID__)
>>> +#if defined(__ANDROID__)
>>>      return memalign(std::max(alignment, sizeof(void*)), size);
>>>  #else
>>>      void* ptr;
>>> diff --git a/libcilkrts/include/cilk/reducer_min_max.h
>>> b/libcilkrts/include/cilk/reducer_min_max.h
>>> index 55f068c..7fe09e8 100644
>>> --- a/libcilkrts/include/cilk/reducer_min_max.h
>>> +++ b/libcilkrts/include/cilk/reducer_min_max.h
>>> @@ -3025,7 +3025,7 @@ struct legacy_reducer_downcast< reducer<
>>> op_min_index<Index, Type, Compare, Alig
>>>  #include <limits.h>
>>>
>>>  /* Wchar_t min/max constants */
>>> -#if defined(_MSC_VER) || defined(ANDROID)
>>> +#if defined(_MSC_VER) || defined(__ANDROID__)
>>>  #   include <wchar.h>
>>>  #else
>>>  #   include <stdint.h>
>>> diff --git a/libcilkrts/runtime/bug.h b/libcilkrts/runtime/bug.h
>>> index bb18913..1a64bea 100644
>>> --- a/libcilkrts/runtime/bug.h
>>> +++ b/libcilkrts/runtime/bug.h
>>> @@ -90,7 +90,7 @@ COMMON_PORTABLE extern const char *const
>>> __cilkrts_assertion_failed;
>>>   * GPL V3 licensed.
>>>   */
>>>  COMMON_PORTABLE void cilkbug_assert_no_uncaught_exception(void);
>>> -#if defined(_WIN32) || defined(ANDROID)
>>> +#if defined(_WIN32) || defined(__ANDROID__)
>>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION()
>>>  #else
>>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION() \
>>> diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
>>> index fafb91d..85bc08d 100644
>>> --- a/libcilkrts/runtime/os-unix.c
>>> +++ b/libcilkrts/runtime/os-unix.c
>>> @@ -282,7 +282,7 @@ void __cilkrts_init_tls_variables(void)
>>>  }
>>>  #endif
>>>
>>> -#if defined (__linux__) && ! defined(ANDROID)
>>> +#if defined (__linux__) && ! defined(__ANDROID__)
>>>  /*
>>>   * Get the thread id, rather than the pid. In the case of MIC offload, it's
>>>   * possible that we have multiple threads entering Cilk, and each has a
>>> @@ -354,7 +354,7 @@ static int linux_get_affinity_count (int tid)
>>>
>>>  COMMON_SYSDEP int __cilkrts_hardware_cpu_count(void)
>>>  {
>>> -#if defined ANDROID || (defined(__sun__) && defined(__svr4__))
>>> +#if defined __ANDROID__ || (defined(__sun__) && defined(__svr4__))
>>>      return sysconf (_SC_NPROCESSORS_ONLN);
>>>  #elif defined __MIC__
>>>      /// HACK: Usually, the 3rd and 4th hyperthreads are not beneficial
>>> @@ -409,7 +409,7 @@ COMMON_SYSDEP void __cilkrts_yield(void)
>>>      // giving up the processor and latency starting up when work becomes
>>>      // available
>>>      _mm_delay_32(1024);
>>> -#elif defined(ANDROID) || (defined(__sun__) && defined(__svr4__))
>>> +#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
>>>      // On Android and Solaris, call sched_yield to yield quantum.  I'm not
>>>      // sure why we don't do this on Linux also.
>>>      sched_yield();
>>>
>>>
>>>
>>>
>>> Is it OK?
>>>
>>> --Alexander
Alexander Ivchenko - April 4, 2014, 11:28 a.m.
2014-04-04 14:19 GMT+04:00 Richard Biener <richard.guenther@gmail.com>:
> On Fri, Apr 4, 2014 at 12:03 PM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
>> *ping*
>
> I wonder whether this is consistend between compilers (note GCC is not
> upstream here?).  So eventually all places should be ANDROID || __ANDROID__?
>
I checked that gcc-4.[678], llvm (trunk) and icc (14)  all have
__ANDROID__. If I understood your question correctly..
I don't see any reasons to check ANDROID macros during the build of libcilkrts.

>> 2014-03-27 13:43 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
>>> Adding Balaji.
>>>
>>> --Alexander
>>>
>>> 2014-03-26 18:56 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
>>>> Hi,
>>>>
>>>> In gcc/config/linux-android.h we have "builtin_define ("__ANDROID__");"
>>>> So "ANDROID" as in libcilkrts now is not the correct macro to check.
>>>>
>>>> Bootstrapped and passed cilk testsuite on x86_64-unknown-linux-gnu.
>>>>
>>>> diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
>>>> index eb0d6ec..65efef0 100644
>>>> --- a/libcilkrts/ChangeLog
>>>> +++ b/libcilkrts/ChangeLog
>>>> @@ -1,3 +1,12 @@
>>>> +2014-03-26  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>>>> +
>>>> + PR bootstrap/60644
>>>> +
>>>> + * include/cilk/metaprogramming.h: Change ANDROID to __ANDROID__.
>>>> + * include/cilk/reducer_min_max.h: Ditto.
>>>> + * runtime/bug.h: Ditto.
>>>> + * runtime/os-unix.c: Ditto.
>>>> +
>>>>  2014-03-20  Tobias Burnus  <burnus@net-b.de>
>>>>
>>>>   PR other/60589
>>>> diff --git a/libcilkrts/include/cilk/metaprogramming.h
>>>> b/libcilkrts/include/cilk/metaprogramming.h
>>>> index 5f6f29d..29b0839 100644
>>>> --- a/libcilkrts/include/cilk/metaprogramming.h
>>>> +++ b/libcilkrts/include/cilk/metaprogramming.h
>>>> @@ -468,7 +468,7 @@ inline void* allocate_aligned(std::size_t size,
>>>> std::size_t alignment)
>>>>  #ifdef _WIN32
>>>>      return _aligned_malloc(size, alignment);
>>>>  #else
>>>> -#if defined(ANDROID) || defined(__ANDROID__)
>>>> +#if defined(__ANDROID__)
>>>>      return memalign(std::max(alignment, sizeof(void*)), size);
>>>>  #else
>>>>      void* ptr;
>>>> diff --git a/libcilkrts/include/cilk/reducer_min_max.h
>>>> b/libcilkrts/include/cilk/reducer_min_max.h
>>>> index 55f068c..7fe09e8 100644
>>>> --- a/libcilkrts/include/cilk/reducer_min_max.h
>>>> +++ b/libcilkrts/include/cilk/reducer_min_max.h
>>>> @@ -3025,7 +3025,7 @@ struct legacy_reducer_downcast< reducer<
>>>> op_min_index<Index, Type, Compare, Alig
>>>>  #include <limits.h>
>>>>
>>>>  /* Wchar_t min/max constants */
>>>> -#if defined(_MSC_VER) || defined(ANDROID)
>>>> +#if defined(_MSC_VER) || defined(__ANDROID__)
>>>>  #   include <wchar.h>
>>>>  #else
>>>>  #   include <stdint.h>
>>>> diff --git a/libcilkrts/runtime/bug.h b/libcilkrts/runtime/bug.h
>>>> index bb18913..1a64bea 100644
>>>> --- a/libcilkrts/runtime/bug.h
>>>> +++ b/libcilkrts/runtime/bug.h
>>>> @@ -90,7 +90,7 @@ COMMON_PORTABLE extern const char *const
>>>> __cilkrts_assertion_failed;
>>>>   * GPL V3 licensed.
>>>>   */
>>>>  COMMON_PORTABLE void cilkbug_assert_no_uncaught_exception(void);
>>>> -#if defined(_WIN32) || defined(ANDROID)
>>>> +#if defined(_WIN32) || defined(__ANDROID__)
>>>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION()
>>>>  #else
>>>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION() \
>>>> diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
>>>> index fafb91d..85bc08d 100644
>>>> --- a/libcilkrts/runtime/os-unix.c
>>>> +++ b/libcilkrts/runtime/os-unix.c
>>>> @@ -282,7 +282,7 @@ void __cilkrts_init_tls_variables(void)
>>>>  }
>>>>  #endif
>>>>
>>>> -#if defined (__linux__) && ! defined(ANDROID)
>>>> +#if defined (__linux__) && ! defined(__ANDROID__)
>>>>  /*
>>>>   * Get the thread id, rather than the pid. In the case of MIC offload, it's
>>>>   * possible that we have multiple threads entering Cilk, and each has a
>>>> @@ -354,7 +354,7 @@ static int linux_get_affinity_count (int tid)
>>>>
>>>>  COMMON_SYSDEP int __cilkrts_hardware_cpu_count(void)
>>>>  {
>>>> -#if defined ANDROID || (defined(__sun__) && defined(__svr4__))
>>>> +#if defined __ANDROID__ || (defined(__sun__) && defined(__svr4__))
>>>>      return sysconf (_SC_NPROCESSORS_ONLN);
>>>>  #elif defined __MIC__
>>>>      /// HACK: Usually, the 3rd and 4th hyperthreads are not beneficial
>>>> @@ -409,7 +409,7 @@ COMMON_SYSDEP void __cilkrts_yield(void)
>>>>      // giving up the processor and latency starting up when work becomes
>>>>      // available
>>>>      _mm_delay_32(1024);
>>>> -#elif defined(ANDROID) || (defined(__sun__) && defined(__svr4__))
>>>> +#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
>>>>      // On Android and Solaris, call sched_yield to yield quantum.  I'm not
>>>>      // sure why we don't do this on Linux also.
>>>>      sched_yield();
>>>>
>>>>
>>>>
>>>>
>>>> Is it OK?
>>>>
>>>> --Alexander
Alexander Ivchenko - April 9, 2014, 11:46 a.m.
ping..

2014-04-04 15:28 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
> 2014-04-04 14:19 GMT+04:00 Richard Biener <richard.guenther@gmail.com>:
>> On Fri, Apr 4, 2014 at 12:03 PM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
>>> *ping*
>>
>> I wonder whether this is consistend between compilers (note GCC is not
>> upstream here?).  So eventually all places should be ANDROID || __ANDROID__?
>>
> I checked that gcc-4.[678], llvm (trunk) and icc (14)  all have
> __ANDROID__. If I understood your question correctly..
> I don't see any reasons to check ANDROID macros during the build of libcilkrts.
>
>>> 2014-03-27 13:43 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
>>>> Adding Balaji.
>>>>
>>>> --Alexander
>>>>
>>>> 2014-03-26 18:56 GMT+04:00 Alexander Ivchenko <aivchenk@gmail.com>:
>>>>> Hi,
>>>>>
>>>>> In gcc/config/linux-android.h we have "builtin_define ("__ANDROID__");"
>>>>> So "ANDROID" as in libcilkrts now is not the correct macro to check.
>>>>>
>>>>> Bootstrapped and passed cilk testsuite on x86_64-unknown-linux-gnu.
>>>>>
>>>>> diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
>>>>> index eb0d6ec..65efef0 100644
>>>>> --- a/libcilkrts/ChangeLog
>>>>> +++ b/libcilkrts/ChangeLog
>>>>> @@ -1,3 +1,12 @@
>>>>> +2014-03-26  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>>>>> +
>>>>> + PR bootstrap/60644
>>>>> +
>>>>> + * include/cilk/metaprogramming.h: Change ANDROID to __ANDROID__.
>>>>> + * include/cilk/reducer_min_max.h: Ditto.
>>>>> + * runtime/bug.h: Ditto.
>>>>> + * runtime/os-unix.c: Ditto.
>>>>> +
>>>>>  2014-03-20  Tobias Burnus  <burnus@net-b.de>
>>>>>
>>>>>   PR other/60589
>>>>> diff --git a/libcilkrts/include/cilk/metaprogramming.h
>>>>> b/libcilkrts/include/cilk/metaprogramming.h
>>>>> index 5f6f29d..29b0839 100644
>>>>> --- a/libcilkrts/include/cilk/metaprogramming.h
>>>>> +++ b/libcilkrts/include/cilk/metaprogramming.h
>>>>> @@ -468,7 +468,7 @@ inline void* allocate_aligned(std::size_t size,
>>>>> std::size_t alignment)
>>>>>  #ifdef _WIN32
>>>>>      return _aligned_malloc(size, alignment);
>>>>>  #else
>>>>> -#if defined(ANDROID) || defined(__ANDROID__)
>>>>> +#if defined(__ANDROID__)
>>>>>      return memalign(std::max(alignment, sizeof(void*)), size);
>>>>>  #else
>>>>>      void* ptr;
>>>>> diff --git a/libcilkrts/include/cilk/reducer_min_max.h
>>>>> b/libcilkrts/include/cilk/reducer_min_max.h
>>>>> index 55f068c..7fe09e8 100644
>>>>> --- a/libcilkrts/include/cilk/reducer_min_max.h
>>>>> +++ b/libcilkrts/include/cilk/reducer_min_max.h
>>>>> @@ -3025,7 +3025,7 @@ struct legacy_reducer_downcast< reducer<
>>>>> op_min_index<Index, Type, Compare, Alig
>>>>>  #include <limits.h>
>>>>>
>>>>>  /* Wchar_t min/max constants */
>>>>> -#if defined(_MSC_VER) || defined(ANDROID)
>>>>> +#if defined(_MSC_VER) || defined(__ANDROID__)
>>>>>  #   include <wchar.h>
>>>>>  #else
>>>>>  #   include <stdint.h>
>>>>> diff --git a/libcilkrts/runtime/bug.h b/libcilkrts/runtime/bug.h
>>>>> index bb18913..1a64bea 100644
>>>>> --- a/libcilkrts/runtime/bug.h
>>>>> +++ b/libcilkrts/runtime/bug.h
>>>>> @@ -90,7 +90,7 @@ COMMON_PORTABLE extern const char *const
>>>>> __cilkrts_assertion_failed;
>>>>>   * GPL V3 licensed.
>>>>>   */
>>>>>  COMMON_PORTABLE void cilkbug_assert_no_uncaught_exception(void);
>>>>> -#if defined(_WIN32) || defined(ANDROID)
>>>>> +#if defined(_WIN32) || defined(__ANDROID__)
>>>>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION()
>>>>>  #else
>>>>>  #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION() \
>>>>> diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
>>>>> index fafb91d..85bc08d 100644
>>>>> --- a/libcilkrts/runtime/os-unix.c
>>>>> +++ b/libcilkrts/runtime/os-unix.c
>>>>> @@ -282,7 +282,7 @@ void __cilkrts_init_tls_variables(void)
>>>>>  }
>>>>>  #endif
>>>>>
>>>>> -#if defined (__linux__) && ! defined(ANDROID)
>>>>> +#if defined (__linux__) && ! defined(__ANDROID__)
>>>>>  /*
>>>>>   * Get the thread id, rather than the pid. In the case of MIC offload, it's
>>>>>   * possible that we have multiple threads entering Cilk, and each has a
>>>>> @@ -354,7 +354,7 @@ static int linux_get_affinity_count (int tid)
>>>>>
>>>>>  COMMON_SYSDEP int __cilkrts_hardware_cpu_count(void)
>>>>>  {
>>>>> -#if defined ANDROID || (defined(__sun__) && defined(__svr4__))
>>>>> +#if defined __ANDROID__ || (defined(__sun__) && defined(__svr4__))
>>>>>      return sysconf (_SC_NPROCESSORS_ONLN);
>>>>>  #elif defined __MIC__
>>>>>      /// HACK: Usually, the 3rd and 4th hyperthreads are not beneficial
>>>>> @@ -409,7 +409,7 @@ COMMON_SYSDEP void __cilkrts_yield(void)
>>>>>      // giving up the processor and latency starting up when work becomes
>>>>>      // available
>>>>>      _mm_delay_32(1024);
>>>>> -#elif defined(ANDROID) || (defined(__sun__) && defined(__svr4__))
>>>>> +#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
>>>>>      // On Android and Solaris, call sched_yield to yield quantum.  I'm not
>>>>>      // sure why we don't do this on Linux also.
>>>>>      sched_yield();
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Is it OK?
>>>>>
>>>>> --Alexander
Jakub Jelinek - April 9, 2014, 12:05 p.m.
On Wed, Apr 09, 2014 at 03:46:13PM +0400, Alexander Ivchenko wrote:
> ping..

I guess it really depends on whether the libcilkrts sources are going to be
(semi?)regularly imported from some upstream repository or not, and if the
upstream is willing to accept these changes.

The alternative is to modify libcilkrts/configure.ac and/or
libcilkrts/Makefile.am, so that on Android target -DANDROID is passed to
libcilkrts compilation, if libcilkrts upstream wouldn't be willing to accept
the change.

So, we really need feedback from Balaji on this.

	Jakub
Iyer, Balaji V - April 9, 2014, 1:23 p.m.
> -----Original Message-----
> From: Jakub Jelinek [mailto:jakub@redhat.com]
> Sent: Wednesday, April 9, 2014 8:06 AM
> To: Alexander Ivchenko
> Cc: Richard Biener; GCC Patches; Iyer, Balaji V
> Subject: Re: Fix PR60644
> 
> On Wed, Apr 09, 2014 at 03:46:13PM +0400, Alexander Ivchenko wrote:
> > ping..
> 
> I guess it really depends on whether the libcilkrts sources are going to be
> (semi?)regularly imported from some upstream repository or not, and if the
> upstream is willing to accept these changes.
> 

Yes.
Jakub Jelinek - April 9, 2014, 1:28 p.m.
On Wed, Apr 09, 2014 at 01:23:59PM +0000, Iyer, Balaji V wrote:
> 
> 
> > -----Original Message-----
> > From: Jakub Jelinek [mailto:jakub@redhat.com]
> > Sent: Wednesday, April 9, 2014 8:06 AM
> > To: Alexander Ivchenko
> > Cc: Richard Biener; GCC Patches; Iyer, Balaji V
> > Subject: Re: Fix PR60644
> > 
> > On Wed, Apr 09, 2014 at 03:46:13PM +0400, Alexander Ivchenko wrote:
> > > ping..
> > 
> > I guess it really depends on whether the libcilkrts sources are going to be
> > (semi?)regularly imported from some upstream repository or not, and if the
> > upstream is willing to accept these changes.
> > 
> 
> Yes. 

So, are you ok with the changes and will you handle propagating them
upstream once they are committed to GCC?
If yes, the patch is preapproved.

	Jakub
Iyer, Balaji V - April 9, 2014, 1:31 p.m.
> -----Original Message-----
> From: Jakub Jelinek [mailto:jakub@redhat.com]
> Sent: Wednesday, April 9, 2014 9:29 AM
> To: Iyer, Balaji V
> Cc: Alexander Ivchenko; Richard Biener; GCC Patches
> Subject: Re: Fix PR60644
> 
> On Wed, Apr 09, 2014 at 01:23:59PM +0000, Iyer, Balaji V wrote:
> >
> >
> > > -----Original Message-----
> > > From: Jakub Jelinek [mailto:jakub@redhat.com]
> > > Sent: Wednesday, April 9, 2014 8:06 AM
> > > To: Alexander Ivchenko
> > > Cc: Richard Biener; GCC Patches; Iyer, Balaji V
> > > Subject: Re: Fix PR60644
> > >
> > > On Wed, Apr 09, 2014 at 03:46:13PM +0400, Alexander Ivchenko wrote:
> > > > ping..
> > >
> > > I guess it really depends on whether the libcilkrts sources are
> > > going to be (semi?)regularly imported from some upstream repository
> > > or not, and if the upstream is willing to accept these changes.
> > >
> >
> > Yes.
> 
> So, are you ok with the changes and will you handle propagating them
> upstream once they are committed to GCC?
> If yes, the patch is preapproved.

Yes, I am Ok with the changes. We will check the patch in soon that will fix this error.

> 
> 	Jakub
Alexander Ivchenko - April 9, 2014, 1:33 p.m.
The changes are consistent with what is currently in upstream. So
there is no additional work required

2014-04-09 17:31 GMT+04:00 Iyer, Balaji V <balaji.v.iyer@intel.com>:
>
>
>> -----Original Message-----
>> From: Jakub Jelinek [mailto:jakub@redhat.com]
>> Sent: Wednesday, April 9, 2014 9:29 AM
>> To: Iyer, Balaji V
>> Cc: Alexander Ivchenko; Richard Biener; GCC Patches
>> Subject: Re: Fix PR60644
>>
>> On Wed, Apr 09, 2014 at 01:23:59PM +0000, Iyer, Balaji V wrote:
>> >
>> >
>> > > -----Original Message-----
>> > > From: Jakub Jelinek [mailto:jakub@redhat.com]
>> > > Sent: Wednesday, April 9, 2014 8:06 AM
>> > > To: Alexander Ivchenko
>> > > Cc: Richard Biener; GCC Patches; Iyer, Balaji V
>> > > Subject: Re: Fix PR60644
>> > >
>> > > On Wed, Apr 09, 2014 at 03:46:13PM +0400, Alexander Ivchenko wrote:
>> > > > ping..
>> > >
>> > > I guess it really depends on whether the libcilkrts sources are
>> > > going to be (semi?)regularly imported from some upstream repository
>> > > or not, and if the upstream is willing to accept these changes.
>> > >
>> >
>> > Yes.
>>
>> So, are you ok with the changes and will you handle propagating them
>> upstream once they are committed to GCC?
>> If yes, the patch is preapproved.
>
> Yes, I am Ok with the changes. We will check the patch in soon that will fix this error.
>
>>
>>       Jakub

Patch

diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
index eb0d6ec..65efef0 100644
--- a/libcilkrts/ChangeLog
+++ b/libcilkrts/ChangeLog
@@ -1,3 +1,12 @@ 
+2014-03-26  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+ PR bootstrap/60644
+
+ * include/cilk/metaprogramming.h: Change ANDROID to __ANDROID__.
+ * include/cilk/reducer_min_max.h: Ditto.
+ * runtime/bug.h: Ditto.
+ * runtime/os-unix.c: Ditto.
+
 2014-03-20  Tobias Burnus  <burnus@net-b.de>

  PR other/60589
diff --git a/libcilkrts/include/cilk/metaprogramming.h
b/libcilkrts/include/cilk/metaprogramming.h
index 5f6f29d..29b0839 100644
--- a/libcilkrts/include/cilk/metaprogramming.h
+++ b/libcilkrts/include/cilk/metaprogramming.h
@@ -468,7 +468,7 @@  inline void* allocate_aligned(std::size_t size,
std::size_t alignment)
 #ifdef _WIN32
     return _aligned_malloc(size, alignment);
 #else
-#if defined(ANDROID) || defined(__ANDROID__)
+#if defined(__ANDROID__)
     return memalign(std::max(alignment, sizeof(void*)), size);
 #else
     void* ptr;
diff --git a/libcilkrts/include/cilk/reducer_min_max.h
b/libcilkrts/include/cilk/reducer_min_max.h
index 55f068c..7fe09e8 100644
--- a/libcilkrts/include/cilk/reducer_min_max.h
+++ b/libcilkrts/include/cilk/reducer_min_max.h
@@ -3025,7 +3025,7 @@  struct legacy_reducer_downcast< reducer<
op_min_index<Index, Type, Compare, Alig
 #include <limits.h>

 /* Wchar_t min/max constants */
-#if defined(_MSC_VER) || defined(ANDROID)
+#if defined(_MSC_VER) || defined(__ANDROID__)
 #   include <wchar.h>
 #else
 #   include <stdint.h>
diff --git a/libcilkrts/runtime/bug.h b/libcilkrts/runtime/bug.h
index bb18913..1a64bea 100644
--- a/libcilkrts/runtime/bug.h
+++ b/libcilkrts/runtime/bug.h
@@ -90,7 +90,7 @@  COMMON_PORTABLE extern const char *const
__cilkrts_assertion_failed;
  * GPL V3 licensed.
  */
 COMMON_PORTABLE void cilkbug_assert_no_uncaught_exception(void);
-#if defined(_WIN32) || defined(ANDROID)
+#if defined(_WIN32) || defined(__ANDROID__)
 #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION()
 #else
 #  define CILKBUG_ASSERT_NO_UNCAUGHT_EXCEPTION() \
diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
index fafb91d..85bc08d 100644
--- a/libcilkrts/runtime/os-unix.c
+++ b/libcilkrts/runtime/os-unix.c
@@ -282,7 +282,7 @@  void __cilkrts_init_tls_variables(void)
 }
 #endif

-#if defined (__linux__) && ! defined(ANDROID)
+#if defined (__linux__) && ! defined(__ANDROID__)
 /*
  * Get the thread id, rather than the pid. In the case of MIC offload, it's
  * possible that we have multiple threads entering Cilk, and each has a
@@ -354,7 +354,7 @@  static int linux_get_affinity_count (int tid)

 COMMON_SYSDEP int __cilkrts_hardware_cpu_count(void)
 {
-#if defined ANDROID || (defined(__sun__) && defined(__svr4__))
+#if defined __ANDROID__ || (defined(__sun__) && defined(__svr4__))
     return sysconf (_SC_NPROCESSORS_ONLN);
 #elif defined __MIC__
     /// HACK: Usually, the 3rd and 4th hyperthreads are not beneficial
@@ -409,7 +409,7 @@  COMMON_SYSDEP void __cilkrts_yield(void)
     // giving up the processor and latency starting up when work becomes
     // available
     _mm_delay_32(1024);
-#elif defined(ANDROID) || (defined(__sun__) && defined(__svr4__))
+#elif defined(__ANDROID__) || (defined(__sun__) && defined(__svr4__))
     // On Android and Solaris, call sched_yield to yield quantum.  I'm not
     // sure why we don't do this on Linux also.
     sched_yield();