Patchwork [libbacktrace] : Fix undeclared-symbols warning for SjLj-targets

login
register
mail settings
Submitter Kai Tietz
Date Jan. 18, 2013, 10:05 a.m.
Message ID <CAEwic4Y-UTcy-+Sv1H4WqVxnEAxm5oBrQHb_=iqG1YQABnuEEA@mail.gmail.com>
Download mbox | patch
Permalink /patch/213529/
State New
Headers show

Comments

Kai Tietz - Jan. 18, 2013, 10:05 a.m.
Hi,

this patch cleans up a undeclared-symbol issue in libbacktrace.
ChangeLog

2013-01-18  Kai Tietz  <ktietz@redhat.com>

	* backtrace.c (_Unwind_GetIPInfo): Add prototype.
	* simple.c (_Unwind_GetIPInfo): Likewise.

Tested for x86_64-w64-mingw32, and i686-w64-mingw32.  Ok for apply?

Kai
Jakub Jelinek - Jan. 18, 2013, 10:22 a.m.
On Fri, Jan 18, 2013 at 11:05:11AM +0100, Kai Tietz wrote:
> this patch cleans up a undeclared-symbol issue in libbacktrace.

It is prototyped in unwind.h, at least should be.

> 2013-01-18  Kai Tietz  <ktietz@redhat.com>
> 
> 	* backtrace.c (_Unwind_GetIPInfo): Add prototype.
> 	* simple.c (_Unwind_GetIPInfo): Likewise.
> 
> Tested for x86_64-w64-mingw32, and i686-w64-mingw32.  Ok for apply?

	Jakub
Kai Tietz - Jan. 18, 2013, 10:39 a.m.
Sure, it is.  But the point is that system's unwind.h header is used
over the local one.  So if you have an older gcc to build, you might
get the wrong unwind.h header.  I admit that this patch is a kludge
but fixes issue I have with bootstrap cross on cygwin by using a gcc
3.4.4 compiler.

2013/1/18 Jakub Jelinek <jakub@redhat.com>:
> On Fri, Jan 18, 2013 at 11:05:11AM +0100, Kai Tietz wrote:
>> this patch cleans up a undeclared-symbol issue in libbacktrace.
>
> It is prototyped in unwind.h, at least should be.
>
>> 2013-01-18  Kai Tietz  <ktietz@redhat.com>
>>
>>       * backtrace.c (_Unwind_GetIPInfo): Add prototype.
>>       * simple.c (_Unwind_GetIPInfo): Likewise.
>>
>> Tested for x86_64-w64-mingw32, and i686-w64-mingw32.  Ok for apply?
>
>         Jakub
Jakub Jelinek - Jan. 18, 2013, 10:55 a.m.
On Fri, Jan 18, 2013 at 11:39:41AM +0100, Kai Tietz wrote:
> Sure, it is.  But the point is that system's unwind.h header is used
> over the local one.  So if you have an older gcc to build, you might
> get the wrong unwind.h header.  I admit that this patch is a kludge
> but fixes issue I have with bootstrap cross on cygwin by using a gcc
> 3.4.4 compiler.

If you are using system gcc unwind.h, supposedly you are using system libgcc
too, and I'd expect if _Unwind_GetIPInfo isn't prototyped in unwind.h, then
it isn't available in libgcc{_eh.a,_s.so} either.  So libbacktrace
supposedly needs to check for that and fall back to using _Unwind_GetIP
instead.  But, we already have HAVE_GETIPINFO there, so the question is why
configure misbehaves for it if you don't have it in unwind.h ?

	Jakub

Patch

Index: backtrace.c
===================================================================
--- backtrace.c	(Revision 195288)
+++ backtrace.c	(Arbeitskopie)
@@ -55,6 +55,8 @@  struct backtrace_data
   int ret;
 };

+extern uintptr_t _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+
 /* Unwind library callback routine.  This is passed to
    _Unwind_Backtrace.  */

Index: simple.c
===================================================================
--- simple.c	(Revision 195288)
+++ simple.c	(Arbeitskopie)
@@ -35,6 +35,8 @@  POSSIBILITY OF SUCH DAMAGE.  */
 #include "unwind.h"
 #include "backtrace.h"

+extern uintptr_t _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+
 /* The simple_backtrace routine.  */

 /* Data passed through _Unwind_Backtrace.  */