commit: r499 - in trunk/libspread-util: . src
[email protected] Tue, 20 Mar 2012 18:19:15 -0400
| Newsgroups | gmane.network.spread.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: jonathan Date: 2012-03-20 18:19:15 -0400 (Tue, 20 Mar 2012) New Revision: 499 Modified: trunk/libspread-util/Changelog trunk/libspread-util/configure trunk/libspread-util/configure.in trunk/libspread-util/src/Makefile.in trunk/libspread-util/src/config.h.in trunk/libspread-util/src/events.c Log: Update libspread-util to release 4.2.0beta2 Modified: trunk/libspread-util/Changelog =================================================================== --- trunk/libspread-util/Changelog 2012-03-20 22:15:08 UTC (rev 498) +++ trunk/libspread-util/Changelog 2012-03-20 22:19:15 UTC (rev 499) @@ -1,3 +1,8 @@ +Tue Mar 20 17:57:44 2012 Jonathan Stanton <[email protected]> + + * configure.in: Make use of dladdr in the function name lookup code a compile time option so + systems that don't have dladdr can build the library without needing it. + Mon Mar 5 23:50:52 2012 Jonathan Stanton <[email protected]> * include/spu_alarm_types.h (CONF_SYS): Change CONF alarm type which conflicted with OpenSSL Modified: trunk/libspread-util/configure =================================================================== --- trunk/libspread-util/configure 2012-03-20 22:15:08 UTC (rev 498) +++ trunk/libspread-util/configure 2012-03-20 22:19:15 UTC (rev 499) @@ -725,6 +725,7 @@ with_catman with_docdir enable_threaded_alarm +enable_function_name_lookup ' ac_precious_vars='build_alias host_alias @@ -1362,6 +1363,8 @@ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threaded-alarm Turn on threaded Alarm call processing to move IO to separate thread + --disable-function-name-lookup + Disable the dladdr based function name lookups Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -10144,14 +10147,30 @@ fi +# control whether dladdr is used to lookup function names. Default is to use it. +# Check whether --enable-function-name-lookup was given. +if test "${enable_function_name_lookup+set}" = set; then + enableval=$enable_function_name_lookup; +fi +if test "x$enable_function_name_lookup" = "xno" ; then +cat >>confdefs.h <<\_ACEOF +#define DISABLE_FUNCTION_NAME_LOOKUP 1 +_ACEOF +fi + + + + + + LIBSPSO=none case "$host" in *-*-darwin*) Modified: trunk/libspread-util/configure.in =================================================================== --- trunk/libspread-util/configure.in 2012-03-20 22:15:08 UTC (rev 498) +++ trunk/libspread-util/configure.in 2012-03-20 22:19:15 UTC (rev 499) @@ -692,6 +692,16 @@ AC_DEFINE(USE_THREADED_ALARM, 1, [Enable Threaded Alarm code to move IO to separate thread]) fi +# control whether dladdr is used to lookup function names. Default is to use it. +AC_ARG_ENABLE([function-name-lookup], + [AS_HELP_STRING([--disable-function-name-lookup], [Disable the dladdr based function name lookups]) ], +) + +if test "x$enable_function_name_lookup" = "xno" ; then + AC_DEFINE(DISABLE_FUNCTION_NAME_LOOKUP, 1, [Disable lookups of function names using dladdr]) +fi + + AH_TOP( #ifndef _CONFIG_H #define _CONFIG_H Modified: trunk/libspread-util/src/Makefile.in =================================================================== --- trunk/libspread-util/src/Makefile.in 2012-03-20 22:15:08 UTC (rev 498) +++ trunk/libspread-util/src/Makefile.in 2012-03-20 22:19:15 UTC (rev 499) @@ -38,7 +38,7 @@ CFLAGS=@CFLAGS@ $(DEFINES) CPPFLAGS=@CPPFLAGS@ $(PATHS) @DEFS@ -LDFLAGS=@LDFLAGS@ +LDFLAGS=@LDFLAGS@ LIBS=@LIBS@ THLDFLAGS=@THLDFLAGS@ THLIBS=@THLIBS@ @@ -95,7 +95,8 @@ ) libspread-util.so: $(LIB_SHOBJS) - $(SHLD) -o $@ $(LIB_SHOBJS) $(SHLDFLAGS) $(SHLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION) + $(SHLD) -o libspread-util.so.$(LIBFULLVERSION) $(LIB_SHOBJS) $(SHLDFLAGS) $(SHLIBS) $(SHLDOPTION)$(SHLDNAME)$@.$(LIBVERSION) + $(SOFTLINK) -f libspread-util.so.$(LIBFULLVERSION) $@ install-libspread-util.so: libspread-util.so $(INSTALL) -m 0755 libspread-util.so $(DESTDIR)$(libdir)/libspread-util.so.$(LIBFULLVERSION) Modified: trunk/libspread-util/src/config.h.in =================================================================== --- trunk/libspread-util/src/config.h.in 2012-03-20 22:15:08 UTC (rev 498) +++ trunk/libspread-util/src/config.h.in 2012-03-20 22:19:15 UTC (rev 499) @@ -19,6 +19,9 @@ /* Define if your snprintf is busted */ #undef BROKEN_SNPRINTF +/* Disable lookups of function names using dladdr */ +#undef DISABLE_FUNCTION_NAME_LOOKUP + /* Define to 1 if you have the <arpa/inet.h> header file. */ #undef HAVE_ARPA_INET_H Modified: trunk/libspread-util/src/events.c =================================================================== --- trunk/libspread-util/src/events.c 2012-03-20 22:15:08 UTC (rev 498) +++ trunk/libspread-util/src/events.c 2012-03-20 22:19:15 UTC (rev 499) @@ -463,8 +463,16 @@ } +#ifdef DISABLE_FUNCTION_NAME_LOOKUP void E_lookup_function_name( void* fptr, char *fname, int fname_len ) { + snprintf( fname, fname_len -1, "LOOKUP_FAIL_0x%p", fptr); + /* NOTE: snprintf is safe if fname is too short, the string will be truncated and null terminated */ + return; +} +#else +void E_lookup_function_name( void* fptr, char *fname, int fname_len ) +{ Dl_info dli; int ret, len; @@ -488,6 +496,7 @@ } return; } +#endif void E_time_events( sp_time start, sp_time stop, fd_event *fev, time_event *tev) {