Patchwork [testsuite,android] Disabling thread_local4.C and thread_local4g.C for Android.

login
register
mail settings
Submitter Alexander Ivchenko
Date June 20, 2013, 11:30 a.m.
Message ID <CACysShjp+KACMQ76v+GAivVTEEOXF2sJbrDPasOYjiEvDnHkdQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/252880/
State New
Headers show

Comments

Alexander Ivchenko - June 20, 2013, 11:30 a.m.
Hi,

for Android:

FAIL: g++.dg/tls/thread_local4.C -std=gnu++11 (test for excess errors)
Excess errors:
<>/gcc/testsuite/g++.dg/tls/thread_local4.C:31:26: error:
'pthread_testcancel' was not declared in this scope
<>/gcc/testsuite/g++.dg/tls/thread_local4.C:40:24: error:
'pthread_cancel' was not declared in this scope

the same for thread_local4g.C.

from http://www.kandroid.org/ndk/docs/system/libc/OVERVIEW.html
"pthread_cancel() will not be supported in Bionic, because doing this
would involve making the C library significantly bigger for very
little benefit.
<...>"

The following patch switches those tests off for Android.



is it ok for trunk?


--Alexander
Alexander Ivchenko - July 12, 2013, 12:35 p.m.
*ping*

Thank you,
Alexander

2013/6/20 Alexander Ivchenko <aivchenk@gmail.com>:
> Hi,
>
> for Android:
>
> FAIL: g++.dg/tls/thread_local4.C -std=gnu++11 (test for excess errors)
> Excess errors:
> <>/gcc/testsuite/g++.dg/tls/thread_local4.C:31:26: error:
> 'pthread_testcancel' was not declared in this scope
> <>/gcc/testsuite/g++.dg/tls/thread_local4.C:40:24: error:
> 'pthread_cancel' was not declared in this scope
>
> the same for thread_local4g.C.
>
> from http://www.kandroid.org/ndk/docs/system/libc/OVERVIEW.html
> "pthread_cancel() will not be supported in Bionic, because doing this
> would involve making the C library significantly bigger for very
> little benefit.
> <...>"
>
> The following patch switches those tests off for Android.
>
> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
> index b8073d1..d217e4d 100644
> --- a/gcc/testsuite/ChangeLog
> +++ b/gcc/testsuite/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-06-19  Alexander Ivchenko  <alexander.ivchenko@intel.com>
> +
> +       * g++.dg/tls/thread_local4.C: Disable test for Android.
> +       * g++.dg/tls/thread_local4g.C: Ditto.
> +
>  2013-06-11  Tobias Burnus  <burnus@net-b.de>
>
>         PR fortran/57508
> diff --git a/gcc/testsuite/g++.dg/tls/thread_local4.C
> b/gcc/testsuite/g++.dg/tls/thread_local4.C
> index acf1cae..cc1a35a 100644
> --- a/gcc/testsuite/g++.dg/tls/thread_local4.C
> +++ b/gcc/testsuite/g++.dg/tls/thread_local4.C
> @@ -1,6 +1,7 @@
>  // Test for cleanups with pthread_cancel.
>
> -// { dg-do run }
> +// There is no support of pthread_cancel in Android.
> +// { dg-do run { target { ! *-*-android* } } }
>  // { dg-require-effective-target c++11 }
>  // { dg-require-effective-target tls_runtime }
>  // { dg-require-effective-target pthread }
> diff --git a/gcc/testsuite/g++.dg/tls/thread_local4g.C
> b/gcc/testsuite/g++.dg/tls/thread_local4g.C
> index f5bc3ff..756c6a2 100644
> --- a/gcc/testsuite/g++.dg/tls/thread_local4g.C
> +++ b/gcc/testsuite/g++.dg/tls/thread_local4g.C
> @@ -1,6 +1,7 @@
>  // Test for cleanups with pthread_cancel.
>
> -// { dg-do run }
> +// There is no support of pthread_cancel in Android.
> +// { dg-do run { target { ! *-*-android* } } }
>  // { dg-require-effective-target c++11 }
>  // { dg-require-effective-target tls_runtime }
>  // { dg-require-effective-target pthread }
>
>
> is it ok for trunk?
>
>
> --Alexander
Mike Stump - July 12, 2013, 10:34 p.m.
On Jun 20, 2013, at 4:30 AM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
> for Android:

> +2013-06-19  Alexander Ivchenko  <alexander.ivchenko@intel.com>
> +
> +       * g++.dg/tls/thread_local4.C: Disable test for Android.
> +       * g++.dg/tls/thread_local4g.C: Ditto.

> is it ok for trunk?

Ok.
Maxim Kuvyrkov - July 14, 2013, 7:46 a.m.
On 13/07/2013, at 10:34 AM, Mike Stump wrote:

> On Jun 20, 2013, at 4:30 AM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
>> for Android:
> 
>> +2013-06-19  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>> +
>> +       * g++.dg/tls/thread_local4.C: Disable test for Android.
>> +       * g++.dg/tls/thread_local4g.C: Ditto.
> 
>> is it ok for trunk?
> 
> Ok.

Alexander,

Your current patch as approved by Mike is OK, but it is more prudent to condition the tests on using Bionic libc, not the fact that target triplet has *-android* in it.  [E.g., it is possible to build a toolchain for, say, arm-linux-gnueabi which will use glibc for primary multilib, and bionic for secondary multilib.]

I didn't test the attached patch, so please confirm that it behaves as expected before applying it.

Thank you,

--
Maxim Kuvyrkov
KugelWorks
Alexander Ivchenko - July 26, 2013, 12:17 p.m.
Maxim, thank you for your input! That's for sure a better solution.

__BIONIC__ is not defined in features.h so I had to change the include
to ctype.h. (__BIONIC__ is defined in sys/ctypes.h, but it's not safe
to include that directly..)

tested on x86_64_unknow_linux and on android device.

Is it OK?

thanks,
Alexander

2013/7/14 Maxim Kuvyrkov <maxim@kugelworks.com>:
> On 13/07/2013, at 10:34 AM, Mike Stump wrote:
>
>> On Jun 20, 2013, at 4:30 AM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
>>> for Android:
>>
>>> +2013-06-19  Alexander Ivchenko  <alexander.ivchenko@intel.com>
>>> +
>>> +       * g++.dg/tls/thread_local4.C: Disable test for Android.
>>> +       * g++.dg/tls/thread_local4g.C: Ditto.
>>
>>> is it ok for trunk?
>>
>> Ok.
>
> Alexander,
>
> Your current patch as approved by Mike is OK, but it is more prudent to condition the tests on using Bionic libc, not the fact that target triplet has *-android* in it.  [E.g., it is possible to build a toolchain for, say, arm-linux-gnueabi which will use glibc for primary multilib, and bionic for secondary multilib.]
>
> I didn't test the attached patch, so please confirm that it behaves as expected before applying it.
>
> Thank you,
>
> --
> Maxim Kuvyrkov
> KugelWorks
>
Maxim Kuvyrkov - July 26, 2013, 8:42 p.m.
On 27/07/2013, at 12:17 AM, Alexander Ivchenko wrote:

> Maxim, thank you for your input! That's for sure a better solution.
> 
> __BIONIC__ is not defined in features.h so I had to change the include
> to ctype.h. (__BIONIC__ is defined in sys/ctypes.h, but it's not safe
> to include that directly..)
> 
> tested on x86_64_unknow_linux and on android device.
> 
> Is it OK?

OK.

Thanks,

--
Maxim Kuvyrkov
www.kugelworks.com
Kirill Yukhin - July 29, 2013, 6:06 a.m.
Hello,

> OK.
> 
Checked into MT: http://gcc.gnu.org/ml/gcc-cvs/2013-07/msg00731.html

--
Thanks, K

Patch

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b8073d1..d217e4d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@ 
+2013-06-19  Alexander Ivchenko  <alexander.ivchenko@intel.com>
+
+       * g++.dg/tls/thread_local4.C: Disable test for Android.
+       * g++.dg/tls/thread_local4g.C: Ditto.
+
 2013-06-11  Tobias Burnus  <burnus@net-b.de>

        PR fortran/57508
diff --git a/gcc/testsuite/g++.dg/tls/thread_local4.C
b/gcc/testsuite/g++.dg/tls/thread_local4.C
index acf1cae..cc1a35a 100644
--- a/gcc/testsuite/g++.dg/tls/thread_local4.C
+++ b/gcc/testsuite/g++.dg/tls/thread_local4.C
@@ -1,6 +1,7 @@ 
 // Test for cleanups with pthread_cancel.

-// { dg-do run }
+// There is no support of pthread_cancel in Android.
+// { dg-do run { target { ! *-*-android* } } }
 // { dg-require-effective-target c++11 }
 // { dg-require-effective-target tls_runtime }
 // { dg-require-effective-target pthread }
diff --git a/gcc/testsuite/g++.dg/tls/thread_local4g.C
b/gcc/testsuite/g++.dg/tls/thread_local4g.C
index f5bc3ff..756c6a2 100644
--- a/gcc/testsuite/g++.dg/tls/thread_local4g.C
+++ b/gcc/testsuite/g++.dg/tls/thread_local4g.C
@@ -1,6 +1,7 @@ 
 // Test for cleanups with pthread_cancel.

-// { dg-do run }
+// There is no support of pthread_cancel in Android.
+// { dg-do run { target { ! *-*-android* } } }
 // { dg-require-effective-target c++11 }
 // { dg-require-effective-target tls_runtime }
 // { dg-require-effective-target pthread }