Commit 88ba4bea authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Reduce symbol visibility. Fixes #467.

git-svn-id: file:///svn/tokudb@2541 c7de825b-a66e-492c-adef-691d508d4ae1
parent f9a88380
TAGS: */*.c */*.h TAGS: */*.c */*.h
etags */*.c */*.h etags */*.c */*.h src/lock_tree/*.c src/lock_tree/*.h src/range_tree/*.c src/range_tree/*.h
SRCDIRS = newbrt src src/tests src/range_tree src/range_tree/tests src/lock_tree src/lock_tree/tests cxx cxx/tests \ SRCDIRS = newbrt src src/tests src/range_tree src/range_tree/tests src/lock_tree src/lock_tree/tests cxx cxx/tests \
utils db-benchmark-test db-benchmark-test-cxx utils db-benchmark-test db-benchmark-test-cxx
......
...@@ -254,11 +254,11 @@ struct __toku_dbt { ...@@ -254,11 +254,11 @@ struct __toku_dbt {
#ifdef _TOKUDB_WRAP_H #ifdef _TOKUDB_WRAP_H
#define txn_begin txn_begin_tokudb #define txn_begin txn_begin_tokudb
#endif #endif
int db_env_create(DB_ENV **, u_int32_t); int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
int db_create(DB **, DB_ENV *, u_int32_t); int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
char *db_strerror(int); char *db_strerror(int) __attribute__((__visibility__("default")));
const char *db_version(int*,int *,int *); const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
int log_compare (const DB_LSN*, const DB_LSN *); int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
...@@ -270,11 +270,11 @@ struct __toku_dbt { ...@@ -270,11 +270,11 @@ struct __toku_dbt {
#ifdef _TOKUDB_WRAP_H #ifdef _TOKUDB_WRAP_H
#define txn_begin txn_begin_tokudb #define txn_begin txn_begin_tokudb
#endif #endif
int db_env_create(DB_ENV **, u_int32_t); int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
int db_create(DB **, DB_ENV *, u_int32_t); int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
char *db_strerror(int); char *db_strerror(int) __attribute__((__visibility__("default")));
const char *db_version(int*,int *,int *); const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
int log_compare (const DB_LSN*, const DB_LSN *); int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
...@@ -272,11 +272,11 @@ struct __toku_dbt { ...@@ -272,11 +272,11 @@ struct __toku_dbt {
#ifdef _TOKUDB_WRAP_H #ifdef _TOKUDB_WRAP_H
#define txn_begin txn_begin_tokudb #define txn_begin txn_begin_tokudb
#endif #endif
int db_env_create(DB_ENV **, u_int32_t); int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
int db_create(DB **, DB_ENV *, u_int32_t); int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
char *db_strerror(int); char *db_strerror(int) __attribute__((__visibility__("default")));
const char *db_version(int*,int *,int *); const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
int log_compare (const DB_LSN*, const DB_LSN *); int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
...@@ -272,11 +272,11 @@ struct __toku_dbt { ...@@ -272,11 +272,11 @@ struct __toku_dbt {
#ifdef _TOKUDB_WRAP_H #ifdef _TOKUDB_WRAP_H
#define txn_begin txn_begin_tokudb #define txn_begin txn_begin_tokudb
#endif #endif
int db_env_create(DB_ENV **, u_int32_t); int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
int db_create(DB **, DB_ENV *, u_int32_t); int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
char *db_strerror(int); char *db_strerror(int) __attribute__((__visibility__("default")));
const char *db_version(int*,int *,int *); const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
int log_compare (const DB_LSN*, const DB_LSN *); int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#define VISIBLE "__attribute__((__visibility__(\"default\")))"
void print_dbtype(void) { void print_dbtype(void) {
/* DBTYPE is mentioned by db_open.html */ /* DBTYPE is mentioned by db_open.html */
...@@ -297,11 +298,11 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un ...@@ -297,11 +298,11 @@ int main (int argc __attribute__((__unused__)), char *argv[] __attribute__((__un
print_struct("dbt", 0, dbt_fields32, dbt_fields64, sizeof(dbt_fields32)/sizeof(dbt_fields32[0])); print_struct("dbt", 0, dbt_fields32, dbt_fields64, sizeof(dbt_fields32)/sizeof(dbt_fields32[0]));
printf("#ifdef _TOKUDB_WRAP_H\n#define txn_begin txn_begin_tokudb\n#endif\n"); printf("#ifdef _TOKUDB_WRAP_H\n#define txn_begin txn_begin_tokudb\n#endif\n");
printf("int db_env_create(DB_ENV **, u_int32_t);\n"); printf("int db_env_create(DB_ENV **, u_int32_t) %s;\n", VISIBLE);
printf("int db_create(DB **, DB_ENV *, u_int32_t);\n"); printf("int db_create(DB **, DB_ENV *, u_int32_t) %s;\n", VISIBLE);
printf("char *db_strerror(int);\n"); printf("char *db_strerror(int) %s;\n", VISIBLE);
printf("const char *db_version(int*,int *,int *);\n"); printf("const char *db_version(int*,int *,int *) %s;\n", VISIBLE);
printf("int log_compare (const DB_LSN*, const DB_LSN *);\n"); printf("int log_compare (const DB_LSN*, const DB_LSN *) %s;\n", VISIBLE);
printf("#if defined(__cplusplus)\n}\n#endif\n"); printf("#if defined(__cplusplus)\n}\n#endif\n");
printf("#endif\n"); printf("#endif\n");
return 0; return 0;
......
...@@ -272,11 +272,11 @@ struct __toku_dbt { ...@@ -272,11 +272,11 @@ struct __toku_dbt {
#ifdef _TOKUDB_WRAP_H #ifdef _TOKUDB_WRAP_H
#define txn_begin txn_begin_tokudb #define txn_begin txn_begin_tokudb
#endif #endif
int db_env_create(DB_ENV **, u_int32_t); int db_env_create(DB_ENV **, u_int32_t) __attribute__((__visibility__("default")));
int db_create(DB **, DB_ENV *, u_int32_t); int db_create(DB **, DB_ENV *, u_int32_t) __attribute__((__visibility__("default")));
char *db_strerror(int); char *db_strerror(int) __attribute__((__visibility__("default")));
const char *db_version(int*,int *,int *); const char *db_version(int*,int *,int *) __attribute__((__visibility__("default")));
int log_compare (const DB_LSN*, const DB_LSN *); int log_compare (const DB_LSN*, const DB_LSN *) __attribute__((__visibility__("default")));
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
...@@ -30,7 +30,7 @@ FPICFLAGS = -fPIC ...@@ -30,7 +30,7 @@ FPICFLAGS = -fPIC
DTOOL = valgrind --quiet --error-exitcode=1 --leak-check=yes DTOOL = valgrind --quiet --error-exitcode=1 --leak-check=yes
endif endif
CFLAGS = -Wall -W $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) -Wshadow CFLAGS = -Wall -W $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) -Wshadow -fvisibility=hidden
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS)
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
......
...@@ -3,9 +3,12 @@ ...@@ -3,9 +3,12 @@
LIBNAME=libtokudb LIBNAME=libtokudb
EXPORTMAP = -Wl,--version-script=export.map
VISIBILITY = -fvisibility=hidden
OPTFLAGS = -O2 OPTFLAGS = -O2
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage # GCOV_FLAGS = -fprofile-arcs -ftest-coverage
CFLAGS = -W -Wall -Werror -g3 -ggdb3 -fPIC $(OPTFLAGS) $(GCOV_FLAGS) CFLAGS = -W -Wall -Werror -g3 -ggdb3 -fPIC $(OPTFLAGS) $(GCOV_FLAGS) $(VISIBILITY)
CPPFLAGS = -I../include -I../newbrt -I./lock_tree/ -I./range_tree/ CPPFLAGS = -I../include -I../newbrt -I./lock_tree/ -I./range_tree/
CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
...@@ -18,6 +21,7 @@ CFLAGS+=-fno-common ...@@ -18,6 +21,7 @@ CFLAGS+=-fno-common
else else
LIBEXT=so LIBEXT=so
SHARED=-shared SHARED=-shared
SHARED=-shared $(EXPORTMAP)
RPATHNAME= RPATHNAME=
endif endif
......
...@@ -13,9 +13,12 @@ else ...@@ -13,9 +13,12 @@ else
GCOV_FLAGS = GCOV_FLAGS =
endif endif
VISIBILITY = -fvisibility=hidden
CFLAGS = -W -Wall -Wextra -Werror -fPIC $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) CFLAGS = -W -Wall -Wextra -Werror -fPIC $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS)
CFLAGS += -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return CFLAGS += -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return
CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute
CFLAGS += $(VISIBILITY)
CPPFLAGS = -I. -I.. -I../range_tree -I../../include -I../../newbrt -L../range_tree CPPFLAGS = -I. -I.. -I../range_tree -I../../include -I../../newbrt -L../range_tree
CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
......
...@@ -13,9 +13,12 @@ else ...@@ -13,9 +13,12 @@ else
GCOV_FLAGS = GCOV_FLAGS =
endif endif
VISIBILITY = -fvisibility=hidden
CFLAGS = -W -Wall -Wextra -Werror -fPIC $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) CFLAGS = -W -Wall -Wextra -Werror -fPIC $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS)
CFLAGS += -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return CFLAGS += -Wbad-function-cast -Wcast-align -Wconversion -Waggregate-return
CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute CFLAGS += -Wmissing-noreturn -Wmissing-format-attribute
CFLAGS += $(VISIBILITY)
CPPFLAGS = -I../../include -I../../newbrt CPPFLAGS = -I../../include -I../../newbrt
CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE CPPFLAGS += -D_GNU_SOURCE -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment