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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-09-16 23:18:48 +0000
+++ CMakeLists.txt 2013-09-22 11:07:36 +0000
@@ -70,8 +70,7 @@
70 set(VALAFLAGS ${VALAFLAGS} -D HAVE_WIN32)70 set(VALAFLAGS ${VALAFLAGS} -D HAVE_WIN32)
71endif ()71endif ()
7272
73string(FIND ${CMAKE_SYSTEM_NAME} "FreeBSD" FREEBSD)73if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
74if (FREEBSD GREATER -1)
75 set(VALAFLAGS ${VALAFLAGS} -D HAVE_FREEBSD)74 set(VALAFLAGS ${VALAFLAGS} -D HAVE_FREEBSD)
76endif ()75endif ()
7776
@@ -82,6 +81,17 @@
82 add_definitions("-DHAVE_OSX=0")81 add_definitions("-DHAVE_OSX=0")
83endif ()82endif ()
8483
84# Check if execinfo.h header exists
85string(FIND ${CMAKE_SYSTEM_NAME} "BSD" BEGIN)
86if (${BEGIN} GREATER 0)
87 string(SUBSTRING ${CMAKE_SYSTEM_NAME} ${BEGIN} 3 BSD)
88else()
89 set(BSD 0)
90endif()
91if (UNIX AND NOT BSD)
92 set(VALAFLAGS ${VALAFLAGS} -D HAVE_EXECINFO_H)
93endif ()
94
85find_package(PkgConfig)95find_package(PkgConfig)
86pkg_check_modules(DEPS REQUIRED96pkg_check_modules(DEPS REQUIRED
87 libxml-2.0>=2.697 libxml-2.0>=2.6
8898
=== modified file 'extensions/devpet.vala'
--- extensions/devpet.vala 2013-09-17 22:12:02 +0000
+++ extensions/devpet.vala 2013-09-22 11:07:36 +0000
@@ -96,7 +96,7 @@
96 Gtk.VBox vbox = new Gtk.VBox (false, 1);96 Gtk.VBox vbox = new Gtk.VBox (false, 1);
97 this.add (vbox);97 this.add (vbox);
9898
99 #if !HAVE_WIN3299 #if HAVE_EXECINFO_H
100 Gtk.Label label = new Gtk.Label (_("Double click for more information"));100 Gtk.Label label = new Gtk.Label (_("Double click for more information"));
101 vbox.pack_start (label, false, false, 0);101 vbox.pack_start (label, false, false, 0);
102 #endif102 #endif
@@ -123,7 +123,7 @@
123 -1, "Message",123 -1, "Message",
124 new Gtk.CellRendererText (), "text", TreeCells.MESSAGE);124 new Gtk.CellRendererText (), "text", TreeCells.MESSAGE);
125125
126 #if !HAVE_WIN32126 #if HAVE_EXECINFO_H
127 treeview.row_activated.connect (this.row_activated);127 treeview.row_activated.connect (this.row_activated);
128 #endif128 #endif
129129
@@ -174,7 +174,7 @@
174 this.trayicon.set_from_stock (stock);174 this.trayicon.set_from_stock (stock);
175 }175 }
176176
177 #if !HAVE_WIN32177 #if HAVE_EXECINFO_H
178 string bt = "";178 string bt = "";
179 void* buffer[100];179 void* buffer[100];
180 int num = Linux.backtrace (buffer, 100);180 int num = Linux.backtrace (buffer, 100);
@@ -191,7 +191,7 @@
191 this.list_store.append (out iter);191 this.list_store.append (out iter);
192 this.list_store.set (iter,192 this.list_store.set (iter,
193 TreeCells.MESSAGE, message,193 TreeCells.MESSAGE, message,
194 #if !HAVE_WIN32194 #if HAVE_EXECINFO_H
195 TreeCells.BACKTRACE, bt,195 TreeCells.BACKTRACE, bt,
196 #endif196 #endif
197 TreeCells.STOCK, stock);197 TreeCells.STOCK, stock);
198198
=== modified file 'midori/midori.vapi'
--- midori/midori.vapi 2013-09-03 14:45:17 +0000
+++ midori/midori.vapi 2013-09-22 11:07:36 +0000
@@ -263,7 +263,7 @@
263 #endif263 #endif
264 }264 }
265265
266 #if !HAVE_WIN32266 #if HAVE_EXECINFO_H
267 [CCode (lower_case_cprefix = "")]267 [CCode (lower_case_cprefix = "")]
268 namespace Linux {268 namespace Linux {
269 [CCode (cheader_filename = "execinfo.h", array_length = false)]269 [CCode (cheader_filename = "execinfo.h", array_length = false)]
270270
=== modified file 'wscript'
--- wscript 2013-08-21 23:24:00 +0000
+++ wscript 2013-09-22 11:07:36 +0000
@@ -228,6 +228,8 @@
228 elif sys.platform != 'darwin':228 elif sys.platform != 'darwin':
229 if sys.platform.startswith ('freebsd'):229 if sys.platform.startswith ('freebsd'):
230 conf.env.append_value ('VALAFLAGS', '-D HAVE_FREEBSD')230 conf.env.append_value ('VALAFLAGS', '-D HAVE_FREEBSD')
231 else:
232 conf.env.append_value ('VALAFLAGS', '-D HAVE_EXECINFO_H')
231233
232 check_pkg ('x11')234 check_pkg ('x11')
233 # Pass /usr/X11R6/include for OpenBSD235 # Pass /usr/X11R6/include for OpenBSD

Subscribers

People subscribed via source and target branches

to all changes: