From 378b211816b04985a90c52d91e1e4a49738ce702 Mon Sep 17 00:00:00 2001 From: hcg Date: Tue, 29 Jan 2013 15:26:42 +0000 Subject: [PATCH] [package] libdirectfb: When volotile keyword is not used, compiler generates code that uses old value of implementations and not the new one set by dlopen() git-svn-id: svn://svn.openwrt.org/openwrt/packages@35386 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...isable-asm.patch => 001-disable-asm.patch} | 0 .../patches/002-use-volatile-keyword.patch | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+) rename libs/libdirectfb/patches/{disable-asm.patch => 001-disable-asm.patch} (100%) create mode 100644 libs/libdirectfb/patches/002-use-volatile-keyword.patch diff --git a/libs/libdirectfb/patches/disable-asm.patch b/libs/libdirectfb/patches/001-disable-asm.patch similarity index 100% rename from libs/libdirectfb/patches/disable-asm.patch rename to libs/libdirectfb/patches/001-disable-asm.patch diff --git a/libs/libdirectfb/patches/002-use-volatile-keyword.patch b/libs/libdirectfb/patches/002-use-volatile-keyword.patch new file mode 100644 index 000000000..79041106a --- /dev/null +++ b/libs/libdirectfb/patches/002-use-volatile-keyword.patch @@ -0,0 +1,30 @@ +diff -burN DirectFB-1.4.2.orig/lib/direct/interface.c DirectFB-1.4.2/lib/direct/interface.c +--- DirectFB-1.4.2.orig/lib/direct/interface.c 2013-01-29 13:57:25.000000000 +0100 ++++ DirectFB-1.4.2/lib/direct/interface.c 2013-01-29 13:59:37.000000000 +0100 +@@ -74,7 +74,7 @@ + } DirectInterfaceImplementation; + + static pthread_mutex_t implementations_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +-static DirectLink *implementations = NULL; ++static DirectLink * volatile implementations = NULL; + + /**************************************************************************************************/ + +@@ -96,7 +96,7 @@ + D_DEBUG_AT( Direct_Interface, " -> %s | %s\n", impl->type, impl->implementation ); + + pthread_mutex_lock( &implementations_mutex ); +- direct_list_prepend( &implementations, &impl->link ); ++ direct_list_prepend( (DirectLink**)&implementations, &impl->link ); + pthread_mutex_unlock( &implementations_mutex ); + } + +@@ -111,7 +111,7 @@ + D_MAGIC_ASSERT( impl, DirectInterfaceImplementation ); + + if (impl->funcs == funcs) { +- direct_list_remove( &implementations, &impl->link ); ++ direct_list_remove( (DirectLink**)&implementations, &impl->link ); + + break; + }