krb5 commit: Make bttest build with restricted lib exports

Tom Yu tlyu at mit.edu
Tue Aug 16 21:46:14 EDT 2016


https://github.com/krb5/krb5/commit/8c59d4cc3cfec84d6e4a694f87c319d2564984a3
commit 8c59d4cc3cfec84d6e4a694f87c319d2564984a3
Author: Tom Yu <tlyu at mit.edu>
Date:   Mon Aug 8 09:13:59 2016 -0400

    Make bttest build with restricted lib exports
    
    On platforms that use strict library export lists, the libdb2 btree
    debugging program bttest won't build with -DDEBUG or -DSTATISTICS
    because some needed functions aren't in the export list.
    
    Add the missing bt_debug.c and mpool.c functions to libdb.exports.
    Stub out these functions when built without -DDEBUG or -DSTATISTICS to
    avoid unreferenced symbols, because conditionalizing library export
    lists isn't easy.
    
    ticket: 8478

 src/plugins/kdb/db2/libdb2/btree/bt_debug.c |   27 +++++++++++++++++++++++++++
 src/plugins/kdb/db2/libdb2/libdb.exports    |    6 ++++++
 src/plugins/kdb/db2/libdb2/mpool/mpool.c    |    6 ++++++
 src/plugins/kdb/db2/libdb2/mpool/mpool.h    |    4 ++--
 4 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/src/plugins/kdb/db2/libdb2/btree/bt_debug.c b/src/plugins/kdb/db2/libdb2/btree/bt_debug.c
index b302ca6..d0bb56e 100644
--- a/src/plugins/kdb/db2/libdb2/btree/bt_debug.c
+++ b/src/plugins/kdb/db2/libdb2/btree/bt_debug.c
@@ -286,6 +286,27 @@ __bt_dpage(dbp, h)
 	(void)fflush(tracefp);
 	return (0);
 }
+#else
+int
+__bt_dump(DB *dbp)
+{
+	return (0);
+}
+int
+__bt_dmpage(PAGE *h)
+{
+	return (0);
+}
+int
+__bt_dnpage(DB *dbp, db_pgno_t pgno)
+{
+	return (0);
+}
+int
+__bt_dpage(DB *dbp, PAGE *h)
+{
+	return (0);
+}
 #endif
 
 #ifdef STATISTICS
@@ -375,4 +396,10 @@ __bt_stat(dbp)
 	(void)fflush(tracefp);
 	return (0);
 }
+#else
+int
+__bt_stat(DB *dbp)
+{
+	return (0);
+}
 #endif
diff --git a/src/plugins/kdb/db2/libdb2/libdb.exports b/src/plugins/kdb/db2/libdb2/libdb.exports
index 5dbc2e4..4d34947 100644
--- a/src/plugins/kdb/db2/libdb2/libdb.exports
+++ b/src/plugins/kdb/db2/libdb2/libdb.exports
@@ -12,6 +12,10 @@ __kdb2_bt_defcmp
 __kdb2_bt_defpfx
 __kdb2_bt_deleaf
 __kdb2_bt_delete
+__kdb2_bt_dmpage
+__kdb2_bt_dnpage
+__kdb2_bt_dpage
+__kdb2_bt_dump
 __kdb2_bt_fd
 __kdb2_bt_free
 __kdb2_bt_get
@@ -25,6 +29,7 @@ __kdb2_bt_search
 __kdb2_bt_seq
 __kdb2_bt_setcur
 __kdb2_bt_split
+__kdb2_bt_stat
 __kdb2_bt_sync
 __kdb2_call_hash
 __kdb2_cursor_creat
@@ -94,6 +99,7 @@ kdb2_mpool_get
 kdb2_mpool_new
 kdb2_mpool_open
 kdb2_mpool_put
+kdb2_mpool_stat
 kdb2_mpool_sync
 kdb2_nextkey
 kdb2_store
diff --git a/src/plugins/kdb/db2/libdb2/mpool/mpool.c b/src/plugins/kdb/db2/libdb2/mpool/mpool.c
index 7941a9f..8dcda69 100644
--- a/src/plugins/kdb/db2/libdb2/mpool/mpool.c
+++ b/src/plugins/kdb/db2/libdb2/mpool/mpool.c
@@ -507,4 +507,10 @@ mpool_stat(mp)
 	}
 	(void)fprintf(stderr, "\n");
 }
+#else
+void
+mpool_stat(mp)
+	MPOOL *mp;
+{
+}
 #endif
diff --git a/src/plugins/kdb/db2/libdb2/mpool/mpool.h b/src/plugins/kdb/db2/libdb2/mpool/mpool.h
index bed5ed3..7957df6 100644
--- a/src/plugins/kdb/db2/libdb2/mpool/mpool.h
+++ b/src/plugins/kdb/db2/libdb2/mpool/mpool.h
@@ -111,7 +111,7 @@ int	 mpool_delete __P((MPOOL *, void *));
 int	 mpool_put __P((MPOOL *, void *, u_int));
 int	 mpool_sync __P((MPOOL *));
 int	 mpool_close __P((MPOOL *));
-#ifdef STATISTICS
+
 void	 mpool_stat __P((MPOOL *));
-#endif
+
 __END_DECLS


More information about the cvs-krb5 mailing list