Patchwork [RFC] Fix libstdc++ test fails with emutls

login
register
mail settings
Submitter Jie Zhang
Date Nov. 1, 2010, 5:45 a.m.
Message ID <4CCE5416.1000001@codesourcery.com>
Download mbox | patch
Permalink /patch/69751/
State New
Headers show

Comments

Jie Zhang - Nov. 1, 2010, 5:45 a.m.
Hi,

When testing libstdc++ for mips-linux-gnu target with uClibc as the C 
library, I saw these tests failed because of link error:

30_threads/future/members/get.cc (test for excess errors)
30_threads/future/members/get2.cc (test for excess errors)
30_threads/future/members/valid.cc (test for excess errors)
30_threads/future/members/wait.cc (test for excess errors)
30_threads/future/members/wait_for.cc (test for excess errors)
30_threads/future/members/wait_until.cc (test for excess errors)
30_threads/packaged_task/members/get_future.cc (test for excess errors)
30_threads/packaged_task/members/invoke.cc (test for excess errors)
30_threads/packaged_task/members/invoke2.cc (test for excess errors)
30_threads/packaged_task/members/invoke3.cc (test for excess errors)
30_threads/packaged_task/members/invoke4.cc (test for excess errors)
30_threads/packaged_task/members/invoke5.cc (test for excess errors)
30_threads/packaged_task/members/reset2.cc (test for excess errors)
30_threads/promise/cons/move.cc (test for excess errors)
30_threads/promise/cons/move_assign.cc (test for excess errors)
30_threads/promise/members/get_future.cc (test for excess errors)
30_threads/promise/members/set_exception.cc (test for excess errors)
30_threads/promise/members/set_exception2.cc (test for excess errors)
30_threads/promise/members/set_value.cc (test for excess errors)
30_threads/promise/members/set_value2.cc (test for excess errors)
30_threads/promise/members/set_value3.cc (test for excess errors)
30_threads/promise/members/swap.cc (test for excess errors)
30_threads/shared_future/members/get.cc (test for excess errors)
30_threads/shared_future/members/get2.cc (test for excess errors)
30_threads/shared_future/members/valid.cc (test for excess errors)
30_threads/shared_future/members/wait.cc (test for excess errors)
30_threads/shared_future/members/wait_for.cc (test for excess errors)
30_threads/shared_future/members/wait_until.cc (test for excess errors)

The link error looks like:

mutex:704: undefined reference to `__emutls_v._ZSt15__once_callable'

This patch should fix this error by exporting such like symbols.

Is this patch OK?


Regards,
Jakub Jelinek - Nov. 1, 2010, 7:48 a.m.
On Mon, Nov 01, 2010 at 01:45:58PM +0800, Jie Zhang wrote:
> mutex:704: undefined reference to `__emutls_v._ZSt15__once_callable'
> 
> This patch should fix this error by exporting such like symbols.
> 
> Is this patch OK?

You shouldn't be exporting symbols that weren't (even by mistake) exported
earlier in older symbol versions, always add new symbols to the latest
version (GLIBCXX_3.4.15 right now).
> 
> 	* config/abi/pre/gnu.ver: Export __emutls_v._ZSt11__once_call
> 	and __emutls_v._ZSt15__once_callable.
> 
> Index: config/abi/pre/gnu.ver
> ===================================================================
> --- config/abi/pre/gnu.ver	(revision 166125)
> +++ config/abi/pre/gnu.ver	(working copy)
> @@ -992,7 +992,9 @@
>      _ZNKSt10lock_error4whatEv;
>  
>      _ZSt11__once_call;
> +    __emutls_v._ZSt11__once_call;
>      _ZSt15__once_callable;
> +    __emutls_v._ZSt15__once_callable;
>      _ZSt14__once_functor;
>      _ZSt23__get_once_functor_lockv;
>      __once_proxy;


	Jakub
Paolo Carlini - Nov. 1, 2010, 1:59 p.m.
On 11/01/2010 08:48 AM, Jakub Jelinek wrote:
> On Mon, Nov 01, 2010 at 01:45:58PM +0800, Jie Zhang wrote:
>   
>> mutex:704: undefined reference to `__emutls_v._ZSt15__once_callable'
>>
>> This patch should fix this error by exporting such like symbols.
>>
>> Is this patch OK?
>>     
> You shouldn't be exporting symbols that weren't (even by mistake) exported
> earlier in older symbol versions, always add new symbols to the latest
> version (GLIBCXX_3.4.15 right now).
>   
Indeed. Consider the patch adding the symbols @ GLIBCXX_3.4.15
(preferably with a one-line comment before) preapproved.

Paolo.

Patch


	* config/abi/pre/gnu.ver: Export __emutls_v._ZSt11__once_call
	and __emutls_v._ZSt15__once_callable.

Index: config/abi/pre/gnu.ver
===================================================================
--- config/abi/pre/gnu.ver	(revision 166125)
+++ config/abi/pre/gnu.ver	(working copy)
@@ -992,7 +992,9 @@ 
     _ZNKSt10lock_error4whatEv;
 
     _ZSt11__once_call;
+    __emutls_v._ZSt11__once_call;
     _ZSt15__once_callable;
+    __emutls_v._ZSt15__once_callable;
     _ZSt14__once_functor;
     _ZSt23__get_once_functor_lockv;
     __once_proxy;