Date:2012-03-29 02:28:41 (11 years 11 months ago)
Author:David Kühling
Commit:caaecfd42d769227d8e69bed94efc3a0918efcd2
Message:alpy: fix (workaround) segfault caused by openwrt dynamic linker pecularities

Files: alpy/Makefile (2 diffs)
alpy/patches/005-dl.patch (1 diff)

Change Details

alpy/Makefile
5858# $(PKG_BUILD_DIR)/setup.py build
5959# endef
6060
61TARGET_LDFLAGS += -lalleg -lm -lpthread
61TARGET_LDFLAGS += -lm -lpthread -ldl -lrt -lalleg
6262
6363define Build/Install
6464    $(call Build/Compile/PyMod,, \
...... 
8080
8181# The following comments configure the Emacs editor. Just ignore them.
8282# Local Variables:
83# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/alpy/compile -j2 V=99"
83# compile-command: "cd ~/src/nanonote/Alpy-0.1.5 && ~/bin/quilt-export target && make -C ~/h/src/qi/openwrt-xburst package/alpy/compile -j2 V=99"
8484# End:
alpy/patches/005-dl.patch
2525             m = __import__('_alpy')
2626             handle.close()
2727             return m
28Index: Alpy-0.1.5/_alpymodule.c
29===================================================================
30--- Alpy-0.1.5.orig/_alpymodule.c 2012-03-29 00:20:15.351117567 +0200
31@@ -29,6 +29,7 @@
32 #include "allegro.h"
33 #include <stdlib.h>
34 #include <string.h>
35+#include <dlfcn.h>
36
37 static const char *_utf8 = "utf8";
38
39@@ -237,6 +238,13 @@
40 {
41     int result, alpy_system = SYSTEM_AUTODETECT;
42
43+ /* this is an ugly hack added for OpenWRT: seems that recursive library
44+ dependencies won't get the treatment configured in alpy.py via
45+ sys.setdlopenflags(), so that aleg-fbcon.so references into liballegro
46+ are not referenced. Of course we could also go and fix liballegro to
47+ make all modules explicitely link to liballegro themselves. */
48+ dlopen("liballeg.so", RTLD_NOW|RTLD_GLOBAL);
49+
50     if (!alpy_allegro_installed) {
51         alpy_allegro_installed++;
52

Archive Download the corresponding diff file



interactive