From patchwork Wed Mar 26 14:56:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Ivchenko X-Patchwork-Id: 333970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 116E614008A for ; Thu, 27 Mar 2014 01:56:15 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=IbtYUdZSdzZhSWD72bCTHHG7mIpw7kER9xFC4foG7puFcc EfzwNIHBXcqEGxhHVhM6IQdhkJUkRuk8Mn2M3gtpmouSnYRBulIqxEse9wAHWZl8 1qohPigmVs8PT6FZvTvGkWBd5VzI87ERHyZiVh2yTIY0lpfDkeBiRJpDJrjUo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=xgj2qrkrmTO5JShtaGv/yYwIxG0=; b=IkuYenaPfc1sKBGfTNVK ffpc7qDR4Vje6dGCvQ8HgOHqBHxRrMz8pI/s3UOByiDucmFIjs+jGb6S2YaLu1qy 5E6CVWRnqZgyv8ZtkgHKLou7NzgHzHoOj7jh7X6dfdX04wVZ5YjhSaxYtg7+14fQ vivUEiFjt9jrzqbJmiFvPW0= Received: (qmail 20731 invoked by alias); 26 Mar 2014 14:56:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20698 invoked by uid 89); 26 Mar 2014 14:56:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f44.google.com Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 26 Mar 2014 14:56:05 +0000 Received: by mail-pa0-f44.google.com with SMTP id bj1so2052921pad.3 for ; Wed, 26 Mar 2014 07:56:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.68.189.5 with SMTP id ge5mr86344489pbc.42.1395845763170; Wed, 26 Mar 2014 07:56:03 -0700 (PDT) Received: by 10.68.54.4 with HTTP; Wed, 26 Mar 2014 07:56:03 -0700 (PDT) Date: Wed, 26 Mar 2014 18:56:03 +0400 Message-ID: Subject: Fix PR60644 From: Alexander Ivchenko To: GCC Patches X-IsSubscribed: yes 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 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 + + 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 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 /* Wchar_t min/max constants */ -#if defined(_MSC_VER) || defined(ANDROID) +#if defined(_MSC_VER) || defined(__ANDROID__) # include #else # include 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();