From 8c59d4cc3cfec84d6e4a694f87c319d2564984a3 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Mon, 8 Aug 2016 09:13:59 -0400 Subject: [PATCH] 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 b302ca60d3..d0bb56e0a1 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 5dbc2e4389..4d3494704a 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 7941a9f81c..8dcda693ef 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 bed5ed3a1c..7957df6977 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 -- 2.47.2