TDBC fails to build properly on Unices where __attribute__((__visibility__("hidden"))) is supported.
Cause of problem: Tdbc_Init() is defined in tdbc.c with storage class TDBCAPI, which is #defined as MODULE_SCOPE, which is in turn #defined as __attribute__((__visibility__("hidden"))), which means "do not make this symbol visible to dlsym() or ld.so".
That's exactly backwards: extension *_Init routines *must* be visible to dlsym(), so should be declared and defined with storage class DLLEXPORT (not MODULE_SCOPE, not EXTERN, and especially not TCL_STORAGE_CLASS).
<hr /><i>anonymous claiming to be jenglish added on 2012-07-11 21:54:12 UTC:</i><br />
(hope this patch survives fossilization)
--- tdbc.h.broken 2012-07-11 14:13:28.669980232 -0700
+++ tdbc.h 2012-07-11 14:21:15.664986200 -0700
@@ -28,17 +28,7 @@
# endif
#endif
-#undef TCL_STORAGE_CLASS
-#ifdef BUILD_tdbc
-# define TCL_STORAGE_CLASS DLLEXPORT
-#else
-# define TCL_STORAGE_CLASS
-#endif
-
-EXTERN int Tdbc_Init(Tcl_Interp *interp);
-
-#undef TCL_STORAGE_CLASS
-#define TCL_STORAGE_CLASS DLLIMPORT
+DLLEXPORT int Tdbc_Init(Tcl_Interp *interp);
/*
* TDBC_VERSION and TDBC_PATCHLEVEL here must match the ones that
--- tdbc.c.broken 2012-07-11 14:27:13.718553784 -0700
+++ tdbc.c 2012-07-11 14:27:23.367086984 -0700
@@ -191,7 +191,7 @@
*-----------------------------------------------------------------------------
*/
-TDBCAPI int
+DLLEXPORT int
Tdbc_Init(
Tcl_Interp* interp /* Tcl interpreter */
) {
<hr /><i>jan.nijtmans added on 2012-07-11 22:51:33 UTC:</i><br />
Should be fixed now
|