* modules_plugin.h : Plugin management functions used by the core application.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules_plugin.h.in,v 1.8 2002/12/06 10:10:39 sam Exp $
+ * $Id: modules_plugin.h.in,v 1.9 2003/02/10 20:11:14 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
return( *handle == NULL );
#elif defined(RTLD_NOW)
+ /* static is OK, we are called atomically */
+ static vlc_bool_t b_kde = VLC_FALSE;
+
# if defined(SYS_LINUX)
- /* We should NOT open modules with RTLD_GLOBAL, or we are going to get
- * namespace collisions when two modules have common public symbols,
- * but ALSA is being a pest here. */
- if( strstr( psz_filename, "alsa" ) )
+ /* XXX HACK #1 - we should NOT open modules with RTLD_GLOBAL, or we
+ * are going to get namespace collisions when two modules have common
+ * public symbols, but ALSA is being a pest here. */
+ if( strstr( psz_filename, "alsa_plugin" ) )
{
*handle = dlopen( psz_filename, RTLD_NOW | RTLD_GLOBAL );
return( *handle == NULL );
}
# endif
+ /* XXX HACK #2 - the ugly KDE workaround. It seems that libkdewhatever
+ * causes dlopen() to segfault if libstdc++ is not loaded in the caller,
+ * so we just load libstdc++. Bwahahaha! ph34r! -- Sam. */
+ if( !b_kde && !strstr( psz_filename, "kde" ) )
+ {
+ dlopen( "libstdc++.so.6", RTLD_NOW )
+ || dlopen( "libstdc++.so.5", RTLD_NOW )
+ || dlopen( "libstdc++.so.4", RTLD_NOW )
+ || dlopen( "libstdc++.so.3", RTLD_NOW );
+ b_kde = VLC_TRUE;
+ }
+
*handle = dlopen( psz_filename, RTLD_NOW );
return( *handle == NULL );