Gentoo Archives: gentoo-commits

From: "Alexis Ballier (aballier)" <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in gnome-base/gnome-session/files: gnome-session-2.26.1-execinfo.patch
Date: Fri, 26 Jun 2009 20:49:48
Message-Id: E1MKIMk-0000e5-6s@stork.gentoo.org
1 aballier 09/06/26 20:49:46
2
3 Added: gnome-session-2.26.1-execinfo.patch
4 Log:
5 Add build fix for bsd, check for execinfo and link to it if needed, bug #275524, gnome bug #587088
6 (Portage version: 2.2_rc33/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 gnome-base/gnome-session/files/gnome-session-2.26.1-execinfo.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.26.1-execinfo.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/gnome-session/files/gnome-session-2.26.1-execinfo.patch?rev=1.1&content-type=text/plain
13
14 Index: gnome-session-2.26.1-execinfo.patch
15 ===================================================================
16 From 6b551c1c6061fe6431ff265f7acc7ff227236b7d Mon Sep 17 00:00:00 2001
17 From: Alexis Ballier <aballier@g.o>
18 Date: Fri, 26 Jun 2009 21:42:41 +0200
19 Subject: [PATCH] Fix build on systems without execinfo in the libc.
20
21 Try to see if we have execinfo.h, and if we need to link to an extra library for using it. For instance FreeBSD does not have execinfo.h but a port has been made and we can use libexecinfo.
22 ---
23 configure.in | 9 +++++++++
24 gnome-session/Makefile.am | 1 +
25 gnome-session/gdm-signal-handler.c | 6 ++++++
26 3 files changed, 16 insertions(+), 0 deletions(-)
27
28 diff --git a/configure.in b/configure.in
29 index 1b8067c..55a566c 100644
30 --- a/configure.in
31 +++ b/configure.in
32 @@ -253,6 +253,15 @@ AC_HEADER_STDC
33 AC_CHECK_HEADERS(syslog.h tcpd.h sys/param.h)
34
35 dnl ====================================================================
36 +dnl check for backtrace support
37 +dnl ====================================================================
38 +
39 +AC_CHECK_HEADERS(execinfo.h)
40 +LIBEXECINFO=""
41 +AC_CHECK_LIB(execinfo, backtrace, [LIBEXECINFO="-lexecinfo"],[])
42 +AC_SUBST(LIBEXECINFO)
43 +
44 +dnl ====================================================================
45 dnl Check for newish X interface
46 dnl ====================================================================
47 oCFLAGS="$CFLAGS"
48 diff --git a/gnome-session/Makefile.am b/gnome-session/Makefile.am
49 index d5cb98c..fb81bb8 100644
50 --- a/gnome-session/Makefile.am
51 +++ b/gnome-session/Makefile.am
52 @@ -53,6 +53,7 @@ gnome_session_LDADD = \
53 $(POLKIT_GNOME_LIBS) \
54 $(XRENDER_LIBS) \
55 $(XTEST_LIBS) \
56 + $(LIBEXECINFO) \
57 $(NULL)
58
59 gnome_session_SOURCES = \
60 diff --git a/gnome-session/gdm-signal-handler.c b/gnome-session/gdm-signal-handler.c
61 index 58dca7d..353f79f 100644
62 --- a/gnome-session/gdm-signal-handler.c
63 +++ b/gnome-session/gdm-signal-handler.c
64 @@ -27,7 +27,9 @@
65 #include <unistd.h>
66 #include <string.h>
67 #include <signal.h>
68 +#if HAVE_EXECINFO_H
69 #include <execinfo.h>
70 +#endif
71 #include <syslog.h>
72 #include <sys/wait.h>
73 #include <sys/stat.h>
74 @@ -160,6 +162,7 @@ signal_io_watch (GIOChannel *ioc,
75 static void
76 fallback_get_backtrace (void)
77 {
78 +#if HAVE_EXECINFO_H
79 void * frames[64];
80 size_t size;
81 char ** strings;
82 @@ -174,8 +177,11 @@ fallback_get_backtrace (void)
83 free (strings);
84 syslog (LOG_CRIT, "******************* END **********************************");
85 } else {
86 +#endif
87 g_warning ("GDM crashed, but symbols couldn't be retrieved.");
88 +#if HAVE_EXECINFO_H
89 }
90 +#endif
91 }
92
93
94 --
95 1.6.3.3