Changeset: cafaecabe983 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cafaecabe983
Modified Files:
        common/options/monet_getopt.h
        common/options/monet_options.h
        common/stream/stream.h
        common/utils/mcrypt.h
        common/utils/msabaoth.h
        common/utils/mutils.h
        common/utils/muuid.h
        embedded/CMakeLists.txt
        embedded/monetdb_embedded.c
        gdk/gdk_bbp.c
        gdk/gdk_calc_private.h
        gdk/gdk_private.h
        gdk/gdk_storage.h
        gdk/gdk_system.h
        monetdb5/mal/mal.h
        monetdb5/mal/mal_atom.h
        monetdb5/mal/mal_authorize.h
        monetdb5/mal/mal_builder.h
        monetdb5/mal/mal_client.h
        monetdb5/mal/mal_dataflow.h
        monetdb5/mal/mal_debugger.h
        monetdb5/mal/mal_embedded.h
        monetdb5/mal/mal_exception.h
        monetdb5/mal/mal_factory.c
        monetdb5/mal/mal_factory.h
        monetdb5/mal/mal_function.h
        monetdb5/mal/mal_import.h
        monetdb5/mal/mal_instruction.h
        monetdb5/mal/mal_interpreter.h
        monetdb5/mal/mal_linker.h
        monetdb5/mal/mal_listing.h
        monetdb5/mal/mal_module.c
        monetdb5/mal/mal_module.h
        monetdb5/mal/mal_namespace.c
        monetdb5/mal/mal_namespace.h
        monetdb5/mal/mal_parser.c
        monetdb5/mal/mal_parser.h
        monetdb5/mal/mal_private.h
        monetdb5/mal/mal_profiler.h
        monetdb5/mal/mal_resolve.h
        monetdb5/mal/mal_resource.h
        monetdb5/mal/mal_runtime.h
        monetdb5/mal/mal_scenario.h
        monetdb5/mal/mal_session.h
        monetdb5/mal/mal_stack.h
        monetdb5/mal/mal_type.h
        monetdb5/mal/mal_utils.h
        monetdb5/modules/atoms/mtime_private.h
        monetdb5/modules/atoms/str.c
        monetdb5/modules/kernel/mmath_private.h
        monetdb5/optimizer/opt_prelude.h
        monetdb5/optimizer/opt_support.c
        monetdb5/optimizer/opt_wrapper.c
        sql/backends/monet5/mal_backend.h
        sql/backends/monet5/rel_bin.h
        sql/backends/monet5/sql.h
        sql/backends/monet5/sql_gencode.h
        sql/backends/monet5/sql_optimizer.h
        sql/backends/monet5/sql_result.h
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_scenario.h
        sql/backends/monet5/sql_statement.c
        sql/backends/monet5/sql_statement.h
        sql/backends/monet5/sql_statistics.h
        sql/backends/monet5/sql_upgrades.h
        sql/backends/monet5/sql_user.h
        sql/common/sql_backend.h
        sql/common/sql_string.h
        sql/common/sql_types.h
        sql/include/sql_catalog.h
        sql/include/sql_hash.h
        sql/include/sql_keyword.h
        sql/include/sql_list.h
        sql/include/sql_mem.h
        sql/include/sql_stack.h
        sql/server/rel_distribute.h
        sql/server/rel_dump.h
        sql/server/rel_exp.h
        sql/server/rel_optimizer.h
        sql/server/rel_partition.h
        sql/server/rel_planner.h
        sql/server/rel_prop.h
        sql/server/rel_propagate.h
        sql/server/rel_psm.c
        sql/server/rel_psm.h
        sql/server/rel_rel.h
        sql/server/rel_remote.h
        sql/server/rel_schema.h
        sql/server/rel_select.h
        sql/server/rel_semantic.h
        sql/server/rel_sequence.h
        sql/server/rel_trans.h
        sql/server/rel_unnest.h
        sql/server/rel_updates.h
        sql/server/rel_xml.h
        sql/server/sql_atom.h
        sql/server/sql_datetime.h
        sql/server/sql_decimal.h
        sql/server/sql_env.h
        sql/server/sql_mvc.h
        sql/server/sql_parser.h
        sql/server/sql_parser.y
        sql/server/sql_partition.h
        sql/server/sql_privileges.h
        sql/server/sql_qc.h
        sql/server/sql_query.h
        sql/server/sql_scan.c
        sql/server/sql_scan.h
        sql/server/sql_semantic.h
        sql/server/sql_symbol.c
        sql/server/sql_symbol.h
        sql/storage/bat/bat_logger.h
        sql/storage/bat/bat_storage.h
        sql/storage/bat/bat_table.h
        sql/storage/bat/bat_utils.h
        sql/storage/sql_storage.h
        sql/storage/store.c
        sql/storage/store_sequence.h
Branch: cmake-monetdblite
Log Message:

Reduce number of global symbols on ELF platforms.


diffs (truncated from 4222 to 300 lines):

diff --git a/common/options/monet_getopt.h b/common/options/monet_getopt.h
--- a/common/options/monet_getopt.h
+++ b/common/options/monet_getopt.h
@@ -48,7 +48,9 @@ extern "C" {
 
 #ifndef moptions_export
 /* avoid using "#ifdef WIN32" so that this file does not need our config.h */
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+#ifdef HAVE_EMBEDDED
+#define moptions_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 #if !defined(LIBMOPTIONS)
 #define moptions_export extern __declspec(dllimport)
 #else
diff --git a/common/options/monet_options.h b/common/options/monet_options.h
--- a/common/options/monet_options.h
+++ b/common/options/monet_options.h
@@ -27,7 +27,9 @@ extern "C" {
 
 #ifndef moptions_export
 /* avoid using "#ifdef WIN32" so that this file does not need our config.h */
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+#ifdef HAVE_EMBEDDED
+#define moptions_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 #if !defined(LIBMOPTIONS)
 #define moptions_export extern __declspec(dllimport)
 #else
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -29,7 +29,9 @@
 #include <limits.h>
 
 /* avoid using "#ifdef WIN32" so that this file does not need our config.h */
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+#ifdef HAVE_EMBEDDED
+#define stream_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 # ifndef LIBSTREAM
 #  define stream_export extern __declspec(dllimport)
 # else
diff --git a/common/utils/mcrypt.h b/common/utils/mcrypt.h
--- a/common/utils/mcrypt.h
+++ b/common/utils/mcrypt.h
@@ -9,7 +9,9 @@
 #ifndef MT_SEEN_MCRYPT_H
 #define MT_SEEN_MCRYPT_H 1
 
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+#ifdef HAVE_EMBEDDED
+#define mcrypt_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 #if !defined(LIBMCRYPT)
 #define mcrypt_export extern __declspec(dllimport)
 #else
diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h
--- a/common/utils/msabaoth.h
+++ b/common/utils/msabaoth.h
@@ -53,7 +53,9 @@ typedef struct Ssabuplog {
        double crashavg30; /* average of crashes in the last 30 start attempts 
*/
 } sabuplog;
 
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+#ifdef HAVE_EMBEDDED
+#define msab_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 #if !defined(LIBMSABAOTH)
 #define msab_export extern __declspec(dllimport)
 #else
diff --git a/common/utils/mutils.h b/common/utils/mutils.h
--- a/common/utils/mutils.h
+++ b/common/utils/mutils.h
@@ -11,7 +11,9 @@
 
 #include "monetdb_config.h"
 
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+#ifdef HAVE_EMBEDDED
+#define mutils_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 #if !defined(LIBMUTILS)
 #define mutils_export extern __declspec(dllimport)
 #else
diff --git a/common/utils/muuid.h b/common/utils/muuid.h
--- a/common/utils/muuid.h
+++ b/common/utils/muuid.h
@@ -13,15 +13,20 @@
  * msabaoth is part of monetdb5 and we want this function to be
  * exported so that the call in sql can be satisfied by the version
  * that is included in monetdb5 */
-extern
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+
+#ifdef HAVE_EMBEDDED
+#define muuid_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 #if !defined(LIBMUUID)
-__declspec(dllimport)
+#define muuid_export extern __declspec(dllimport)
 #else
-__declspec(dllexport)
+#define muuid_export extern __declspec(dllexport)
 #endif
+#else
+#define muuid_export extern
 #endif
-char *generateUUID(void);
+
+muuid_export char* generateUUID(void);
 
 #endif
 
diff --git a/embedded/CMakeLists.txt b/embedded/CMakeLists.txt
--- a/embedded/CMakeLists.txt
+++ b/embedded/CMakeLists.txt
@@ -202,7 +202,7 @@ add_library(monetdblite_no_export STATIC
                $<TARGET_OBJECTS:bisonlite_obj>)
 set_target_properties(monetdblite_no_export PROPERTIES 
POSITION_INDEPENDENT_CODE ON)
 target_link_libraries(monetdblite_no_export PUBLIC ${MATH_LIBRARIES} 
${THREAD_LIBRARIES} ${DL_LIBRARIES}
-                                         ${KVM_LIBRARIES} ${PSAPI_LIBRARIES} 
monetdblite_no_export)
+                                         ${KVM_LIBRARIES} ${PSAPI_LIBRARIES})
 
 add_library(monetdblite SHARED
                        monetdb_embedded.c
diff --git a/embedded/monetdb_embedded.c b/embedded/monetdb_embedded.c
--- a/embedded/monetdb_embedded.c
+++ b/embedded/monetdb_embedded.c
@@ -48,7 +48,7 @@ validate_connection(monetdb_connection c
        return MAL_SUCCEED;
 }
 
-MT_Lock embedded_lock = MT_LOCK_INITIALIZER("embedded_lock");
+static MT_Lock embedded_lock = MT_LOCK_INITIALIZER("embedded_lock");
 
 static void monetdb_destroy_column(monetdb_column* column);
 
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -111,8 +111,8 @@ struct BBPfarm_t BBPfarms[MAXFARMS];
  * tuned for perfect hashing (1 lookup). The bucket chain uses the
  * 'next' field in the BBPrec records.
  */
-bat *BBP_hash = NULL;          /* BBP logical name hash buckets */
-bat BBP_mask = 0;              /* number of buckets = & mask */
+static bat *BBP_hash = NULL;           /* BBP logical name hash buckets */
+static bat BBP_mask = 0;               /* number of buckets = & mask */
 
 static gdk_return BBPfree(BAT *b, const char *calledFrom);
 static void BBPdestroy(BAT *b);
diff --git a/gdk/gdk_calc_private.h b/gdk/gdk_calc_private.h
--- a/gdk/gdk_calc_private.h
+++ b/gdk/gdk_calc_private.h
@@ -314,4 +314,4 @@
 BUN
 dofsum(const void *restrict values, oid seqb, BUN start, BUN end, void 
*restrict results, BUN ngrp, int tp1, int tp2,
           const oid *restrict cand, const oid *candend, const oid *restrict 
gids, oid min, oid max, bool skip_nils,
-          bool abort_on_error, bool nil_if_empty, const char *func);
+          bool abort_on_error, bool nil_if_empty, const char *func) 
__attribute__((__visibility__("hidden")));
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -78,7 +78,8 @@ gdk_return BBPcacheit(BAT *bn, bool lock
        __attribute__((__warn_unused_result__))
        __attribute__((__visibility__("hidden")));
 void BBPdump(void)             /* never called: for debugging only */
-       __attribute__((__cold__));
+       __attribute__((__cold__))
+       __attribute__((__visibility__("hidden")));
 void BBPexit(void)
        __attribute__((__visibility__("hidden")));
 BAT *BBPgetdesc(bat i)
@@ -199,7 +200,8 @@ int IMPSgetbin(int tpe, bte bits, const 
        __attribute__((__visibility__("hidden")));
 #ifndef NDEBUG
 void IMPSprint(BAT *b)         /* never called: for debugging only */
-       __attribute__((__cold__));
+       __attribute__((__cold__))
+       __attribute__((__visibility__("hidden")));
 #endif
 void MT_init_posix(void)
        __attribute__((__visibility__("hidden")));
@@ -325,20 +327,20 @@ typedef char long_str[IDLENGTH];  /* stan
 
 #define MAXFARMS       32
 
-extern struct BBPfarm_t {
+gdk_extern struct BBPfarm_t {
        unsigned int roles;     /* bitmask of allowed roles */
        const char *dirname;    /* farm directory */
        FILE *lock_file;
 } BBPfarms[MAXFARMS];
 
-extern batlock_t GDKbatLock[BBP_BATMASK + 1];
-extern bbplock_t GDKbbpLock[BBP_THREADMASK + 1];
-extern size_t GDK_mmap_minsize_persistent; /* size after which we use memory 
mapped files for persistent heaps */
-extern size_t GDK_mmap_minsize_transient; /* size after which we use memory 
mapped files for transient heaps */
-extern size_t GDK_mmap_pagesize; /* mmap granularity */
-extern MT_Lock GDKnameLock;
-extern MT_Lock GDKthreadLock;
-extern MT_Lock GDKtmLock;
+gdk_extern batlock_t GDKbatLock[BBP_BATMASK + 1];
+gdk_extern bbplock_t GDKbbpLock[BBP_THREADMASK + 1];
+gdk_extern size_t GDK_mmap_minsize_persistent; /* size after which we use 
memory mapped files for persistent heaps */
+gdk_extern size_t GDK_mmap_minsize_transient; /* size after which we use 
memory mapped files for transient heaps */
+gdk_extern size_t GDK_mmap_pagesize; /* mmap granularity */
+gdk_extern MT_Lock GDKnameLock;
+gdk_extern MT_Lock GDKthreadLock;
+gdk_extern MT_Lock GDKtmLock;
 
 #define BATcheck(tst, msg, err)                                                
\
        do {                                                            \
diff --git a/gdk/gdk_storage.h b/gdk/gdk_storage.h
--- a/gdk/gdk_storage.h
+++ b/gdk/gdk_storage.h
@@ -9,6 +9,6 @@
 #ifndef _GDK_STORAGE_H_
 #define _GDK_STORAGE_H_
 
-extern void DESCclean(BAT *);
+gdk_extern void DESCclean(BAT *);
 
 #endif /* _GDK_STORAGE_H_ */
diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h
--- a/gdk/gdk_system.h
+++ b/gdk/gdk_system.h
@@ -12,7 +12,11 @@
 #include "mutils.h"
 #include "stream.h"
 
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
+#define gdk_extern extern __attribute__((__visibility__("hidden")))
+
+#ifdef HAVE_EMBEDDED
+#define gdk_export extern __attribute__((__visibility__("hidden")))
+#elif defined(WIN32)
 #ifndef LIBGDK
 #define gdk_export extern __declspec(dllimport)
 #else
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -16,6 +16,8 @@
 
 #include "gdk.h"
 
+#define mal_extern extern __attribute__((__visibility__("hidden")))
+
 #ifdef WIN32
 #if !defined(LIBMONETDB5)
 #define mal_export extern __declspec(dllimport)
@@ -26,16 +28,6 @@
 #define mal_export extern
 #endif
 
-#if defined(WIN32) && !defined(HAVE_EMBEDDED)
-#if !defined(LIBMONETDB5)
-#define mal5_export extern __declspec(dllimport)
-#else
-#define mal5_export extern __declspec(dllexport)
-#endif
-#else
-#define mal5_export extern
-#endif
-
 #ifndef NATIVE_WIN32
 # include <sys/times.h>
 #endif
@@ -56,13 +48,13 @@
 #define GB (((lng)1024)*1024*1024)
 #define MEMORY_THRESHOLD  (0.2 * monet_memory > 8 * GB?  monet_memory - 8 * 
GB: 0.8 * monet_memory)
 
-mal5_export char   monet_cwd[FILENAME_MAX];
-mal5_export size_t monet_memory;
-mal5_export char   monet_characteristics[4096];
-mal5_export lng    memorypool;      /* memory claimed by concurrent threads */
-mal5_export int    memoryclaims;    /* number of threads active with expensive 
operations */
+mal_export char   monet_cwd[FILENAME_MAX];
+mal_export size_t monet_memory;
+mal_export char   monet_characteristics[4096];
+mal_export lng    memorypool;      /* memory claimed by concurrent threads */
+mal_export int    memoryclaims;    /* number of threads active with expensive 
operations */
 #ifdef HAVE_HGE
-mal5_export int have_hge;
+mal_export int have_hge;
 #endif
 
 /*
@@ -82,12 +74,12 @@ mal5_export int have_hge;
 #define GRPoptimizers  (OPTMASK)
 #define GRPforcemito (FORCEMITOMASK | NOSYNCMASK)
 
-mal5_export MT_Lock  mal_contextLock;
-mal5_export MT_Lock  mal_remoteLock;
-mal5_export MT_Lock  mal_profileLock ;
-mal5_export MT_Lock  mal_copyLock ;
-mal5_export MT_Lock  mal_delayLock ;
-mal5_export MT_Lock  mal_oltpLock ;
+mal_export MT_Lock  mal_contextLock;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to