Merge lp:~midori/midori/execinfo into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Cris Dywan
Approved revision: 6398
Merged at revision: 6411
Proposed branch: lp:~midori/midori/execinfo
Merge into: lp:midori
Diff against target: 97 lines (+19/-7)
4 files modified
CMakeLists.txt (+12/-2)
extensions/devpet.vala (+4/-4)
midori/midori.vapi (+1/-1)
wscript (+2/-0)
To merge this branch: bzr merge lp:~midori/midori/execinfo
Reviewer Review Type Date Requested Status
Cris Dywan Approve
Olivier Duchateau (community) Needs Fixing
André Stösel Approve
Review via email: mp+185649@code.launchpad.net

Commit message

Check if execinfo.h header exists on BSD

To post a comment you must log in.
lp:~midori/midori/execinfo updated
6397. By André Stösel

fix backtrace check for bsd

Revision history for this message
André Stösel (ivaldi) wrote :

cmake didn't work for me - i changes some things, but i'm not a cmake expert :/

review: Approve
Revision history for this message
Olivier Duchateau (duchateau-olivier) wrote :

I'm sorry, but even patch is correct, I noticed in extensions box, this message:

/usr/local/lib/midori/libdevpet.so: Undefined symbol "backtrace_symbol"

So I think devpet need to be disable under BSD systems (we use same package).

Below new patch:

I don't know if libexecinfo.so is present in Window, perhaps we can make simpler test, like this

if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")

endif ()

--- ./extensions/CMakeLists.txt.orig 2013-09-17 10:59:53.000000000 +0000
+++ ./extensions/CMakeLists.txt 2013-09-17 14:46:05.000000000 +0000
@@ -24,6 +24,13 @@
          "nsplugin-manager.vala"
          )
 endif ()
+string(FIND ${CMAKE_SYSTEM_NAME} "BSD" BEGIN)
+string(SUBSTRING ${CMAKE_SYSTEM_NAME} ${BEGIN} 3 BSD)
+if (BSD)
+ list(REMOVE_ITEM EXTENSIONS
+ "devpet.vala"
+ )
+endif ()

 foreach(UNIT_SRC ${EXTENSIONS})
     string(FIND ${UNIT_SRC} ".c" UNIT_EXTENSION)

review: Needs Fixing
Revision history for this message
André Stösel (ivaldi) wrote :

so "if (HAVE_EXECINFO_H)" is true for you?
maybe we need to link against some lib?

however, devpet works without backtrace support too -> we just need to remove "-D HAVE_EXECINFO_H"

Revision history for this message
Olivier Duchateau (duchateau-olivier) wrote :

> cmake didn't work for me - i changes some things, but i'm not a cmake expert
> :/

I tested your latest revision (r6397), but I get same behaviour "Undefined symbol"

If I add CFLAGS -lexecinfo, Midori crashes (at start time), when devpet is enabled (without error, or warning message).

Unfortunately I not able to analize coredump.

Here patches which prevent building this extension.

--- ./extensions/CMakeLists.txt.orig 2013-09-17 10:59:53.000000000 +0000
+++ ./extensions/CMakeLists.txt 2013-09-17 14:46:05.000000000 +0000
@@ -24,6 +24,13 @@
          "nsplugin-manager.vala"
          )
 endif ()
+string(FIND ${CMAKE_SYSTEM_NAME} "BSD" BEGIN)
+string(SUBSTRING ${CMAKE_SYSTEM_NAME} ${BEGIN} 3 BSD)
+if (BSD)
+ list(REMOVE_ITEM EXTENSIONS
+ "devpet.vala"
+ )
+endif ()

 foreach(UNIT_SRC ${EXTENSIONS})
     string(FIND ${UNIT_SRC} ".c" UNIT_EXTENSION)

--- ./extensions/wscript_build.orig 2013-08-14 18:32:02.000000000 +0000
+++ ./extensions/wscript_build 2013-09-17 17:55:12.000000000 +0000
@@ -4,8 +4,12 @@

 import Options
 import os
+import sys

 extensions = os.listdir ('extensions')
+if 'bsd' in sys.platform:
+ if 'devpet.vala' in extensions:
+ extensions.remove('devpet.vala')
 for extension in extensions:
     # FIXME In the absense of a proper mechanism, transfers is a stock extension
     if not bld.env['addons'] and extension != 'transfers.vala':

lp:~midori/midori/execinfo updated
6398. By André Stösel

disable devpets backtrace support for freebsd

Revision history for this message
André Stösel (ivaldi) wrote :

should work now

Revision history for this message
Cris Dywan (kalikiana) wrote :

Looks like a sensible compromise.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-09-16 23:18:48 +0000
3+++ CMakeLists.txt 2013-09-22 11:07:36 +0000
4@@ -70,8 +70,7 @@
5 set(VALAFLAGS ${VALAFLAGS} -D HAVE_WIN32)
6 endif ()
7
8-string(FIND ${CMAKE_SYSTEM_NAME} "FreeBSD" FREEBSD)
9-if (FREEBSD GREATER -1)
10+if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
11 set(VALAFLAGS ${VALAFLAGS} -D HAVE_FREEBSD)
12 endif ()
13
14@@ -82,6 +81,17 @@
15 add_definitions("-DHAVE_OSX=0")
16 endif ()
17
18+# Check if execinfo.h header exists
19+string(FIND ${CMAKE_SYSTEM_NAME} "BSD" BEGIN)
20+if (${BEGIN} GREATER 0)
21+ string(SUBSTRING ${CMAKE_SYSTEM_NAME} ${BEGIN} 3 BSD)
22+else()
23+ set(BSD 0)
24+endif()
25+if (UNIX AND NOT BSD)
26+ set(VALAFLAGS ${VALAFLAGS} -D HAVE_EXECINFO_H)
27+endif ()
28+
29 find_package(PkgConfig)
30 pkg_check_modules(DEPS REQUIRED
31 libxml-2.0>=2.6
32
33=== modified file 'extensions/devpet.vala'
34--- extensions/devpet.vala 2013-09-17 22:12:02 +0000
35+++ extensions/devpet.vala 2013-09-22 11:07:36 +0000
36@@ -96,7 +96,7 @@
37 Gtk.VBox vbox = new Gtk.VBox (false, 1);
38 this.add (vbox);
39
40- #if !HAVE_WIN32
41+ #if HAVE_EXECINFO_H
42 Gtk.Label label = new Gtk.Label (_("Double click for more information"));
43 vbox.pack_start (label, false, false, 0);
44 #endif
45@@ -123,7 +123,7 @@
46 -1, "Message",
47 new Gtk.CellRendererText (), "text", TreeCells.MESSAGE);
48
49- #if !HAVE_WIN32
50+ #if HAVE_EXECINFO_H
51 treeview.row_activated.connect (this.row_activated);
52 #endif
53
54@@ -174,7 +174,7 @@
55 this.trayicon.set_from_stock (stock);
56 }
57
58- #if !HAVE_WIN32
59+ #if HAVE_EXECINFO_H
60 string bt = "";
61 void* buffer[100];
62 int num = Linux.backtrace (buffer, 100);
63@@ -191,7 +191,7 @@
64 this.list_store.append (out iter);
65 this.list_store.set (iter,
66 TreeCells.MESSAGE, message,
67- #if !HAVE_WIN32
68+ #if HAVE_EXECINFO_H
69 TreeCells.BACKTRACE, bt,
70 #endif
71 TreeCells.STOCK, stock);
72
73=== modified file 'midori/midori.vapi'
74--- midori/midori.vapi 2013-09-03 14:45:17 +0000
75+++ midori/midori.vapi 2013-09-22 11:07:36 +0000
76@@ -263,7 +263,7 @@
77 #endif
78 }
79
80- #if !HAVE_WIN32
81+ #if HAVE_EXECINFO_H
82 [CCode (lower_case_cprefix = "")]
83 namespace Linux {
84 [CCode (cheader_filename = "execinfo.h", array_length = false)]
85
86=== modified file 'wscript'
87--- wscript 2013-08-21 23:24:00 +0000
88+++ wscript 2013-09-22 11:07:36 +0000
89@@ -228,6 +228,8 @@
90 elif sys.platform != 'darwin':
91 if sys.platform.startswith ('freebsd'):
92 conf.env.append_value ('VALAFLAGS', '-D HAVE_FREEBSD')
93+ else:
94+ conf.env.append_value ('VALAFLAGS', '-D HAVE_EXECINFO_H')
95
96 check_pkg ('x11')
97 # Pass /usr/X11R6/include for OpenBSD

Subscribers

People subscribed via source and target branches

to all changes: